Revert "Fix unhelpful error messages in aggregate jobs."
[?]
Oct 24, 2021, 2:23 AM
VA3Z62HQORGCVMKEDRX7CDC3RE7ZCEUOD5F3GVJDIF2SG2TXTJ4QCDependencies
- [2]
KTH67GR4hydra-eval-jobs: Transmit original Nix error when handling aggregate jobs - [3]
D4G756UKhydra-eval-jobs: Identify unexpected errors in handling aggregate jobs - [4]
4DHGJ2FLFix build - [5]
VUYJ47EVhydra-eval-jobs: Parallelize - [6]
6NUK6AZAFix build - [7]
NQPGIRXXRevert "hydra-eval-jobs -> nix eval-hydra-jobs"
Change contents
- edit in src/hydra-eval-jobs/hydra-eval-jobs.cc at line 441
// For the error messagestd::string lastTriedJobName = i.key(); - replacement in src/hydra-eval-jobs/hydra-eval-jobs.cc at line 445[3.12790]→[3.90:820](∅→∅),[3.143]→[3.13376:13377](∅→∅),[3.820]→[3.13376:13377](∅→∅),[3.13376]→[3.13376:13377](∅→∅),[3.13377]→[3.821:1166](∅→∅),[3.1166]→[2.0:804](∅→∅),[2.804]→[3.1501:1523](∅→∅),[3.1501]→[3.1501:1523](∅→∅)
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);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);if ((*job2).find("error") != (*job2).end()) {if (job.find("error") == job.end()) {job["error"] = fmt("Errors aggregating aggregate job '%1%'.\n", jobName);}job["error"] = fmt("While handling '%1%': %2%\n", jobName2, (std::string) (*job2)["error"]);} else {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};}}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); - replacement in src/hydra-eval-jobs/hydra-eval-jobs.cc at line 457
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));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};} - replacement in src/hydra-eval-jobs/hydra-eval-jobs.cc at line 467
debug("rewrote aggregate derivation %s -> %s", store->printStorePath(drvPath), newDrvPath);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)); - replacement in src/hydra-eval-jobs/hydra-eval-jobs.cc at line 476
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);debug("rewrote aggregate derivation %s -> %s", store->printStorePath(drvPath), newDrvPath); - replacement in src/hydra-eval-jobs/hydra-eval-jobs.cc at line 478
// And throw the original exception!throw;job["drvPath"] = newDrvPath;job["outputs"]["out"] = store->printStorePath(outPath);