-
Notifications
You must be signed in to change notification settings - Fork 946
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
[question] How to add runtime-only environment variables #9529
Comments
The new environment management implements this:
It is pending to properly document this, it is experimental, and we wanted to test it internally first. |
@memsharded Awesome thanks! Is |
Yes, it is the new one, very different approach. $ conan config list
Supported Conan *experimental* conan.conf properties:
core:required_conan_version: Will raise if the current Conan version does not match the defined version range.
...
tools.env.virtualenv:auto_use: Automatically activate virtualenvs when changing into a directory The description is not very good, it will be improved, but it means that it will generate VirtualBuildEnv and VirtualRunEnv if there are enviroment items by default. At the moment it is opt-in to make sure it is not breaking, but it will be enabled by default in Conan 2.0. |
Got it. Thanks @memsharded ! |
@memsharded Some follow up questions and feedback:
I am getting this error when running conan commands:
Am I missing something or is this a bug?
In my case I am using |
Hi, @daravi Question 1: That [conf] section works fine for me. Could you please paste the full Question 2: The default environment is VirtualBuildEnv. If you want to use VirtualRunEnv, you have to do it explicitly. Anyhow, the recommendation is setting the Question 3: What do you mean? Usually virtualenvs do show that prompt Question 4: Yep, that should be another ticket :-) |
@daravi Did you solve this issue? I am experiencing the same error with a different setting. I created a
Running any Conan command only prints:
|
@daravi I think we have both misinterpreted the docs at https://docs.conan.io/en/latest/reference/config_files/global_conf.html#tools-configurations. The example that is given there refers to profiles but not |
Yes, the example there refers to The |
Closing the issue as the main question has been answered. @daravi feel free to reopen it if necessary. |
Hi is it possible to append only to the run environment? Adding to
env_info
results in the environment variable being added to the virtual environment. But I only need the variable at run time so I need it in the virtual run environment.In my
environment.sh.env
file I see some variables that are required only for runtime and not in compile time. But I don't see a way for the Conan recipe authors to append toenvironment_run.sh.env
instead ofenvironment.sh.env
. My understanding is that former is for runtime and latter is for build time.The text was updated successfully, but these errors were encountered: