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
makeWrapper: add --set-default #31767
Conversation
After NixOS#31497 starter quoting all values, there arouse the need to left some values evaluated. `--set-default var value` expands to `export var=${var-value}`, where value is not evaluated and literally assigned to var unless it is already set. `--set-eval var value` expands to `export var=$(eval echo value)`, where value is evaluated by `eval`.
7d721f8
to
7eb4941
Compare
It is too old and does not support required features. The error is: /nix/store/...-hook/nix-support/setup-hook: line 78: export $varName=${value@Q}\${$varName:+${separator@Q}}\$$varName: bad substitution
I consider this ready for staging: |
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.
I don't see any issues, especially in make-wrapper.sh
, but anyway you seem to be better versed in Bash quoting than me.
FWIW I used --run
to achieve something similar recently.
Good idea! |
because --run is good enough.
Motivation for this change
#31497 (comment)
After #31497 starter quoting all values, there arouse the need to left some values evaluated.
--set-default var value
expands toexport var=${var-value}
, where value is not evaluated and literally assigned to var unless it is already set.--set-eval var value
expands toexport var=$(eval echo value)
, where value is evaluated byeval
.--run 'export var=expr'
should be used instead.Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)