conan-io / docs

conan.io reStructuredText documentation
http://docs.conan.io
MIT License
106 stars 356 forks source link

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

Open bartoszkosiorek opened 6 months ago

bartoszkosiorek commented 6 months ago

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.

memsharded commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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