buildGoModule: warn for passthru.overrideModAttrs lost after overriding#434546
Conversation
90fe612 to
3d08960
Compare
a542f6e to
b323044
Compare
|
|
Can you share a test case where I can see this error where I wouldn't have previously? Something I can test in |
Sandro demonstrated a reproducer by overriding with We could compare the the error handling after #225051 (attribute missing error), #339042 (falling back to the initial value silently), and this PR (falling back to the inintial value with a warning message) with the following commands: # After PR #225051 "buildGoModule: Fix overriding with overlay-style stdenv"
nix eval --impure --expr "((
builtins.getFlake ''github:NixOS/nixpkgs/0d920a91a29ec8668ecbf967b485136000ad5d94''
).outputs.legacyPackages.\${builtins.currentSystem}.pet.overrideAttrs {
passthru = { };
}).outPath"
# After PR #339042 "buildGoModule: be nicer when overrideAttrs clears passthru"
nix eval --impure --expr "((
builtins.getFlake ''github:NixOS/nixpkgs/0e21bc6af9b313944aaca5f6e8ccbbf4a9c978f7''
).outputs.legacyPackages.\${builtins.currentSystem}.pet.overrideAttrs {
passthru = { };
}).outPath"
# After this change
nix eval --impure --expr "((
builtins.getFlake ''github:NixOS/nixpkgs/refs/pull/434546/head''
).outputs.legacyPackages.\${builtins.currentSystem}.pet.overrideAttrs {
passthru = { };
}).outPath" |
b323044 to
8c54246
Compare
|
Warning message updated to include position information. |
Assuming this is actually |
|
Hmm, I decided to make this passthru non-overridable in #457308 (by setting it on the right of |
Nope.
|
This PR adds a warning to the workaround introduced in PR #339042, to remind users their dropping
passthruattributes would result in the loss ofbuildGoModule's overriddenoverrideGoModule(added in PR #225051).Errors shouldn't pass silently, and there will be more packages storing overriding information in
passthruas more frameworks transit from custom overriders to<pkg>.overrideAttrs. Let's enforce this with a warning.Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.