-
Notifications
You must be signed in to change notification settings - Fork 2.9k
build.rs should ignore RUSTFLAGS #6375
Copy link
Copy link
Open
Labels
A-build-scriptsArea: build.rs scriptsArea: build.rs scriptsA-configurationArea: cargo config files and env varsArea: cargo config files and env varsA-environment-variablesArea: environment variablesArea: environment variablesA-rustflagsArea: rustflagsArea: rustflagsS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Metadata
Metadata
Assignees
Labels
A-build-scriptsArea: build.rs scriptsArea: build.rs scriptsA-configurationArea: cargo config files and env varsArea: cargo config files and env varsA-environment-variablesArea: environment variablesArea: environment variablesA-rustflagsArea: rustflagsArea: rustflagsS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Problem
build.rs is compiled with RUSTFLAGS if target is not specified.
The problem here is that if a user compiles for a newer CPU than they have, build script can potentially use newer instructions and fail with SIGILL.
Steps
1.cargo new test-build
2.cd test-build
3.touch build.rs
4.cargo build -vv
Possible Solution(s)
I don't have a solution, but it seems like env_args() is the problem.
Notes
Output of
cargo version:cargo 1.30.0 (a1a4ad3 2018-11-02)