From 069b7775c565f5999fe33e8c3f28c7b9306039ca Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 5 Dec 2023 11:26:26 -0500 Subject: [PATCH] hydra-eval-jobs: Ensure we have output path if ca-derivations is disabled Brought up by @thufschmitt in https://github.com/NixOS/hydra/pull/1316#discussion_r1415111329 . This makes this closer to what was originally there --- which just dispatched off the experimental feature rather than the presence/absense of the output, too. --- src/hydra-eval-jobs/hydra-eval-jobs.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/hydra-eval-jobs/hydra-eval-jobs.cc b/src/hydra-eval-jobs/hydra-eval-jobs.cc index d007189d..b44ccbb3 100644 --- a/src/hydra-eval-jobs/hydra-eval-jobs.cc +++ b/src/hydra-eval-jobs/hydra-eval-jobs.cc @@ -243,11 +243,16 @@ static void worker( } nlohmann::json out; - for (auto & [outputName, optOutputPath] : outputs) - if (optOutputPath) + for (auto & [outputName, optOutputPath] : outputs) { + if (optOutputPath) { out[outputName] = state.store->printStorePath(*optOutputPath); - else + } else { + // See the `queryOutputs` call above; we should + // not encounter missing output paths otherwise. + assert(experimentalFeatureSettings.isEnabled(Xp::CaDerivations)); out[outputName] = ""; + } + } job["outputs"] = std::move(out); reply["job"] = std::move(job); }