Skip to content

Commit 6eb3929

Browse files
Rollup merge of rust-lang#136973 - jyn514:fulldeps-stage1, r=jieyouxu
Fix `x test --stage 1 ui-fulldeps` on macOS (until the next beta bump) "stage 1" for fulldeps means "compile with stage 0, link against stage 1". But this code wanted to switch on the compiler that's building, not the compiler that's being tested. Fix the check. Previously, it would fail with a warning about linker-messages: ``` --- stderr ------------------------------- warning[E0602]: unknown lint: `linker_messages` | = note: requested on the command line with `-A linker_messages` = note: `#[warn(unknown_lints)]` on by default ``` cc https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/unknown.20lint.3A.20.60linker_messages.60.20when.20blessing.20tests.20on.20.2E.2E.2E, rust-lang#136960
2 parents 0e56579 + f7a03d0 commit 6eb3929

File tree

1 file changed

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

1 file changed

+8
-6
lines changed

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

+8-6
Original file line numberDiff line numberDiff line change
@@ -1846,19 +1846,21 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
18461846
}
18471847
}
18481848

1849+
// FIXME(136096): on macOS, we get linker warnings about duplicate `-lm` flags.
1850+
// NOTE: `stage > 1` here because `test --stage 1 ui-fulldeps` is a hack that compiles
1851+
// with stage 0, but links the tests against stage 1.
1852+
// cfg(bootstrap) - remove only the `stage > 1` check, leave everything else.
1853+
if suite == "ui-fulldeps" && compiler.stage > 1 && target.ends_with("darwin") {
1854+
flags.push("-Alinker_messages".into());
1855+
}
1856+
18491857
let mut hostflags = flags.clone();
18501858
hostflags.push(format!("-Lnative={}", builder.test_helpers_out(compiler.host).display()));
18511859
hostflags.extend(linker_flags(builder, compiler.host, LldThreads::No));
18521860

18531861
let mut targetflags = flags;
18541862
targetflags.push(format!("-Lnative={}", builder.test_helpers_out(target).display()));
18551863

1856-
// FIXME: on macOS, we get linker warnings about duplicate `-lm` flags. We should investigate why this happens.
1857-
if suite == "ui-fulldeps" && target.ends_with("darwin") {
1858-
hostflags.push("-Alinker_messages".into());
1859-
targetflags.push("-Alinker_messages".into());
1860-
}
1861-
18621864
for flag in hostflags {
18631865
cmd.arg("--host-rustcflags").arg(flag);
18641866
}

0 commit comments

Comments
 (0)