Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add Runtime-Environment #17

wants to merge 1 commit into from

Conversation

mwoehlke
Copy link
Member

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!

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.

Copy link
Collaborator

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|.
Copy link
Collaborator

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
Copy link
Collaborator

@dcbaker @mwoehlke Just noticed this is a PR that has been hanging around for a while. What's the next step here?

@mwoehlke
Copy link
Member Author

@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.

@bretbrownjr
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants