mirror of
https://github.com/NixOS/nix
synced 2025-06-25 06:31:14 +02:00
local-derivation-goal: improve "illegal reference" error
Before the change "illegal reference" was hard to interpret as it did not mention what derivation actually hits it. Today's `nixpkgs` example: Before the change: $ nix build --no-link -f. postgresql_14 ... error: derivation contains an illegal reference specifier 'man' After the change: $ nix build --no-link -f. postgresql_14 ... error: derivation '/nix/store/bxp6g57limvwiga61vdlyvhy7i8rp6wd-postgresql-14.15.drv' output check for 'lib' contains an illegal reference specifier 'man', expected store path or output name (one of [debug, dev, doc, lib, out])
This commit is contained in:
parent
5a4e306cc5
commit
bbdc3197a9
1 changed files with 11 additions and 2 deletions
|
@ -2991,8 +2991,17 @@ void LocalDerivationGoal::checkOutputs(const std::map<std::string, ValidPathInfo
|
|||
spec.insert(worker.store.parseStorePath(i));
|
||||
else if (auto output = get(outputs, i))
|
||||
spec.insert(output->path);
|
||||
else
|
||||
throw BuildError("derivation contains an illegal reference specifier '%s'", i);
|
||||
else {
|
||||
std::string allOutputs;
|
||||
for (auto & o : outputs) {
|
||||
if (! allOutputs.empty())
|
||||
allOutputs.append(", ");
|
||||
allOutputs.append(o.first);
|
||||
}
|
||||
throw BuildError("derivation '%s' output check for '%s' contains an illegal reference specifier '%s',"
|
||||
" expected store path or output name (one of [%s])",
|
||||
worker.store.printStorePath(drvPath), outputName, i, allOutputs);
|
||||
}
|
||||
}
|
||||
|
||||
auto used = recursive
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue