option_env does not get updated when rebuilding and value of the key changed. #8306
Labels
A-environment-variables
Area: environment variables
A-rebuild-detection
Area: rebuild detection and fingerprinting
C-bug
Category: bug
Problem
I expected to see this happen:
Recompiling with cargo build / cargo run should update the value received from
option_env
to the current value of the key in the environment. SettingCARGO_INCREMENTAL=0
doesn't seem to affect this. It only causes a recompile the first time around since incremental compilation is turned on by default.Instead, this happened:
The value received from
option_env
only changes when running cargo clean before.Steps
This is a minimum example.
Possible Solution(s)
rust-lang/rust#71858 should provide the necessary information once it is merged.
Why I think I need this:
I'm compiling (and linking to) a rust library from a build script (different target) and want the
option_env
to get updated when I rebuild with a different value set for the key specified in theoption_env
.Notes
Output of
cargo version
:cargo 1.45.0-nightly (9fcb8c1d2 2020-05-25)
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: