mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 00:08:07 +02:00
Merge pull request #4724 from NixOS/nix-shell-missing-outputs
Make `nix shell` fallback to static outputs when needed
This commit is contained in:
commit
dd83b29b90
1 changed files with 12 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue