Skip to content

Commit 9f142d3

Browse files
committed
Auto merge of #3402 - RalfJung:miri-script, r=
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 + 916ff6e commit 9f142d3

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

.github/workflows/ci.yml

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

37+
# We're running into strange trouble with Rust 1.76 on Windows,
38+
# let's try to get the latest version.
39+
- name: Get latest stable Rust
40+
if: ${{ matrix.os == 'windows-latest' }}
41+
run: rustup update
42+
- name: Show Rust version (stable toolchain)
43+
run: |
44+
rustup show
45+
rustc -Vv
46+
cargo -V
47+
3748
# Cache the global cargo directory, but NOT the local `target` directory which
3849
# we cannot reuse anyway when the nightly changes (and it grows quite large
3950
# over time).
@@ -57,21 +68,21 @@ jobs:
5768
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
5869
run: cargo install -f rustup-toolchain-install-master
5970

60-
- name: Install "master" toolchain
71+
- name: Install miri toolchain
6172
run: |
6273
if [[ ${{ github.event_name }} == 'schedule' ]]; then
6374
echo "Building against latest rustc git version"
6475
git ls-remote https://github.com/rust-lang/rust/ HEAD | cut -f 1 > rust-version
6576
fi
6677
./miri toolchain --host ${{ matrix.host_target }}
6778
68-
- name: Show Rust version
79+
- name: Show Rust version (miri toolchain)
6980
run: |
7081
rustup show
7182
rustc -Vv
7283
cargo -V
7384
74-
- name: Test
85+
- name: Test Miri
7586
run: ./ci/ci.sh
7687

7788
style:

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)