about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-02-27 05:55:22 +0000
committerbors <bors@rust-lang.org>2024-02-27 05:55:22 +0000
commit7b7f8619a5ce9534d83d5594e0e93382e49b01c8 (patch)
tree043df36960f5d18275e6f29f2d4d7d3fcb826228
parentc414c08da3265390965ccc1f51d8da4f6b3375cb (diff)
parent28c10d6f2235e0d3eef8c86df14edbddb86aff52 (diff)
Auto merge of #3329 - RossSmyth:miri-bat-error, r=RalfJung
Fix miri.bat not bailing early on error

There is a logical error in the batch script that I did not think about. Currently, if the build step for miri-script fails, it will continue on and attempt to execute the next line. This will either lead to a file not found error, or running an old miri-script.

With this, it will bail upon erroring in the build step.
-rw-r--r--src/tools/miri/miri.bat5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tools/miri/miri.bat b/src/tools/miri/miri.bat
index 91e8a6e8f3b..959e54d8844 100644
--- a/src/tools/miri/miri.bat
+++ b/src/tools/miri/miri.bat
@@ -2,7 +2,10 @@
 :: Windows will not execute the bash script, and select this.
 @echo off
 set MIRI_SCRIPT_TARGET_DIR=%0\..\miri-script\target
-cargo build %CARGO_EXTRA_FLAGS% -q --target-dir %MIRI_SCRIPT_TARGET_DIR% --manifest-path %0\..\miri-script\Cargo.toml
+
+:: If any other steps are added, the "|| exit /b" must be appended to early
+:: return from the script. If not, it will continue execution.
+cargo build %CARGO_EXTRA_FLAGS% -q --target-dir %MIRI_SCRIPT_TARGET_DIR% --manifest-path %0\..\miri-script\Cargo.toml || exit /b
 
 :: Forwards all arguments to this file to the executable.
 :: We invoke the binary directly to avoid going through rustup, which would set some extra