lib.derivations: avoid common double-warn with warnOnInstantiate#414606
lib.derivations: avoid common double-warn with warnOnInstantiate#414606hsjobeki merged 1 commit intoNixOS:masterfrom
Conversation
Before:
$ nix-build . -A opensycl
trace: evaluation warning: 'opensycl' has been renamed to 'adaptivecpp'
trace: evaluation warning: 'opensycl' has been renamed to 'adaptivecpp'
/nix/store/8g0lfv82s0sprmqgfj146ggkb7bn3rm6-adaptivecpp-25.02.0
$ nix-instantiate . -A opensycl
trace: evaluation warning: 'opensycl' has been renamed to 'adaptivecpp'
trace: evaluation warning: 'opensycl' has been renamed to 'adaptivecpp'
warning: you did not specify '--add-root'; the result might be removed by the garbage collector
/nix/store/b8q5xp94s4n7zfn7as5a9xjvylh6y3pi-adaptivecpp-25.02.0.drv
After:
$ nix-build . -A opensycl
trace: evaluation warning: 'opensycl' has been renamed to 'adaptivecpp'
/nix/store/8g0lfv82s0sprmqgfj146ggkb7bn3rm6-adaptivecpp-25.02.0
$ nix-instantiate . -A opensycl
trace: evaluation warning: 'opensycl' has been renamed to 'adaptivecpp'
warning: you did not specify '--add-root'; the result might be removed by the garbage collector
/nix/store/b8q5xp94s4n7zfn7as5a9xjvylh6y3pi-adaptivecpp-25.02.0.drv
|
I also want to exclude |
There was a problem hiding this comment.
Approving, neat fix.
I think this needs a little more explaining why the double warning happens in the first place.
In order to understand how the fix works:
nix-build / nix-instantiate commands require both drvPath and outputName
drvPath ->evaluation warning: 'opensycl' has been renamed to 'adaptivecpp'
outputName -> evaluation warning: 'opensycl' has been renamed to 'adaptivecpp'
Excluding outputName from the warning is fine i think.
And all other attributes still contain the warning.
Skimming through the nix manual i didn't find any commands that would only interact with ignored attributes (i.e. outputName) Which would lead to non-warning behavior. So i think this good to go.
Before:
After:
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/)Add a 👍 reaction to pull requests you find important.