Skip to content

Commit dded247

Browse files
committed
Auto merge of #3402 - RalfJung:miri-script, r=RalfJung
miri script: build with stable toolchain `./miri toolchain` sets up a `rustup override miri`. But then if something goes wrong and the `miri` toolchain doesn't work, one can't even run `./miri toolchain` again as building miri-script needs a toolchain... So let's always use stable to build miri-script, making it override-independent. I assume everyone will have that installed.
2 parents 5be6e5c + cd776e2 commit dded247

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ jobs:
3434
steps:
3535
- uses: actions/checkout@v3
3636

37+
- name: Show Rust version (stable toolchain)
38+
run: |
39+
rustup show
40+
rustc -Vv
41+
cargo -V
42+
3743
# Cache the global cargo directory, but NOT the local `target` directory which
3844
# we cannot reuse anyway when the nightly changes (and it grows quite large
3945
# over time).
@@ -57,21 +63,21 @@ jobs:
5763
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
5864
run: cargo install -f rustup-toolchain-install-master
5965

60-
- name: Install "master" toolchain
66+
- name: Install miri toolchain
6167
run: |
6268
if [[ ${{ github.event_name }} == 'schedule' ]]; then
6369
echo "Building against latest rustc git version"
6470
git ls-remote https://github.com/rust-lang/rust/ HEAD | cut -f 1 > rust-version
6571
fi
6672
./miri toolchain --host ${{ matrix.host_target }}
6773
68-
- name: Show Rust version
74+
- name: Show Rust version (miri toolchain)
6975
run: |
7076
rustup show
7177
rustc -Vv
7278
cargo -V
7379
74-
- name: Test
80+
- name: Test Miri
7581
run: ./ci/ci.sh
7682

7783
style:

ci/ci.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,15 @@ function run_tests {
6363
done
6464

6565
# Check that the benchmarks build and run, but without actually benchmarking.
66-
HYPERFINE="bash -c" ./miri bench
66+
if [ "$HOST_TARGET" = i686-pc-windows-msvc ]; then
67+
# Some crazy nonsense is going on on Windows where `bash` tries to launch WSL, `$BASH` gets
68+
# replaced to a path that contains a space which ofc breaks becuase HYPERFINE is supposed to
69+
# be shell-encoded, `'$BASH'` does not get the magic replacement and so it refers to a path
70+
# that does not exist... so end result is we have to hard-code the Github CI path here.
71+
HYPERFINE="'C:/Program Files/Git/usr/bin/bash' -c" ./miri bench
72+
else
73+
HYPERFINE="bash -c" ./miri bench
74+
fi
6775
fi
6876

6977
## test-cargo-miri

miri

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ set -e
33
# Instead of doing just `cargo run --manifest-path .. $@`, we invoke miri-script binary directly. Invoking `cargo run` goes through
44
# rustup (that sets it's own environmental variables), which is undesirable.
55
MIRI_SCRIPT_TARGET_DIR="$(dirname "$0")"/miri-script/target
6-
cargo build $CARGO_EXTRA_FLAGS -q --target-dir "$MIRI_SCRIPT_TARGET_DIR" --manifest-path "$(dirname "$0")"/miri-script/Cargo.toml
6+
cargo +stable build $CARGO_EXTRA_FLAGS -q --target-dir "$MIRI_SCRIPT_TARGET_DIR" --manifest-path "$(dirname "$0")"/miri-script/Cargo.toml
77
"$MIRI_SCRIPT_TARGET_DIR"/debug/miri-script "$@"

miri.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set MIRI_SCRIPT_TARGET_DIR=%0\..\miri-script\target
55

66
:: If any other steps are added, the "|| exit /b" must be appended to early
77
:: return from the script. If not, it will continue execution.
8-
cargo build %CARGO_EXTRA_FLAGS% -q --target-dir %MIRI_SCRIPT_TARGET_DIR% --manifest-path %0\..\miri-script\Cargo.toml || exit /b
8+
cargo +stable build %CARGO_EXTRA_FLAGS% -q --target-dir %MIRI_SCRIPT_TARGET_DIR% --manifest-path %0\..\miri-script\Cargo.toml || exit /b
99

1010
:: Forwards all arguments to this file to the executable.
1111
:: We invoke the binary directly to avoid going through rustup, which would set some extra

0 commit comments

Comments
 (0)