Build scripts only get RUSTFLAGS
when not passing --target
#14046
Labels
A-rustflags
Area: rustflags
C-bug
Category: bug
S-needs-info
Status: Needs more info, such as a reproduction or more background for a feature request.
Z-target-applies-to-host
Nightly: target-applies-to-host
Problem
When passing
RUSTFLAGS=-Dwarnings
to upgrade compiler warnings to errors, the flags are sometimes present in therustc
invocation for the build script and sometimes not.Steps
RUSTFLAGS=-Dwarnings cargo check -v
produces an error for the build script.-Dwarnings
is visible on the theRunning
command line for the build script.RUSTFLAGS=-Dwarnings cargo check -v --target x86_64-unknown-linux-gnu
produces a warning for the build script.-Dwarnings
is absent from the command line for the build script and present on the command line for the main build.I expected step 3 to behave like step 2.
Possible Solution(s)
No response
Notes
RUSTFLAGS
withCARGO_ENCODED_RUSTFLAGS
gave the same results.build.target
in.cargo/config.toml
has the same effect as passing--target
.cargo 1.81.0-nightly (b1feb75d0 2024-06-07)
.Version
The text was updated successfully, but these errors were encountered: