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

[bug][docs] Missing information about removal of -e, -e:b and -e:h and what to use instead #3654

Open
bartoszkosiorek opened this issue Mar 21, 2024 · 3 comments
Assignees

Comments

@bartoszkosiorek
Copy link

bartoszkosiorek commented Mar 21, 2024

With Conan 2 the -e, -e:b and -e:h parameters was removed:

There is missing information in documentation about it (e.g. in migration guide: https://docs.conan.io/1/migrating_to_2.0/general.html#environment-variables) and how to replace it.

@bartoszkosiorek bartoszkosiorek changed the title Missing information about removal of -e, and what to use instead [bug][docs] Missing information about removal of -e, and what to use instead Mar 21, 2024
@bartoszkosiorek bartoszkosiorek changed the title [bug][docs] Missing information about removal of -e, and what to use instead [bug][docs] Missing information about removal of -e, -e:b and -e:h and what to use instead Mar 21, 2024
@memsharded memsharded self-assigned this Mar 21, 2024
@memsharded
Copy link
Member

Hi @bartoszkosiorek-tomtom

Thanks for reporting this.

There are no plans to allow command line global environment variables, but to rely on system ones, like:

$ MYVAR=1 conan install ...
# or
$ set MYVAR=1 && conan install ...

In general, it would be discouraged to rely on env-vars for Conan related control (the recommended way to pass information to Conan is the new conf system, with command line -c and profile [conf], and global.conf). For tools env-vars, the [buildenv] would be recommended in profiles.

@bartoszkosiorek
Copy link
Author

bartoszkosiorek commented Mar 21, 2024

Thanks @memsharded for instant response.

The conf system, is nice replacement for -e. Unfortanately conf is missing possibility of setting only for specific package:

Specific package environment variables (-e zlib:SOME_VAR="SOME_VALUE"). These variables will be defined only in the specified packages (e.g., zlib).

https://docs.conan.io/1/reference/commands/consumer/install.html#env-variables

@memsharded
Copy link
Member

memsharded commented Mar 21, 2024

Unfortanately conf is missing possibility of setting only for specific package:

Not really. The conf syntax also supports definition per package, both in CLI and in profiles with patterns and package references like: -c mypkg/*:<conf>=<conf_value>

More info in https://docs.conan.io/2/reference/config_files/global_conf.html#configuration-patterns

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

No branches or pull requests

2 participants