-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
API for setting default env for run()
invocations
#36440
Comments
What had been proposed in the previous github issue discussing that changing |
In the world of binary dependencies, we have to
From what I have read online, as long as we're (a) using glibc, and (b) loading external libraries (that can start their own threads) it will always be unsafe to touch the environment at all, because if at any point anyone does a Your proposed changes would work for this usecase; we wouldn't even need to change anything; using |
Unclear if that's a "yes" or a "no" on if my proposed approach would work... |
Yes, it will work. That's what I was trying to communicate in my last paragraph. |
@staticfloat Any reason why JLL packages do not provide a This doesn't help the Cairo.jl and Gtk.jl examples, of course. But the point in the OP seems to be specific to |
Two reasons:
In Julia 1.3+, it does! :)
So if a user needs to provide environment variables to this particular invocation of a command, it drops anything that was set previously. :( |
Isn't it better/easier to fix this? For example, maybe we can have (say) |
I think we should fix And as we have already discovered; using |
Hmm... I'm a bit uneasy about the dynamic-scoping nature of |
BTW, another related API is |
JLL packages would benefit greatly from an API to set default environment variables for future
run()
invocations; like a defaultsetenv()
that othersetenv()
invocations eventually get merged into. We don't want to modifyENV
itself, as that is thread-unsafe.Proposed API: Provide a
with_child_env(pairs...)
API just likesetenv
andwithenv
. This will set a dictionary that is merged into byrun()
that causes child processes to be initialized with that environment.The text was updated successfully, but these errors were encountered: