Eval fixes from release-attrpaths-superset.nix optimization (part 2)#271123
Eval fixes from release-attrpaths-superset.nix optimization (part 2)#271123infinisil merged 5 commits intoNixOS:masterfrom
Conversation
ghost
left a comment
There was a problem hiding this comment.
But please apply the two-line suggestion below.
e2f5849 to
310cda5
Compare
| in if missingArgs == {} then makeOverridable f allArgs else abort error; | ||
| in if missingArgs == {} | ||
| then makeOverridable f allArgs | ||
| else throw "lib.customisation.callPackageWith: ${error}"; |
There was a problem hiding this comment.
What was the motivation for this specific change? It makes it so nix-env -qa no longer fails and just silently drops the attrpath when querying pacakges that have missing arguments (and therefore ofborg and other CI relies on the previous behavior to catch missing argument errors during outpath calculation)
This still smells like a bug in nix-env regardless to me, so this bit in Nixpkgs probably doesn't need to be changed back, but I'm still trying to trace down in that code where/why this throw would be ignored rather than propagated as an eval error
There was a problem hiding this comment.
Nope, this is intended behavior in Nix:
Throw an error message s. This usually aborts Nix expression
evaluation, but innix-env -qaand other commands that try to
evaluate a set of derivations to get information about those
derivations, a derivation that throws an error is silently skipped
(which is not the case forabort).
https://nixos.org/manual/nix/stable/language/builtins.html#builtins-throw
There was a problem hiding this comment.
Oh damn yeah. Probably the entire reason this is in nix-env at all is because we historically haven't had anything like this PR, which would've prevented packages from not being evaluatable.
Was broken in 9fddd79 but not caught due to NixOS#271123 (comment)
This was not caught when the package was introduced because of NixOS#271123 (comment)
Was broken by feb114f And not caught due to NixOS#271123 (comment)
Was broken since 7dd3469 but not caught due to NixOS#271123 (comment)
Was broken since introduced, but not caught due to NixOS#271123 (comment)
… false Was broken since initialised in 9b2d4d2 but not noticed due to NixOS#271123 (comment)
This very weirdly broke the channel evaluation: https://hydra.nixos.org/build/245871962/nixlog/1 It appears that this attribute is only evaluated by Hydra, _not_ by ofborg. So this wouldn't have been detected by CI anyways in the PR that introduced the problem: #276800. However, due to #271123 (comment), the channel only broke once that was fixed with #278777 Whether the fix is good, I don't know, but the failing-on-darwin attribute doesn't exist anymore with this commit, making the tarball build succeed again: nix-build pkgs/top-level/release.nix -A tarball
This reverts 5629aec, see also NixOS/nixpkgs#271123 (comment)
Was broken since introduced, but not caught due to NixOS#271123 (comment) (cherry picked from commit 6946071)
This reverts 4c75ef3, see also NixOS/nixpkgs#271123 (comment)
Description of changes
context #269356
Purpose is to reduce the size of the PR.
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Priorities
Add a 👍 reaction to pull requests you find important.