aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/misc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/misc.cc')
-rw-r--r--src/libstore/misc.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libstore/misc.cc b/src/libstore/misc.cc
index deef0875d..3d8414174 100644
--- a/src/libstore/misc.cc
+++ b/src/libstore/misc.cc
@@ -289,11 +289,16 @@ std::map<DrvOutput, StorePath> drvOutputReferences(
std::set<Realisation> inputRealisations;
for (const auto & [inputDrv, outputNames] : drv.inputDrvs) {
- auto outputHashes =
+ const auto outputHashes =
staticOutputHashes(store, store.readDerivation(inputDrv));
for (const auto & outputName : outputNames) {
+ auto outputHash = get(outputHashes, outputName);
+ if (!outputHash)
+ throw Error(
+ "output '%s' of derivation '%s' isn't realised", outputName,
+ store.printStorePath(inputDrv));
auto thisRealisation = store.queryRealisation(
- DrvOutput{outputHashes.at(outputName), outputName});
+ DrvOutput{*outputHash, outputName});
if (!thisRealisation)
throw Error(
"output '%s' of derivation '%s' isn't built", outputName,