-
-
Notifications
You must be signed in to change notification settings - Fork 14k
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
srcOnly: make the -source
suffix optional
#333900
base: master
Are you sure you want to change the base?
Conversation
-source
suffix in srcOnly
-source
suffix in srcOnly
I don't quite get the use case, what advantage does it have to change the suffix to something else? Aesthetics? |
One use case is having a derivation of form |
b10b128
to
3eb7bac
Compare
-source
suffix in srcOnly
-source
suffix optional
Okay but what do you do with the source code afterwards. Do you not put pass it on to a different derivation to perform some other build? |
Sometimes I don't. I can't remember any exact details but I think I had a case when I just needed to patch something without copying everything in the installPhase manually. |
This is an oddly shaped derivation helper prior to this PR.
I'm on mobile reviewing this, so I haven't searched through nixpkgs, but I'm really struggling to see the use case for which this helper was created. |
Yeah, I found it weird as well, although it does solve my issues. As I see it, it tries to do two different things:
The first one is the reason of the drvAttrs magic, not running install hooks (the original hooks are not fit for the new installPhase) and dropping most attrs. Should I do a heavier refactoring? |
I don't know 🤷🏻♂️. All I know is that this helper is too weird for me to review changes to, and after reading it, I'll avoid using it in nixpkgs. |
Description of changes
srcOnly
has a use as a trivial builder - cases when you just want to apply a patch to some derivation for example. However, it does not give the user full control of its name, since it adds a-source
to whatever name the user provides. This PR addresses that by adding anoSuffix
argument tosrcOnly
. The argument is only read when provided directly and notdrvAttrs
(should that be changed? Let me know).Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-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.