From 7110a1a6c74f11cb3205e0834a2b2f1ae52f648d Mon Sep 17 00:00:00 2001 From: Tom Bereknyei Date: Sun, 1 Jan 2023 23:20:13 -0500 Subject: [PATCH] fix: catch errors for invalid derivations --- src/nix-eval-jobs.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/nix-eval-jobs.cc b/src/nix-eval-jobs.cc index f6dacb5..b3e00b1 100644 --- a/src/nix-eval-jobs.cc +++ b/src/nix-eval-jobs.cc @@ -184,9 +184,14 @@ struct Drv { auto localStore = state.store.dynamic_pointer_cast(); - for (auto out : drvInfo.queryOutputs(true)) { - if (out.second) - outputs[out.first] = localStore->printStorePath(*out.second); + try { + for (auto out : drvInfo.queryOutputs(true)) { + if (out.second) + outputs[out.first] = + localStore->printStorePath(*out.second); + } + } catch (const std::exception &e) { + throw EvalError("derivation must have valid outputs: %s", e.what()); } if (myArgs.meta) {