Skip to content

Commit f55034b

Browse files
authored
Rollup merge of rust-lang#139347 - jieyouxu:rust_test_helpers, r=onur-ozkan
Only build `rust_test_helpers` for `{incremental,ui}` test suites Only build `rust_test_helpers` for `{incremental,ui}` test suites. Context: Trying to see what test suites actually need `rust_test_helpers`, because this was causing unnecessary local failures when trying to run `./x test tests/run-make --target=wasm32-unknown-unknown` when `run-make` tests don't need `rust_test_helpers` at all. r? `@ghost` try-job: armhf-gnu try-job: test-various try-job: x86_64-apple-1 try-job: aarch64-apple try-job: x86_64-msvc-1 try-job: i686-msvc-1 try-job: x86_64-mingw-1 try-job: i686-mingw-1
2 parents fededb9 + c25207d commit f55034b

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)