mirror of
https://github.com/NixOS/nix.git
synced 2025-11-17 07:52:43 +01:00
Merge pull request #7539 from tweag/fix-nix-why-depends--derivation
Fix `nix why-depends --derivation`
This commit is contained in:
commit
0fe2b222d5
6 changed files with 23 additions and 25 deletions
|
|
@ -93,4 +93,14 @@ struct RealisedPath {
|
|||
GENERATE_CMP(RealisedPath, me->raw);
|
||||
};
|
||||
|
||||
class MissingRealisation : public Error
|
||||
{
|
||||
public:
|
||||
MissingRealisation(DrvOutput & outputId)
|
||||
: Error( "cannot operate on an output of the "
|
||||
"unbuilt derivation '%s'",
|
||||
outputId.to_string())
|
||||
{}
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -879,10 +879,7 @@ std::vector<BuildResult> RemoteStore::buildPathsWithResults(
|
|||
auto realisation =
|
||||
queryRealisation(outputId);
|
||||
if (!realisation)
|
||||
throw Error(
|
||||
"cannot operate on an output of unbuilt "
|
||||
"content-addressed derivation '%s'",
|
||||
outputId.to_string());
|
||||
throw MissingRealisation(outputId);
|
||||
res.builtOutputs.emplace(realisation->id, *realisation);
|
||||
} else {
|
||||
// If ca-derivations isn't enabled, assume that
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue