Skip to content

Commit ae56827

Browse files
authored
Merge pull request #4479 from RalfJung/ci-win-arm
CI: add windows-arm runner
2 parents 7b6ef64 + 8fcdb6b commit ae56827

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ jobs:
4545
os: macos-latest
4646
- host_target: i686-pc-windows-msvc
4747
os: windows-latest
48+
- host_target: aarch64-pc-windows-msvc
49+
os: windows-11-arm
4850
runs-on: ${{ matrix.os }}
4951
env:
5052
HOST_TARGET: ${{ matrix.host_target }}
@@ -63,6 +65,12 @@ jobs:
6365
sudo apt update
6466
# Install needed packages
6567
sudo apt install $(echo "libatomic1: zlib1g-dev:" | sed 's/:/:${{ matrix.multiarch }}/g')
68+
- name: Install rustup on Windows ARM
69+
if: ${{ matrix.os == 'windows-11-arm' }}
70+
run: |
71+
curl -LOs https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe
72+
./rustup-init.exe -y --no-modify-path
73+
echo "$USERPROFILE/.cargo/bin" >> "$GITHUB_PATH"
6674
- uses: ./.github/workflows/setup
6775
with:
6876
toolchain_flags: "--host ${{ matrix.host_target }}"

cargo-miri/src/phases.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//! Implements the various phases of `cargo miri run/test`.
22
33
use std::env;
4-
use std::fs::{self, File};
4+
use std::fs::File;
55
use std::io::BufReader;
6-
use std::path::{Path, PathBuf};
6+
use std::path::{self, Path, PathBuf};
77
use std::process::Command;
88

99
use rustc_version::VersionMeta;
@@ -222,12 +222,12 @@ pub fn phase_cargo_miri(mut args: impl Iterator<Item = String>) {
222222
// that to be the Miri driver, but acting as rustc, in host mode.
223223
//
224224
// In `main`, we need the value of `RUSTC` to distinguish RUSTC_WRAPPER invocations from rustdoc
225-
// or TARGET_RUNNER invocations, so we canonicalize it here to make it exceedingly unlikely that
225+
// or TARGET_RUNNER invocations, so we make it absolute to make it exceedingly unlikely that
226226
// there would be a collision with other invocations of cargo-miri (as rustdoc or as runner). We
227227
// explicitly do this even if RUSTC_STAGE is set, since for these builds we do *not* want the
228228
// bootstrap `rustc` thing in our way! Instead, we have MIRI_HOST_SYSROOT to use for host
229229
// builds.
230-
cmd.env("RUSTC", fs::canonicalize(find_miri()).unwrap());
230+
cmd.env("RUSTC", path::absolute(find_miri()).unwrap());
231231
// In case we get invoked as RUSTC without the wrapper, let's be a host rustc. This makes no
232232
// sense for cross-interpretation situations, but without the wrapper, this will use the host
233233
// sysroot, so asking it to behave like a target build makes even less sense.

ci/ci.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ case $HOST_TARGET in
142142
# Host
143143
GC_STRESS=1 MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests
144144
# Extra tier 1
145-
MANY_SEEDS=64 TEST_TARGET=i686-unknown-linux-gnu run_tests
146145
MANY_SEEDS=64 TEST_TARGET=x86_64-apple-darwin run_tests
147146
MANY_SEEDS=64 TEST_TARGET=x86_64-pc-windows-gnu run_tests
148147
;;
@@ -161,8 +160,6 @@ case $HOST_TARGET in
161160
aarch64-unknown-linux-gnu)
162161
# Host
163162
GC_STRESS=1 MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests
164-
# Extra tier 1 candidate
165-
MANY_SEEDS=64 TEST_TARGET=aarch64-pc-windows-msvc run_tests
166163
# Extra tier 2
167164
MANY_SEEDS=16 TEST_TARGET=arm-unknown-linux-gnueabi run_tests # 32bit ARM
168165
MANY_SEEDS=16 TEST_TARGET=aarch64-pc-windows-gnullvm run_tests # gnullvm ABI
@@ -189,13 +186,20 @@ case $HOST_TARGET in
189186
;;
190187
i686-pc-windows-msvc)
191188
# Host
192-
# Without GC_STRESS as this is the slowest runner.
189+
# Without GC_STRESS as this is a very slow runner.
193190
MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 run_tests
194191
# Extra tier 1
195192
# We really want to ensure a Linux target works on a Windows host,
196193
# and a 64bit target works on a 32bit host.
197194
TEST_TARGET=x86_64-unknown-linux-gnu run_tests
198195
;;
196+
aarch64-pc-windows-msvc)
197+
# Host
198+
# Without GC_STRESS as this is a very slow runner.
199+
MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests
200+
# Extra tier 1
201+
MANY_SEEDS=64 TEST_TARGET=i686-unknown-linux-gnu run_tests
202+
;;
199203
*)
200204
echo "FATAL: unknown host target: $HOST_TARGET"
201205
exit 1

0 commit comments

Comments
 (0)