Open GuillaumeGomez opened 11 months ago
We discussed about how it might impact https://github.com/rust-lang/rfcs/pull/2794 and decided to rename it into --env-set
to prevent potential future issues.
Hi! I see the stabilization PR was closed. What's the state of this then?
My 2cents on a couple points:
$RUSTC_WRAPPER
knows which envs to forward to rustc
. Can't just forward all the envs. --env-set KEY=..
should be an error. It resolves that point and allows forward compatibility If help is needed here I'd like to provide some!
Adds a new
--env-set
command 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-set
will take precedence. For example if you want havePATH=a
in your environment and pass--env-set PATH=env
, then you will have:Steps
Unresolved questions
--env
variable is passed twice?