hydra-eval-jobs: Identify unexpected errors in handling aggregate jobs
[?]
Oct 25, 2020, 10:50 PM
D4G756UKRXYU6QEKD6TGN2VAL7PDJMLBMQALHKDPZU3I6U5KVTYQCDependencies
- [2]
4DHGJ2FLFix build - [3]
VUYJ47EVhydra-eval-jobs: Parallelize - [4]
WEFXD6SWFix build - [5]
6NUK6AZAFix build - [6]
YSZQ3ORRFix build - [7]
QHO6IDC7Fix build - [8]
NQPGIRXXRevert "hydra-eval-jobs -> nix eval-hydra-jobs"
Change contents
- edit in src/hydra-eval-jobs/hydra-eval-jobs.cc at line 445
// For the error messagestd::string lastTriedJobName = i.key(); - replacement in src/hydra-eval-jobs/hydra-eval-jobs.cc at line 451
if (myArgs.dryRun) {for (std::string jobName2 : *named) {auto job2 = state->jobs.find(jobName2);if (job2 == state->jobs.end())throw Error("aggregate job '%s' references non-existent job '%s'", jobName, jobName2);std::string drvPath2 = (*job2)["drvPath"];job["constituents"].push_back(drvPath2);}} else {auto drvPath = store->parseStorePath((std::string) job["drvPath"]);auto drv = store->readDerivation(drvPath);try {if (myArgs.dryRun) {for (std::string jobName2 : *named) {lastTriedJobName = jobName2;auto job2 = state->jobs.find(jobName2);if (job2 == state->jobs.end())throw Error("aggregate job '%s' references non-existent job '%s'", jobName, jobName2);std::string drvPath2 = (*job2)["drvPath"];job["constituents"].push_back(drvPath2);}} else {auto drvPath = store->parseStorePath((std::string) job["drvPath"]);auto drv = store->readDerivation(drvPath); - replacement in src/hydra-eval-jobs/hydra-eval-jobs.cc at line 465[3.13377]→[3.13377:13653](∅→∅),[3.13653]→[3.144:463](∅→∅),[3.463]→[3.13943:13961](∅→∅),[3.13943]→[3.13943:13961](∅→∅)
for (std::string jobName2 : *named) {auto job2 = state->jobs.find(jobName2);if (job2 == state->jobs.end())throw Error("aggregate job '%s' references non-existent job '%s'", jobName, jobName2);auto drvPath2 = store->parseStorePath((std::string) (*job2)["drvPath"]);auto drv2 = store->readDerivation(drvPath2);job["constituents"].push_back(store->printStorePath(drvPath2));drv.inputDrvs[drvPath2] = {drv2.outputs.begin()->first};}for (std::string jobName2 : *named) {lastTriedJobName = jobName2;auto job2 = state->jobs.find(jobName2);if (job2 == state->jobs.end())throw Error("aggregate job '%s' references non-existent job '%s'", jobName, jobName2);auto drvPath2 = store->parseStorePath((std::string) (*job2)["drvPath"]);auto drv2 = store->readDerivation(drvPath2);job["constituents"].push_back(store->printStorePath(drvPath2));drv.inputDrvs[drvPath2] = {drv2.outputs.begin()->first};} - replacement in src/hydra-eval-jobs/hydra-eval-jobs.cc at line 476[3.13962]→[3.464:517](∅→∅),[3.517]→[3.14038:14166](∅→∅),[3.14038]→[3.14038:14166](∅→∅),[3.14166]→[3.0:82](∅→∅),[3.82]→[3.14232:14370](∅→∅),[3.14232]→[3.14232:14370](∅→∅),[3.14370]→[3.518:654](∅→∅),[3.654]→[2.0:87](∅→∅)
std::string drvName(drvPath.name());assert(hasSuffix(drvName, drvExtension));drvName.resize(drvName.size() - drvExtension.size());auto h = std::get<Hash>(hashDerivationModulo(*store, drv, true));auto outPath = store->makeOutputPath("out", h, drvName);drv.env["out"] = store->printStorePath(outPath);drv.outputs.insert_or_assign("out", DerivationOutput { .output = DerivationOutputInputAddressed { .path = outPath } });auto newDrvPath = store->printStorePath(writeDerivation(*store, drv));std::string drvName(drvPath.name());assert(hasSuffix(drvName, drvExtension));drvName.resize(drvName.size() - drvExtension.size());auto h = std::get<Hash>(hashDerivationModulo(*store, drv, true));auto outPath = store->makeOutputPath("out", h, drvName);drv.env["out"] = store->printStorePath(outPath);drv.outputs.insert_or_assign("out", DerivationOutput { .output = DerivationOutputInputAddressed { .path = outPath } });auto newDrvPath = store->printStorePath(writeDerivation(*store, drv));debug("rewrote aggregate derivation %s -> %s", store->printStorePath(drvPath), newDrvPath); - replacement in src/hydra-eval-jobs/hydra-eval-jobs.cc at line 487
debug("rewrote aggregate derivation %s -> %s", store->printStorePath(drvPath), newDrvPath);job["drvPath"] = newDrvPath;job["outputs"]["out"] = store->printStorePath(outPath);}} catch (std::exception & e) {// Print more information to help debugging.printError("Unexpected error in hydra-eval-jobs when handling job '%s', when producing aggregate job '%s':", lastTriedJobName, jobName); - replacement in src/hydra-eval-jobs/hydra-eval-jobs.cc at line 494
job["drvPath"] = newDrvPath;job["outputs"]["out"] = store->printStorePath(outPath);// And throw the original exception!throw;