Build scripts don't rerun if [env]
in config.toml
is changed
#14350
Labels
A-build-scripts
Area: build.rs scripts
A-environment-variables
Area: environment variables
A-rebuild-detection
Area: rebuild detection and fingerprinting
C-bug
Category: bug
Problem
Build scripts should automatically re-run if environment variables registered with
cargo::rerun-if-env-changed
directives change. While this feature works well with environment variables inherited by the cargo process, it doesn't work with environment variables provided by the[env]
section of acargo.toml
file.Steps
Here's my
.cargo/config.toml
:...here's my
build.rs
:...and here's a sample shell session:
Possible Solution(s)
No response
Notes
Profile environment variables are not read until
apply_env_config
is ran since that function is the sole caller ofGlobalContext::env_config()
and that's the only method which references theEnvConfig
type. Perhaps only the process environment was processed at a previous step?Version
The text was updated successfully, but these errors were encountered: