-
-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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
make-derivation: fix position in trace #54801
Conversation
For a long time now, tracing has been broken in Nixpkgs. So when you have an eval error you would get something like this: error: while evaluating the attribute 'buildInputs' of the derivation 'hello-2.10' at /home/mbauer/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:185:11: while evaluating 'chooseDevOutputs' at /home/mbauer/nixpkgs/lib/attrsets.nix:474:22, called from undefined position: while evaluating 'optionals' at /home/mbauer/nixpkgs/lib/lists.nix:257:5, called from /home/mbauer/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:132:17: This is coming from how Nix handles string context and how make-derivation messes with the "name" attribute. This commit should restore the old behavior so you get a nice line number like: error: while evaluating the attribute 'buildInputs' of the derivation 'hello-2.10' at /home/mbauer/nixpkgs/pkgs/applications/misc/hello/default.nix:4:3: while evaluating 'chooseDevOutputs' at /home/mbauer/nixpkgs/lib/attrsets.nix:474:22, called from undefined position: while evaluating 'optionals' at /home/mbauer/nixpkgs/lib/lists.nix:257:5, called from /home/mbauer/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:132:17: NOTE: This will still be broken for cross compilation due to the prefixes we are adding to name.
We don’t want these to not even evaluate, otherwise we won’t know why they’re broken. For now, I’ve left these as the latest version for a default. In the future, maybe we should be smarter about choosing these.
sometimes this gets an infinite recursion error
This reverts commit 0307203.
01dbd28
to
febda2b
Compare
cross should have higher precedence
This broke evaluation.
|
Instead of 1. giving a default value (Referring to file |
Yeah that seems like a good idea. The errors are actually from removing the assertion. |
#55053 is meant to address this regression. |
For a long time now, tracing has been broken in Nixpkgs. So when you
have an eval error you would get something like this:
This is coming from how Nix handles string context and how
make-derivation messes with the "name" attribute. This commit should
restore the old behavior so you get a nice line number like:
NOTE: This will still be broken for cross compilation due to the
prefixes we are adding to name. It might also still be broken if you use "pname" & "version".
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)