Skip to content

Commit c25207d

Browse files
committed
bootstrap: only build rust_test_helpers for {incremental,ui} suites
1 parent 00095b3 commit c25207d

File tree

1 file changed

+9
-10
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+9
-10
lines changed

Diff for: src/bootstrap/src/core/build_steps/test.rs

+9-10
Original file line numberDiff line numberDiff line change
@@ -1624,21 +1624,13 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
16241624
builder.tool_exe(Tool::RunMakeSupport);
16251625
}
16261626

1627-
// Also provide `rust_test_helpers` for the host.
1628-
builder.ensure(TestHelpers { target: compiler.host });
1629-
16301627
// ensure that `libproc_macro` is available on the host.
16311628
if suite == "mir-opt" {
16321629
builder.ensure(compile::Std::new(compiler, compiler.host).is_for_mir_opt_tests(true));
16331630
} else {
16341631
builder.ensure(compile::Std::new(compiler, compiler.host));
16351632
}
16361633

1637-
// As well as the target
1638-
if suite != "mir-opt" {
1639-
builder.ensure(TestHelpers { target });
1640-
}
1641-
16421634
let mut cmd = builder.tool_cmd(Tool::Compiletest);
16431635

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

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

18101801
let mut targetflags = flags;
1811-
targetflags.push(format!("-Lnative={}", builder.test_helpers_out(target).display()));
1802+
1803+
// Provide `rust_test_helpers` for both host and target.
1804+
if suite == "ui" || suite == "incremental" {
1805+
builder.ensure(TestHelpers { target: compiler.host });
1806+
builder.ensure(TestHelpers { target });
1807+
hostflags
1808+
.push(format!("-Lnative={}", builder.test_helpers_out(compiler.host).display()));
1809+
targetflags.push(format!("-Lnative={}", builder.test_helpers_out(target).display()));
1810+
}
18121811

18131812
for flag in hostflags {
18141813
cmd.arg("--host-rustcflags").arg(flag);

0 commit comments

Comments
 (0)