mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-15 12:39:31 +03:00
Compiletest should not inherit all host RUSTFLAGS
I told rhelmot to do this in #134913. But it's not correct; compiletest shouldn't inherit RUSTFLAGS at all. Pass a single new --host-rustcflags to compiletest instead, without overwriting any existing arguments. Fixes the following failure, which only happens when building llvm from source and then running `x test --stage 1 ui-fulldeps`: ``` diff --git a/tests/ui-fulldeps/fluent-messages/test.stderr b/tests/ui-fulldeps/fluent-messages/test.stderr index 0b3bb14ce51..978ac46c5a2 100644 --- a/tests/ui-fulldeps/fluent-messages/test.stderr +++ b/tests/ui-fulldeps/fluent-messages/test.stderr @@ -1,3 +1,8 @@ +warning[E0602]: unknown lint: `linker_messages` + | + = note: requested on the command line with `-A linker_messages` + = note: `#[warn(unknown_lints)]` on by default ```
This commit is contained in:
@@ -1969,13 +1969,12 @@ fn run(self, builder: &Builder<'_>) {
|
||||
if !builder.config.dry_run() && suite.ends_with("fulldeps") {
|
||||
let llvm_libdir =
|
||||
command(&llvm_config).arg("--libdir").run_capture_stdout(builder).stdout();
|
||||
let mut rustflags = env::var("RUSTFLAGS").unwrap_or_default();
|
||||
if target.is_msvc() {
|
||||
rustflags.push_str(&format!("-Clink-arg=-LIBPATH:{llvm_libdir}"));
|
||||
let link_llvm = if target.is_msvc() {
|
||||
format!("-Clink-arg=-LIBPATH:{llvm_libdir}")
|
||||
} else {
|
||||
rustflags.push_str(&format!("-Clink-arg=-L{llvm_libdir}"));
|
||||
}
|
||||
cmd.env("RUSTFLAGS", rustflags);
|
||||
format!("-Clink-arg=-L{llvm_libdir}")
|
||||
};
|
||||
cmd.arg("--host-rustcflags").arg(link_llvm);
|
||||
}
|
||||
|
||||
if !builder.config.dry_run() && matches!(mode, "run-make" | "coverage-run") {
|
||||
|
||||
Reference in New Issue
Block a user