-
Notifications
You must be signed in to change notification settings - Fork 981
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
PoC of simplified environment management #8426
Conversation
@solvingj I'd like to know your feedback about this, and also if you know powershell, would you mind contributing it too? |
I'd love to participate. I know powershell pretty well. Can we write up a description of "the big idea" here? What are the goals, how is it different from previous environment management, what are biggest challenges, what do we still need to do? |
Ok, based on updated description, Ihere's what I would imagine some future replace this: with tools.environment_append(dict):
mt = MakeToolchain()
mt.generate() With something like this (I could imagine multiple different syntax choices here): et = EnvToolchain(self, name="buildvars")
et.variables["somevar"] = "someval"
et.generate() # -> buildvars.env, activate_buildvars/deactivate_buildvars (.bat, sh, ps1, py)
mt = MakeToolchain()
mt.with_env_file("buildvars")
mt.generate() |
Thought about this more. From the perspective of a naïve recipe author who wants/needs full control of "the build of the current recipe" because they need to do non-standard things with the environment variables to make some non-standard recipe work, the a completely explicit approach seems like a nice and safe and powerful strategy. From the perspective of a caller who is building many packages, and wants to set the Indeed, it seems that there must still be some implicit generation of an environment file with a default name, and the other toolchains should implicitly load it. The |
@klimkin, it seems you know very well about bash and environment, if you could give quick feedback here, would be great :). What is the effect of not providing such |
Extra spaces in command lines or extra ":" in path variables are harmless for shell, but can have some undesired side effects.
For fundamental tools like Conan, I think it would be nice to keep this clean. By clean I mean to not have extra space/colon where it's not required. |
Yes, I agree it is a nice goal, I am trying to estimate the value vs complexity ratio. Specially because in other platforms, like .bat batch scripts in Windows this is not possible in this way (such expansion doesn't exist), and it would be required to have very complicated code just to avoid this extra space or path separator. |
Yes, I agree. And there also shell flavors like csh still around that don't understand bash notation. I agree, if simple form works (and it does), that would be ok. |
Superseded by #8534, please track progress in that other PR. |
Changelog: Feature: New environment management, with correct value capturing and restoring on deactivate
Docs: Omit
New approach to environment (env-vars) management:
env_info
, superseding the previous one (might be a parallel syntax).generate()
should create files, or recipes activate what they want more explicitly.TODO: