Currently, you can specify a list of passthrough environment variables in meta.yaml (build/script_env). However, there are use-cases when it is not feasible to list all possible env variables. One example of such a useful environment variable is MAKEFLAGS and it is even made into the conda-build core. Imagine you don't need to make extra PRs just to pass through a new build-system specific variable.
Please, consider the following syntax (copied from docker run command):
$ conda build --env "MAKEFLAGS=--jobs 4" --env "CPPFLAGS=-Wall -Werror" ./conda.recipe/
This way we won't worry about implicitly and unexpectedly passed settings from a host system. Also, there would be no need to list all sorts of possibly useful only for build systems env variables in recipes.
P.S. It might be also a good idea to implement a config file for conda-build where these environment variables and other useful settings can be saved and reused.
/cc @jschueller @groutr @msarahan @jakirkham
Yep, great idea. The limiting factor here has been time. See #966 for progress. This is one step behind #953 on my priority list, but I hope to get to it very soon.
Yep, those both sound like great ideas, @frol. I'd much prefer we even specify MAKEFLAGS this way instead of having it setup for auto-passthrough.
@jakirkham That was also a part of the intention behind it. Currently, somebody can potentially hit some nasty issues if they use something fancy in their MAKEFLAGS.
In that case you may want to revert these: https://github.com/conda/conda-build/pull/917 https://github.com/conda/conda-docs/pull/270
cc @jakirkham
cc @ocefpaf
Most helpful comment
In that case you may want to revert these: https://github.com/conda/conda-build/pull/917 https://github.com/conda/conda-docs/pull/270
cc @jakirkham