Skip to content

Commit 2408981

Browse files
committed
run some std tests on more targets
1 parent a986c0a commit 2408981

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
@@ -2689,16 +2689,27 @@ impl Step for Crate {
26892689

26902690
match mode {
26912691
Mode::Std => {
2692-
compile::std_cargo(builder, target, compiler.stage, &mut cargo);
2693-
// `std_cargo` actually does the wrong thing: it passes `--sysroot build/host/stage2`,
2694-
// but we want to use the force-recompile std we just built in `build/host/stage2-test-sysroot`.
2695-
// Override it.
2696-
if builder.download_rustc() && compiler.stage > 0 {
2697-
let sysroot = builder
2698-
.out
2699-
.join(compiler.host.triple)
2700-
.join(format!("stage{}-test-sysroot", compiler.stage));
2701-
cargo.env("RUSTC_SYSROOT", sysroot);
2692+
if builder.kind == Kind::Miri {
2693+
// We can't use `std_cargo` as that uses `optimized-compiler-builtins` which
2694+
// needs host tools for the given target. This is similar to what `compile::Std`
2695+
// does when `is_for_mir_opt_tests` is true. There's probably a chance for
2696+
// de-duplication here... `std_cargo` should support a mode that avoids needing
2697+
// host tools.
2698+
cargo
2699+
.arg("--manifest-path")
2700+
.arg(builder.src.join("library/sysroot/Cargo.toml"));
2701+
} else {
2702+
compile::std_cargo(builder, target, compiler.stage, &mut cargo);
2703+
// `std_cargo` actually does the wrong thing: it passes `--sysroot build/host/stage2`,
2704+
// but we want to use the force-recompile std we just built in `build/host/stage2-test-sysroot`.
2705+
// Override it.
2706+
if builder.download_rustc() && compiler.stage > 0 {
2707+
let sysroot = builder
2708+
.out
2709+
.join(compiler.host.triple)
2710+
.join(format!("stage{}-test-sysroot", compiler.stage));
2711+
cargo.env("RUSTC_SYSROOT", sysroot);
2712+
}
27022713
}
27032714
}
27042715
Mode::Rustc => {

0 commit comments

Comments
 (0)