aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd/installables.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-04-22 10:33:00 +0200
committerEelco Dolstra <edolstra@gmail.com>2021-04-22 10:33:00 +0200
commitd9864be4b757468d33bc49edddce5e4f04ef4b90 (patch)
tree955d203cd2ac6926429b58694c8bd90513e58639 /src/libcmd/installables.cc
parent78a2303b3d5203d8f1de96d1adbd2cc0b5b73c47 (diff)
parentdd83b29b90031456975384ee71d4fa6d68abe354 (diff)
Merge branch 'master' of github.com:NixOS/nix
Diffstat (limited to 'src/libcmd/installables.cc')
-rw-r--r--src/libcmd/installables.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc
index 06ef4c669..10855688c 100644
--- a/src/libcmd/installables.cc
+++ b/src/libcmd/installables.cc
@@ -736,9 +736,18 @@ std::set<RealisedPath> toRealisedPaths(
output.first);
auto outputId = DrvOutput{outputHashes.at(output.first), output.first};
auto realisation = store->queryRealisation(outputId);
- if (!realisation)
- throw Error("cannot operate on an output of unbuilt content-addresed derivation '%s'", outputId.to_string());
- res.insert(RealisedPath{*realisation});
+ if (!realisation) {
+ // TODO: remove this check once #4725 is fixed
+ // as we’ll 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