Merge branch 'master' of github.com:NixOS/nix

This commit is contained in:
Eelco Dolstra 2021-04-22 10:33:00 +02:00
commit d9864be4b7

View file

@ -736,10 +736,19 @@ std::set<RealisedPath> toRealisedPaths(
output.first);
auto outputId = DrvOutput{outputHashes.at(output.first), output.first};
auto realisation = store->queryRealisation(outputId);
if (!realisation)
if (!realisation) {
// TODO: remove this check once #4725 is fixed
// as well have the guaranty that if
// `output.second` exists, then the realisation
// will be there too
if (output.second)
res.insert(*output.second);
else
throw Error("cannot operate on an output of unbuilt content-addresed derivation '%s'", outputId.to_string());
} else {
res.insert(RealisedPath{*realisation});
}
}
else {
// If ca-derivations isn't enabled, behave as if
// all the paths are opaque to keep the default