Skip to content

Environment variable RUSTFLAGS not set inside build.rs script since Rust 1.55.0 #91132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Tirka opened this issue Nov 22, 2021 · 3 comments
Closed
Labels
C-bug Category: This is a bug. regression-from-stable-to-stable Performance or correctness regression from one stable version to another.

Comments

@Tirka
Copy link

Tirka commented Nov 22, 2021

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

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.

@Tirka Tirka added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels Nov 22, 2021
@rustbot rustbot added I-prioritize Issue: Indicates that prioritization has been requested for this issue. regression-from-stable-to-stable Performance or correctness regression from one stable version to another. and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. regression-untriaged Untriaged performance or correctness regression. labels Nov 22, 2021
@jyn514
Copy link
Member

jyn514 commented Nov 22, 2021

@ehuss could you transfer this to rust-lang/cargo?

@Tirka
Copy link
Author

Tirka commented Nov 22, 2021

@ehuss could you transfer this to rust-lang/cargo?

Sure

@Tirka Tirka changed the title Environment variable RUSTFLAGS not set inside build.rs srcipt since Rust 1.55.0 Environment variable RUSTFLAGS not set inside build.rs script since Rust 1.55.0 Nov 22, 2021
@Tirka
Copy link
Author

Tirka commented Nov 22, 2021

Transferred to rust-lang/cargo#10111

@Tirka Tirka closed this as completed Nov 22, 2021
@jyn514 jyn514 removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. regression-from-stable-to-stable Performance or correctness regression from one stable version to another.
Projects
None yet
Development

No branches or pull requests

3 participants