-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
Replace overridePythonAttrs with overrideArgs, add for Rust and Go as well #46842
Conversation
This allows, eg, patches that require extraSrcs to be applied to Go packages. It's similar to `overridePythonAttrs`, and to the `overrideRustAttrs` function I propose in NixOS#46842.
This allows, eg, patches that require extraSrcs to be applied to Go packages. It's similar to `overridePythonAttrs`, and to the `overrideRustAttrs` function I propose in NixOS#46842.
Maybe we should normalize this name to something like overrideArgs or something... This kind of thing could become common across different packages. |
I think that would be a good idea, especially since I've already needed |
This will allow consistency between override functions for various language-specific build functions.
This allows, eg, specifying a custom src to use a different version of a package, like overrideAttrs does for normal packages, or overrideArgs for Python packages.
1444826
to
e7214ec
Compare
I’ve renamed |
This allows, eg, patches that require extraSrcs to be applied to Go packages. It's similar to `overrideArgs` in `buildPythonPackage` and `buildRustPackage`.
e7214ec
to
5900b6a
Compare
I am against renaming the functions in this PR. |
Going through an RFC makes sense I suppose |
@matthewbauer would you be willing to co-author an RFC? |
@alyssais what you are interested in, The |
The `buildPython*` function calls `stdenv.mkDerivation` with a modified set of arguments that were passed to itself. In the case of Python packages there is no valid reason for using `overrideAttrs` anymore. Seeing that, and assuming it's the same for other `build*Package` functions, we could say these `build*Package` functions should simply use `overrideAttrs` for overriding the call to them.
Interesting. Indeed, I'm having trouble thinking of a situation in which I'd want to call overrideAttrs on a Python/Go/Rust package -- if the build*Package function is sufficiently customisable, it should be possible to change everything I could possibly want to change through that. My one concern with such an approach is that it could be surprising to have overrideAttrs do different things depending on how mkDerivation was ultimately invoked, but I think it could be argued that the current situation, where using overrideAttrs will just break things and there's no supported way to eg add patches at all is even more surprising.
|
In the case of I agree with you that it could be confusing if a |
Why stop at python, go and rust. I want this in Haskell too and everything else. |
#82772 maps |
RFC proposal https://github.com/NixOS/rfcs/compare/master...FRidh:overrideattrs?expand=1 |
@FRidh would it be hard to actually define full builder hierarchy for this RFC? Of top of my head, there are:
there are many more, but at least it would good to know that Maybe this hierarchy can be crowdsourced as part of RFC |
@danbst I've opened a PR now, please post on NixOS/rfcs#67 |
I marked this as stale due to inactivity. → More info |
This should be closed, right? Since it uh pretty stale |
Motivation for this change
This allows, eg, specifying a custom
src
to use a different version of a package, likeoverrideAttrs
does for normal packages, oroverridePythonAttrs
for Python packages.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)