make ./miri run a bit more silent; add option to control seeds tested by many-seeds
This commit is contained in:
parent
af92b04855
commit
ad9784eb3d
@ -99,12 +99,10 @@ pub fn setup(subcommand: &MiriCommand, target: &str, rustc_version: &VersionMeta
|
|||||||
// `config.toml`.
|
// `config.toml`.
|
||||||
command.env("RUSTC_WRAPPER", "");
|
command.env("RUSTC_WRAPPER", "");
|
||||||
|
|
||||||
if only_setup {
|
if only_setup && !print_sysroot {
|
||||||
if print_sysroot {
|
// Forward output.
|
||||||
// Be extra sure there is no noise on stdout.
|
|
||||||
command.stdout(process::Stdio::null());
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
|
// Supress output.
|
||||||
command.stdout(process::Stdio::null());
|
command.stdout(process::Stdio::null());
|
||||||
command.stderr(process::Stdio::null());
|
command.stderr(process::Stdio::null());
|
||||||
}
|
}
|
||||||
@ -120,7 +118,9 @@ pub fn setup(subcommand: &MiriCommand, target: &str, rustc_version: &VersionMeta
|
|||||||
std::env::set_var("MIRI_SYSROOT", &sysroot_dir);
|
std::env::set_var("MIRI_SYSROOT", &sysroot_dir);
|
||||||
|
|
||||||
// Do the build.
|
// Do the build.
|
||||||
if only_setup {
|
if print_sysroot {
|
||||||
|
// Be silent.
|
||||||
|
} else if only_setup {
|
||||||
// We want to be explicit.
|
// We want to be explicit.
|
||||||
eprintln!("Preparing a sysroot for Miri (target: {target})...");
|
eprintln!("Preparing a sysroot for Miri (target: {target})...");
|
||||||
} else {
|
} else {
|
||||||
@ -143,7 +143,9 @@ pub fn setup(subcommand: &MiriCommand, target: &str, rustc_version: &VersionMeta
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if only_setup {
|
if print_sysroot {
|
||||||
|
// Be silent.
|
||||||
|
} else if only_setup {
|
||||||
eprintln!("A sysroot for Miri is now available in `{}`.", sysroot_dir.display());
|
eprintln!("A sysroot for Miri is now available in `{}`.", sysroot_dir.display());
|
||||||
} else {
|
} else {
|
||||||
eprintln!("done");
|
eprintln!("done");
|
||||||
|
@ -36,7 +36,8 @@ Mainly meant to be invoked by rust-analyzer.
|
|||||||
./miri many-seeds <command>:
|
./miri many-seeds <command>:
|
||||||
Runs <command> over and over again with different seeds for Miri. The MIRIFLAGS
|
Runs <command> over and over again with different seeds for Miri. The MIRIFLAGS
|
||||||
variable is set to its original value appended with ` -Zmiri-seed=$SEED` for
|
variable is set to its original value appended with ` -Zmiri-seed=$SEED` for
|
||||||
many different seeds.
|
many different seeds. The MIRI_SEEDS variable controls how many seeds are being
|
||||||
|
tried; MIRI_SEED_START controls the first seed to try.
|
||||||
|
|
||||||
./miri bench <benches>:
|
./miri bench <benches>:
|
||||||
Runs the benchmarks from bench-cargo-miri in hyperfine. hyperfine needs to be installed.
|
Runs the benchmarks from bench-cargo-miri in hyperfine. hyperfine needs to be installed.
|
||||||
@ -174,7 +175,9 @@ rustc-push)
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
many-seeds)
|
many-seeds)
|
||||||
for SEED in $(seq 0 255); do
|
MIRI_SEED_START=${MIRI_SEED_START:-0} # default to 0
|
||||||
|
MIRI_SEEDS=${MIRI_SEEDS:-256} # default to 256
|
||||||
|
for SEED in $(seq $MIRI_SEED_START $(( $MIRI_SEED_START + $MIRI_SEEDS - 1 )) ); do
|
||||||
echo "Trying seed: $SEED"
|
echo "Trying seed: $SEED"
|
||||||
MIRIFLAGS="$MIRIFLAGS -Zlayout-seed=$SEED -Zmiri-seed=$SEED" $@ || { echo "Failing seed: $SEED"; break; }
|
MIRIFLAGS="$MIRIFLAGS -Zlayout-seed=$SEED -Zmiri-seed=$SEED" $@ || { echo "Failing seed: $SEED"; break; }
|
||||||
done
|
done
|
||||||
@ -249,6 +252,8 @@ export RUSTFLAGS="-C link-args=-Wl,-rpath,$LIBDIR $RUSTFLAGS"
|
|||||||
# Build a sysroot and set MIRI_SYSROOT to use it. Arguments are passed to `cargo miri setup`.
|
# Build a sysroot and set MIRI_SYSROOT to use it. Arguments are passed to `cargo miri setup`.
|
||||||
build_sysroot() {
|
build_sysroot() {
|
||||||
if ! MIRI_SYSROOT="$($CARGO run $CARGO_EXTRA_FLAGS --manifest-path "$MIRIDIR"/cargo-miri/Cargo.toml -- miri setup --print-sysroot "$@")"; then
|
if ! MIRI_SYSROOT="$($CARGO run $CARGO_EXTRA_FLAGS --manifest-path "$MIRIDIR"/cargo-miri/Cargo.toml -- miri setup --print-sysroot "$@")"; then
|
||||||
|
# Run it again so the user can see the error.
|
||||||
|
$CARGO run $CARGO_EXTRA_FLAGS --manifest-path "$MIRIDIR"/cargo-miri/Cargo.toml -- miri setup "$@"
|
||||||
echo "'cargo miri setup' failed"
|
echo "'cargo miri setup' failed"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user