Skip to content

Commit f7a03d0

Browse files
committed
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 ```
1 parent 4a43094 commit f7a03d0

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
@@ -1840,19 +1840,21 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
18401840
}
18411841
}
18421842

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

18471855
let mut targetflags = flags;
18481856
targetflags.push(format!("-Lnative={}", builder.test_helpers_out(target).display()));
18491857

1850-
// FIXME: on macOS, we get linker warnings about duplicate `-lm` flags. We should investigate why this happens.
1851-
if suite == "ui-fulldeps" && target.ends_with("darwin") {
1852-
hostflags.push("-Alinker_messages".into());
1853-
targetflags.push("-Alinker_messages".into());
1854-
}
1855-
18561858
for flag in hostflags {
18571859
cmd.arg("--host-rustcflags").arg(flag);
18581860
}

0 commit comments

Comments
 (0)