Adds a new --env-set command line option on rustc. It allows to set environment variables value at compile-time to be used by env! and option_env! macros.
When retrieving and environment variable value, the one specified by --env-set will take precedence. For example if you want have PATH=a in your environment and pass --env-set PATH=env, then you will have:
assert_eq!(env!("PATH"), "env");
Steps
Unresolved questions
Adds a new
--env-setcommand line option on rustc. It allows to set environment variables value at compile-time to be used byenv!andoption_env!macros.When retrieving and environment variable value, the one specified by
--env-setwill take precedence. For example if you want havePATH=ain your environment and pass--env-set PATH=env, then you will have:Steps
--envcompiler flag (withouttracked_envsupport) #118368, in Add support for--envontracked_env::var#118830 and in Rename--envoption flag to--env-set#119884--env-setoption #119926Unresolved questions
--envvariable is passed twice?