Skip to content

Fix x test --stage 1 ui-fulldeps on macOS (until the next beta bump) #136973

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1840,19 +1840,21 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
}
}

// FIXME(136096): on macOS, we get linker warnings about duplicate `-lm` flags.
// NOTE: `stage > 1` here because `test --stage 1 ui-fulldeps` is a hack that compiles
// with stage 0, but links the tests against stage 1.
// cfg(bootstrap) - remove only the `stage > 1` check, leave everything else.
if suite == "ui-fulldeps" && compiler.stage > 1 && target.ends_with("darwin") {
flags.push("-Alinker_messages".into());
}

let mut hostflags = flags.clone();
hostflags.push(format!("-Lnative={}", builder.test_helpers_out(compiler.host).display()));
hostflags.extend(linker_flags(builder, compiler.host, LldThreads::No));

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

// FIXME: on macOS, we get linker warnings about duplicate `-lm` flags. We should investigate why this happens.
if suite == "ui-fulldeps" && target.ends_with("darwin") {
hostflags.push("-Alinker_messages".into());
targetflags.push("-Alinker_messages".into());
}

for flag in hostflags {
cmd.arg("--host-rustcflags").arg(flag);
}
Expand Down
Loading