-
-
Notifications
You must be signed in to change notification settings - Fork 607
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
Fix up our environment handling options now that we have multiple languages #14809
Comments
The environment variables that you need to fetch things off the network or to compile things might be significantly different. I'm not sure whether that suggests "per-language" isolation so much as "per task" isolation (compiling a C extension vs downloading vs running tests). But maybe it's both. |
I think figuring this out should probably block making the new languages (Go, Java, Scala) stable. |
I like the idea of per language and task I think there are only a few env vars that could be applicable to multiple sections, and as such are worth repeating in those cases. |
I don't love having a proliferation of subsystems, so I'd encourage we bundle all the language options together. These are totally straw-person, but maybe something like this?
Not sure if the |
Agree with avoiding new subsystems. I imagined there'd be existing subsystem that could house Also, come to think of it, download is perhaps the only task that is disjoint from any particular language. So my vote is perhaps on per language env vars, and for downloads. (shying away from the sheer number of |
The issue here is, for better-or-worse, we don't have "plugin options" like we have "plugin fields". So a generic |
? I'm not sure I see the issue with having the various lang env-vars options registered in the corresponding subsystems. Like for |
A generic With the Target API, this is why we have "plugin fields". We only add |
What I was thinking wasn't a global |
Our options for setting environment variables is confusing.
[subprocess-environment]
, which claims to be for all processes, but really is only used for Python.[python-native-code]
shouldn't exist as a distinct subsystem:[python-native-code]
breaks Pantsd cache invalidation #14612[shell-setup]
don't have an option to add env varsWe do have a consistent mechanism for setting env vars for tests via
[test].env_vars
, at least.I propose that we move to each language backend (
[python]
,[golang]
,[shell-setup]
) having its own--env-vars
option. Rather than a single subsystem for every single process. Why? Env vars mess up caching—especially remote caching i.e. sharing across machines—so we want things to be as granular as possible. Go might need to set env vars that Python doesn't care about. (Related, this allows us to better ban setting certain env vars like PEX_EXTRA_SYS_PATH that only one language cares about.)Having to duplicate certain env vars like
HTTPS_PROXY
across multiple options is unfortunate, but probably worth it? A middle-ground is to have both language-specific options & also a global option, but to heavily encourage the language-specific onees?The text was updated successfully, but these errors were encountered: