-
-
Notifications
You must be signed in to change notification settings - Fork 18k
makeWrapper: --add-flag and --append-flag arguments #400649
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
Conversation
drupol
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this PR set makeWrapper and makeBinaryWrapper at the same level and get rid of the makeBinaryWrapper limitations ?
bbc4e1a to
242dd24
Compare
|
Not quite. I attempted to fix --add-flags in the other PR (and found a solution) but it wasnt meant to be. But this does help with that! This does make It does this by allowing you to pass single arguments, which are guaranteed to be grouped as single arguments. It doesnt fix all the issues, nor make them interchangeable, and they arent necessarily meant to be, although I do think consistency should be something to think about regardless, but it does fix at least some of the issues! See the other PR for why it isnt just fixing --add-flags to work correctly. I'm still of the opinion that it should be fixed, but the problem space was quite thoroughly explored and the required solution was 100 lines of bash tokenizer unless someone finds a better way, so I understand why others are of the opinion that it should be left as is to avoid breaking changes. |
819c686 to
64783bf
Compare
|
Added documentation updates, and merged in the makeShellWrapper changes into this one as well as per request. |
|
Question: Should the arguments be added before the --add-flags and --append-flags arguments, or after? Because the new ones are more reliably escaped, I put them before, but there could be an argument made for either way. For example, maybe for Interspersed is not the way to go due to not being possible in the makeBinaryWrapper implementation without reworking it extensively (or adopting my previous PR) But a good argument could be made about whether they should be before or after their plural counterparts, and I would appreciate if that argument were to occur before this is merged rather than after! Edit: It should definitely be after, both for the reason I give above, and to avoid any possible breaking changes at all. If we wish to do interspersed, I need to parse the arguments for --add-flags in makeBinaryWrapper like in the other PR. Another option. we allow their implementations to drift further. Intersperse them in the shell wrapper, and add them after in makeBinaryWrapper. Edit2: I suppose the last option would be only adding the extra option to makeBinaryWrapper because makeShellWrapper doesnt really need it? Edit3: chose this option. makeShellWrapper has no need for an --add-flag |
d9089bb to
caaed79
Compare
|
I do still feel that this PR is ok though. Not being able to pass a string with a space at all needs to be solved, and adding a workaround flag like --add-flag seems to be the easiest and most uncontroversial way to do so, and makeShellWrapper has no need for such a flag due to it having an --add-flags that actually works as expected. |
8e634da to
8f3ffdd
Compare
|
The arguments should of course be interspersed. |
8f3ffdd to
b24e6e3
Compare
b24e6e3 to
ea4ba99
Compare
ea4ba99 to
c8f46d4
Compare
c8f46d4 to
de18966
Compare
|
Ok. So, both implementations have the new flag, variables dont expand at runtime in either of them, interspersed with the old --add-flags which works as before. And suggested changes have been implemented :) That is how it should be yes? Trying to get the flags from the new argument to be separate and still expand at runtime in makeShellWrapper proved difficult, so I figured consistent behavior for the flag between both wrappers made more sense. The old ones in makeShellWrapper still expand as normal obviously. If you think the variables should expand at runtime in makeShellWrapper like the --add-flags arguments do, let me know and I can attempt to do that, and if I don't succeed, just remove them makeShellWrapper and submit only the changes to makeBinaryWrapper. But I think Im satisfied with the fact that the new flags currently have the same behavior in both wrappers, and users who want runtime expansion can use --add-flags in makeShellWrapper still. |
No, definitely not. |
ok. Nice. So the current behavior is correct then, it just needs cleanup. I will work on the cleanups you suggest soon! Thank you for taking the time to help me with this by the way! |
2a70171 to
0fd72f9
Compare
0fd72f9 to
7dd189e
Compare
ncfavier
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small whitespace issues, otherwise looks good now
7f7ae5d to
ec75177
Compare
also: manual: differences in makeWrapper implementations better explained Update pkgs/by-name/ma/makeBinaryWrapper/make-binary-wrapper.sh Co-authored-by: Naïm Camille Favier <n@monade.li> Update pkgs/by-name/ma/makeBinaryWrapper/make-binary-wrapper.sh Co-authored-by: Naïm Camille Favier <n@monade.li> Update pkgs/by-name/ma/makeBinaryWrapper/make-binary-wrapper.sh Co-authored-by: Naïm Camille Favier <n@monade.li> Update pkgs/build-support/setup-hooks/make-wrapper.sh Co-authored-by: Naïm Camille Favier <n@monade.li> Update pkgs/build-support/setup-hooks/make-wrapper.sh Co-authored-by: Naïm Camille Favier <n@monade.li> Update pkgs/build-support/setup-hooks/make-wrapper.sh Co-authored-by: Naïm Camille Favier <n@monade.li> Update pkgs/by-name/ma/makeBinaryWrapper/make-binary-wrapper.sh Co-authored-by: Naïm Camille Favier <n@monade.li> Update pkgs/build-support/setup-hooks/make-wrapper.sh Co-authored-by: Naïm Camille Favier <n@monade.li> Update pkgs/by-name/ma/makeBinaryWrapper/make-binary-wrapper.sh Co-authored-by: Naïm Camille Favier <n@monade.li> Update pkgs/build-support/setup-hooks/make-wrapper.sh Co-authored-by: Naïm Camille Favier <n@monade.li>
42fd8da to
7b9c634
Compare
Please see this other PR for context. #397604
This is --add-flag and --append-flag mentioned there.
This is to address a major shortcoming in makeBinaryWrapper
The inability to pass a string with a space in it as a single argument to makeBinaryWrapper's implementation of --add-flags argument.
Adds new wrapper arguments
--add-flagand--append-flagto bothmakeWrapperimplementations with the same behavior for each.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.