Problem
Environment variable RUSTFLAGS not set inside build.rs script since Rust 1.55.0
Steps
Install Rust Stable 1.54 and 1.55
rustup install 1.54.0
rustup install 1.55.0
Clone Minimal Reproducible Example
git clone https://github.com/Tirka/rustflags-buildrs.git
cd ./rustflags-buildrs
Build with Cargo and Rust Stable 1.54.0
RUSTFLAGS="-C target-cpu=skylake" FOO="bar" cargo +1.54.0 build -vv
Output:
[rustflags-buildrs 0.1.0] RUSTFLAGS=Some("-C target-cpu=skylake")
[rustflags-buildrs 0.1.0] FOO=Some("bar")
Cargo clean
Build with Cargo and Rust Stable 1.55.0
RUSTFLAGS="-C target-cpu=skylake" FOO="bar" cargo +1.55.0 build -vv
Output:
[rustflags-buildrs 0.1.0] RUSTFLAGS=None
[rustflags-buildrs 0.1.0] FOO=Some("bar")
It looks like RUSTFLAGS environment variable is not available within build.rs script since 1.55.0 and I can't find any info related to this new behavior in the changelog.
Possible Solution(s)
No response
Notes
No response
Version
No response
Problem
Environment variable RUSTFLAGS not set inside build.rs script since Rust 1.55.0
Steps
Install Rust Stable 1.54 and 1.55
Clone Minimal Reproducible Example
Build with Cargo and Rust Stable 1.54.0
Output:
Cargo clean
Build with Cargo and Rust Stable 1.55.0
Output:
It looks like
RUSTFLAGSenvironment variable is not available withinbuild.rsscript since1.55.0and I can't find any info related to this new behavior in the changelog.Possible Solution(s)
No response
Notes
No response
Version
No response