Skip to content

Commit bde2091

Browse files
Rollup merge of #136960 - jyn514:compiletest-args, r=jieyouxu
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 ``` See https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/.E2.9C.94.20unknown.20lint.3A.20.60linker_messages.60.20when.20blessing.20tests.20on.20.2E.2E.2E for more context.
2 parents d82ec95 + 66ebee4 commit bde2091

File tree

1 file changed

+5
-6
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+5
-6
lines changed

src/bootstrap/src/core/build_steps/test.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -1969,13 +1969,12 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
19691969
if !builder.config.dry_run() && suite.ends_with("fulldeps") {
19701970
let llvm_libdir =
19711971
command(&llvm_config).arg("--libdir").run_capture_stdout(builder).stdout();
1972-
let mut rustflags = env::var("RUSTFLAGS").unwrap_or_default();
1973-
if target.is_msvc() {
1974-
rustflags.push_str(&format!("-Clink-arg=-LIBPATH:{llvm_libdir}"));
1972+
let link_llvm = if target.is_msvc() {
1973+
format!("-Clink-arg=-LIBPATH:{llvm_libdir}")
19751974
} else {
1976-
rustflags.push_str(&format!("-Clink-arg=-L{llvm_libdir}"));
1977-
}
1978-
cmd.env("RUSTFLAGS", rustflags);
1975+
format!("-Clink-arg=-L{llvm_libdir}")
1976+
};
1977+
cmd.arg("--host-rustcflags").arg(link_llvm);
19791978
}
19801979

19811980
if !builder.config.dry_run() && matches!(mode, "run-make" | "coverage-run") {

0 commit comments

Comments
 (0)