-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add Runtime-Environment #17
base: master
Are you sure you want to change the base?
Conversation
Add an attribute specifying environment variables to set when executing a binary that uses a component. This is useful as components that do not live in system default search paths may need to supplement PATH, LD_LIBRARY_PATH or similar in order to be found at execution time.
|
||
The specified `Values`_ replace | ||
the environment variable's existing value(s), if any. | ||
|
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.
Looking at Meson's environment variable handling, this all looks pretty similar to what we do. I've been convinced that is a sane mechanism.
One thing that I'd like to see is the ability to completely unset an environment variable, since some tools treat an empty environment variable and an unset one differently. I see two ways that could be achieved, replace
could be nullable, so that replace: null
means "clear this from the environment", or there could be a :bool:'clear'
attribute.
Otherwise (|true| or :string:`keep-first`) | ||
only the left-most value is retained. | ||
|
||
The default is |false|. |
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.
Most tools I'm familiar with keep the last definition of something, not the first. Python's argparse works this way, bash and zsh do this with env (so do Python, Rust, and C/C++) vars (export FOO="1" FOO="2"; echo $FOO
will print 2
), so I would expect true == 'keep-last'
, rather than keep-first
? But maybe it makes sense to just have this be a union of strings none | keep-first | keep-last
with a default of none
, since that's simpler and less likely to be misinterpreted?
@bretbrownjr, mostly it's looking for buy-in; is this something we want in the spec, especially as it's likely not 1.0 MVP? Or should we leave it on hold? If we want to work on it, I can rebase it and dig into Dylan's comments. Last I'd heard, however, there seemed to be some agreement to back-burner it. |
It makes sense as a feature. I personally would consider it not essential to an initial release, but I'm happy to be educated otherwise. |
Add an attribute specifying environment variables to set when executing a binary that uses a component. This is useful as components that do not live in system default search paths may need to supplement
PATH
,LD_LIBRARY_PATH
or similar in order to be found at execution time.COMMENTS REQUESTED
This is being submitted as a pull request rather than simply merged in order to solicit community feedback to the proposed change. If you have suggestions or concerns regarding this proposed change, please leave a comment!