run some std tests on more targets

This commit is contained in:
Ralf Jung 2024-04-06 22:46:45 +02:00
parent a986c0a100
commit 24089812db
2 changed files with 28 additions and 11 deletions

View File

@ -63,7 +63,7 @@ check-aux:
library/core \
library/alloc \
--doc
# In `std` we cannot test everything, so we test the most target-dependent modules.
# In `std` we cannot test everything.
$(Q)MIRIFLAGS="-Zmiri-disable-isolation" BOOTSTRAP_SKIP_TARGET_SANITY=1 \
$(BOOTSTRAP) miri --stage 2 library/std \
--no-doc -- \
@ -72,6 +72,12 @@ check-aux:
$(BOOTSTRAP) miri --stage 2 library/std \
--doc -- \
--skip fs:: --skip net:: --skip process:: --skip sys::pal::
# Also test some very target-specific modules on other targets.
$(Q)MIRIFLAGS="-Zmiri-disable-isolation" BOOTSTRAP_SKIP_TARGET_SANITY=1 \
$(BOOTSTRAP) miri --stage 2 library/std \
--target aarch64-apple-darwin,i686-pc-windows-gnu \
--no-doc -- \
time:: sync:: thread:: env::
dist:
$(Q)$(BOOTSTRAP) dist $(BOOTSTRAP_ARGS)
distcheck:

View File

@ -2689,16 +2689,27 @@ impl Step for Crate {
match mode {
Mode::Std => {
compile::std_cargo(builder, target, compiler.stage, &mut cargo);
// `std_cargo` actually does the wrong thing: it passes `--sysroot build/host/stage2`,
// but we want to use the force-recompile std we just built in `build/host/stage2-test-sysroot`.
// Override it.
if builder.download_rustc() && compiler.stage > 0 {
let sysroot = builder
.out
.join(compiler.host.triple)
.join(format!("stage{}-test-sysroot", compiler.stage));
cargo.env("RUSTC_SYSROOT", sysroot);
if builder.kind == Kind::Miri {
// We can't use `std_cargo` as that uses `optimized-compiler-builtins` which
// needs host tools for the given target. This is similar to what `compile::Std`
// does when `is_for_mir_opt_tests` is true. There's probably a chance for
// de-duplication here... `std_cargo` should support a mode that avoids needing
// host tools.
cargo
.arg("--manifest-path")
.arg(builder.src.join("library/sysroot/Cargo.toml"));
} else {
compile::std_cargo(builder, target, compiler.stage, &mut cargo);
// `std_cargo` actually does the wrong thing: it passes `--sysroot build/host/stage2`,
// but we want to use the force-recompile std we just built in `build/host/stage2-test-sysroot`.
// Override it.
if builder.download_rustc() && compiler.stage > 0 {
let sysroot = builder
.out
.join(compiler.host.triple)
.join(format!("stage{}-test-sysroot", compiler.stage));
cargo.env("RUSTC_SYSROOT", sysroot);
}
}
}
Mode::Rustc => {