Skip to content

Commit 344ea00

Browse files
committed
Auto merge of #3406 - RalfJung:many-seeds, r=RalfJung
many-seeds: propagate failure properly This may help explain #3405.
2 parents c8649a5 + 5759160 commit 344ea00

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

ci/ci.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ function run_tests {
5858
MIRIFLAGS="${MIRIFLAGS:-} -O -Zmir-opt-level=4 -Cdebug-assertions=yes" MIRI_SKIP_UI_CHECKS=1 ./miri test -- tests/{pass,panic}
5959

6060
# Also run some many-seeds tests. 64 seeds means this takes around a minute per test.
61+
# (Need to invoke via explicit `bash -c` for Windows.)
6162
for FILE in tests/many-seeds/*.rs; do
62-
MIRI_SEEDS=64 ./miri many-seeds ./miri run "$FILE"
63+
MIRI_SEEDS=64 ./miri many-seeds "$BASH" -c "./miri run '$FILE'"
6364
done
6465

6566
# Check that the benchmarks build and run, but without actually benchmarking.

miri-script/src/commands.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ impl Command {
178178
.context("Please install rustup-toolchain-install-master by running 'cargo install rustup-toolchain-install-master'")?;
179179
let sh = Shell::new()?;
180180
sh.change_dir(miri_dir()?);
181-
let new_commit = Some(sh.read_file("rust-version")?.trim().to_owned());
181+
let new_commit = sh.read_file("rust-version")?.trim().to_owned();
182182
let current_commit = {
183183
let rustc_info = cmd!(sh, "rustc +miri --version -v").read();
184184
if rustc_info.is_err() {
@@ -193,7 +193,7 @@ impl Command {
193193
}
194194
};
195195
// Check if we already are at that commit.
196-
if current_commit == new_commit {
196+
if current_commit.as_ref() == Some(&new_commit) {
197197
if active_toolchain()? != "miri" {
198198
cmd!(sh, "rustup override set miri").run()?;
199199
}
@@ -202,7 +202,7 @@ impl Command {
202202
// Install and setup new toolchain.
203203
cmd!(sh, "rustup toolchain uninstall miri").run()?;
204204

205-
cmd!(sh, "rustup-toolchain-install-master -n miri -c cargo -c rust-src -c rustc-dev -c llvm-tools -c rustfmt -c clippy {flags...} -- {new_commit...}").run()?;
205+
cmd!(sh, "rustup-toolchain-install-master -n miri -c cargo -c rust-src -c rustc-dev -c llvm-tools -c rustfmt -c clippy {flags...} -- {new_commit}").run()?;
206206
cmd!(sh, "rustup override set miri").run()?;
207207
// Cleanup.
208208
cmd!(sh, "cargo clean").run()?;
@@ -380,9 +380,9 @@ impl Command {
380380
.env("MIRIFLAGS", miriflags)
381381
.quiet()
382382
.run();
383-
if status.is_err() {
383+
if let Err(err) = status {
384384
println!("Failing seed: {seed}");
385-
break;
385+
return Err(err.into());
386386
}
387387
}
388388
Ok(())

0 commit comments

Comments
 (0)