Skip to content

Only build rust_test_helpers for {incremental,ui} test suites #139347

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
Apr 6, 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
19 changes: 9 additions & 10 deletions src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1624,21 +1624,13 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
builder.tool_exe(Tool::RunMakeSupport);
}

// Also provide `rust_test_helpers` for the host.
builder.ensure(TestHelpers { target: compiler.host });

// ensure that `libproc_macro` is available on the host.
if suite == "mir-opt" {
builder.ensure(compile::Std::new(compiler, compiler.host).is_for_mir_opt_tests(true));
} else {
builder.ensure(compile::Std::new(compiler, compiler.host));
}

// As well as the target
if suite != "mir-opt" {
builder.ensure(TestHelpers { target });
}

let mut cmd = builder.tool_cmd(Tool::Compiletest);

if suite == "mir-opt" {
Expand Down Expand Up @@ -1804,11 +1796,18 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
}

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, compiler.stage));

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

// Provide `rust_test_helpers` for both host and target.
if suite == "ui" || suite == "incremental" {
builder.ensure(TestHelpers { target: compiler.host });
builder.ensure(TestHelpers { target });
hostflags
.push(format!("-Lnative={}", builder.test_helpers_out(compiler.host).display()));
targetflags.push(format!("-Lnative={}", builder.test_helpers_out(target).display()));
}

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