Skip to content

Commit 6eaa1f2

Browse files
committed
run some std tests on more targets
1 parent 70b560d commit 6eaa1f2

File tree

2 files changed

+28
-11
lines changed

2 files changed

+28
-11
lines changed

src/bootstrap/mk/Makefile.in

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ check-aux:
6363
library/core \
6464
library/alloc \
6565
--doc
66-
# In `std` we cannot test everything, so we test the most target-dependent modules.
66+
# In `std` we cannot test everything.
6767
$(Q)MIRIFLAGS="-Zmiri-disable-isolation" BOOTSTRAP_SKIP_TARGET_SANITY=1 \
6868
$(BOOTSTRAP) miri --stage 2 library/std \
6969
--no-doc -- \
@@ -72,6 +72,12 @@ check-aux:
7272
$(BOOTSTRAP) miri --stage 2 library/std \
7373
--doc -- \
7474
--skip fs:: --skip net:: --skip process:: --skip sys::pal::
75+
# Also test some very target-specific modules on other targets.
76+
$(Q)MIRIFLAGS="-Zmiri-disable-isolation" BOOTSTRAP_SKIP_TARGET_SANITY=1 \
77+
$(BOOTSTRAP) miri --stage 2 library/std \
78+
--target aarch64-apple-darwin,i686-pc-windows-gnu \
79+
--no-doc -- \
80+
time:: sync:: thread:: env::
7581
dist:
7682
$(Q)$(BOOTSTRAP) dist $(BOOTSTRAP_ARGS)
7783
distcheck:

src/bootstrap/src/core/build_steps/test.rs

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2658,16 +2658,27 @@ impl Step for Crate {
26582658

26592659
match mode {
26602660
Mode::Std => {
2661-
compile::std_cargo(builder, target, compiler.stage, &mut cargo);
2662-
// `std_cargo` actually does the wrong thing: it passes `--sysroot build/host/stage2`,
2663-
// but we want to use the force-recompile std we just built in `build/host/stage2-test-sysroot`.
2664-
// Override it.
2665-
if builder.download_rustc() && compiler.stage > 0 {
2666-
let sysroot = builder
2667-
.out
2668-
.join(compiler.host.triple)
2669-
.join(format!("stage{}-test-sysroot", compiler.stage));
2670-
cargo.env("RUSTC_SYSROOT", sysroot);
2661+
if builder.kind == Kind::Miri {
2662+
// We can't use `std_cargo` as that uses `optimized-compiler-builtins` which
2663+
// needs host tools for the given target. This is similar to what `compile::Std`
2664+
// does when `is_for_mir_opt_tests` is true. There's probably a chance for
2665+
// de-duplication here... `std_cargo` should support a mode that avoids needing
2666+
// host tools.
2667+
cargo
2668+
.arg("--manifest-path")
2669+
.arg(builder.src.join("library/sysroot/Cargo.toml"));
2670+
} else {
2671+
compile::std_cargo(builder, target, compiler.stage, &mut cargo);
2672+
// `std_cargo` actually does the wrong thing: it passes `--sysroot build/host/stage2`,
2673+
// but we want to use the force-recompile std we just built in `build/host/stage2-test-sysroot`.
2674+
// Override it.
2675+
if builder.download_rustc() && compiler.stage > 0 {
2676+
let sysroot = builder
2677+
.out
2678+
.join(compiler.host.triple)
2679+
.join(format!("stage{}-test-sysroot", compiler.stage));
2680+
cargo.env("RUSTC_SYSROOT", sysroot);
2681+
}
26712682
}
26722683
}
26732684
Mode::Rustc => {

0 commit comments

Comments
 (0)