-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
local-derivation-goal: improve "illegal reference" error #12105
base: master
Are you sure you want to change the base?
local-derivation-goal: improve "illegal reference" error #12105
Conversation
Would it be possible to also print the file that contains that reference? |
As for the postgresql_14 example itself: This could be a nix bug in the first place - see efforts in NixOS/nixpkgs#368091 to track this down. |
Commit message shows the new error message as:
Do you mean something else than '/nix/store/bxp6g57limvwiga61vdlyvhy7i8rp6wd-postgresql-14.15.drv' derivation file? |
Yeah, I mean the file inside the output. So in this case nix finds a file inside the lib output that has a reference to the man output, right? But which file inside |
Yes, I believe it's a |
Yes, 100%. |
Maybe I misunderstand the error, though... |
No, I think
Note how
for (auto & i : *value) {
if (worker.store.isStorePath(i))
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);
} I think |
Ah, ok. Now I got it. Could we change the error message as follows then? -error: derivation '/nix/store/bxp6g57limvwiga61vdlyvhy7i8rp6wd-postgresql-14.15.drv' output 'lib' contains an illegal reference specifier 'man', expected store path or output name (one of [debug, dev, doc, lib, out])
+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]) (is that correct?) |
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])
4afd6f5
to
ec46a7e
Compare
Yeah, that matches my understanding. Updated the PR with your suggestion as: --- a/src/libstore/unix/build/local-derivation-goal.cc
+++ b/src/libstore/unix/build/local-derivation-goal.cc
@@ -2936,3 +2936,3 @@ void LocalDerivationGoal::checkOutputs(const std::map<std::string, ValidPathInfo
}
- throw BuildError("derivation '%s' output '%s' contains an illegal reference specifier '%s',"
+ throw BuildError("derivation '%s' output check for '%s' contains an illegal reference specifier '%s',"
" expected store path or output name (one of [%s])", |
Motivation
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:
After the change:
Context
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.