Skip to content

Commit 6a2f538

Browse files
committed
DRAFT: Add an aarch64-msvc build running on ARM64 Windows
1 parent 3350c1e commit 6a2f538

File tree

14 files changed

+81
-22
lines changed

14 files changed

+81
-22
lines changed

.github/workflows/ci.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ jobs:
145145
- name: show the current environment
146146
run: src/ci/scripts/dump-environment.sh
147147

148+
- name: install rust
149+
run: src/ci/scripts/install-rust.sh
150+
148151
- name: install awscli
149152
run: src/ci/scripts/install-awscli.sh
150153

@@ -225,8 +228,7 @@ jobs:
225228
fi
226229
exit ${STATUS}
227230
env:
228-
AWS_ACCESS_KEY_ID: ${{ env.CACHES_AWS_ACCESS_KEY_ID }}
229-
AWS_SECRET_ACCESS_KEY: ${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}
231+
SCCACHE_S3_NO_CREDENTIALS: 1
230232

231233
- name: create github artifacts
232234
run: src/ci/scripts/create-doc-artifacts.sh

library/std/src/fs/tests.rs

+16
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,10 @@ fn recursive_mkdir_empty() {
714714
}
715715

716716
#[test]
717+
#[cfg_attr(
718+
all(windows, target_arch = "aarch64"),
719+
ignore = "SymLinks not enabled on Arm64 Windows runners https://github.com/actions/partner-runner-images/issues/94"
720+
)]
717721
fn recursive_rmdir() {
718722
let tmpdir = tmpdir();
719723
let d1 = tmpdir.join("d1");
@@ -733,6 +737,10 @@ fn recursive_rmdir() {
733737
}
734738

735739
#[test]
740+
#[cfg_attr(
741+
all(windows, target_arch = "aarch64"),
742+
ignore = "SymLinks not enabled on Arm64 Windows runners https://github.com/actions/partner-runner-images/issues/94"
743+
)]
736744
fn recursive_rmdir_of_symlink() {
737745
// test we do not recursively delete a symlink but only dirs.
738746
let tmpdir = tmpdir();
@@ -1517,6 +1525,10 @@ fn file_open_not_found() {
15171525
}
15181526

15191527
#[test]
1528+
#[cfg_attr(
1529+
all(windows, target_arch = "aarch64"),
1530+
ignore = "SymLinks not enabled on Arm64 Windows runners https://github.com/actions/partner-runner-images/issues/94"
1531+
)]
15201532
fn create_dir_all_with_junctions() {
15211533
let tmpdir = tmpdir();
15221534
let target = tmpdir.join("target");
@@ -1995,6 +2007,10 @@ fn test_rename_symlink() {
19952007

19962008
#[test]
19972009
#[cfg(windows)]
2010+
#[cfg_attr(
2011+
all(windows, target_arch = "aarch64"),
2012+
ignore = "SymLinks not enabled on Arm64 Windows runners https://github.com/actions/partner-runner-images/issues/94"
2013+
)]
19982014
fn test_rename_junction() {
19992015
let tmpdir = tmpdir();
20002016
let original = tmpdir.join("original");

src/ci/github-actions/jobs.yml

+15-11
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ runners:
4747
os: windows-2025-8core-32gb
4848
<<: *base-job
4949

50+
- &job-windows-aarch64
51+
os: windows-11-arm
52+
<<: *base-job
53+
5054
- &job-aarch64-linux
5155
# Free some disk space to avoid running out of space during the build.
5256
free_disk: true
@@ -115,18 +119,18 @@ envs:
115119
# These jobs automatically inherit envs.pr, to avoid repeating
116120
# it in each job definition.
117121
pr:
118-
- name: mingw-check
119-
<<: *job-linux-4c
120-
- name: mingw-check-tidy
121-
continue_on_error: true
122-
<<: *job-linux-4c
123-
- name: x86_64-gnu-llvm-19
122+
# aarch64-msvc is split into two jobs to run tests in parallel.
123+
- name: aarch64-msvc-1
124124
env:
125-
ENABLE_GCC_CODEGEN: "1"
126-
DOCKER_SCRIPT: x86_64-gnu-llvm.sh
127-
<<: *job-linux-16c
128-
- name: x86_64-gnu-tools
129-
<<: *job-linux-16c
125+
RUST_CONFIGURE_ARGS: --build=aarch64-pc-windows-msvc
126+
SCRIPT: make ci-msvc-py
127+
<<: *job-windows-aarch64
128+
129+
- name: aarch64-msvc-2
130+
env:
131+
RUST_CONFIGURE_ARGS: --build=aarch64-pc-windows-msvc
132+
SCRIPT: make ci-msvc-ps1
133+
<<: *job-windows-aarch64
130134

131135
# Jobs that run when you perform a try build (@bors try)
132136
# These jobs automatically inherit envs.try, to avoid repeating

src/ci/scripts/install-clang.sh

+14-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
1111

1212
# Update both macOS's and Windows's tarballs when bumping the version here.
1313
# Try to keep this in sync with src/ci/docker/host-x86_64/dist-x86_64-linux/build-clang.sh
14-
LLVM_VERSION="18.1.4"
14+
LLVM_VERSION="20.1.3"
1515

1616
if isMacOS; then
1717
# FIXME: This is the latest pre-built version of LLVM that's available for
@@ -56,9 +56,19 @@ elif isWindows && ! isKnownToBeMingwBuild; then
5656

5757
mkdir -p citools/clang-rust
5858
cd citools
59-
retry curl -f "${MIRRORS_BASE}/LLVM-${LLVM_VERSION}-win64.exe" \
60-
-o "LLVM-${LLVM_VERSION}-win64.exe"
61-
7z x -oclang-rust/ "LLVM-${LLVM_VERSION}-win64.exe"
59+
60+
if [[ "${CI_JOB_NAME}" = *aarch64* ]]; then
61+
suffix=woa64
62+
63+
# On Arm64, the Ring crate requires that Clang be on the PATH.
64+
# https://github.com/briansmith/ring/blob/main/BUILDING.md
65+
ciCommandAddPath "$(cygpath -m "$(pwd)/clang-rust/bin")"
66+
else
67+
suffix=win64
68+
fi
69+
retry curl -f "${MIRRORS_BASE}/LLVM-${LLVM_VERSION}-${suffix}.exe" \
70+
-o "LLVM-${LLVM_VERSION}-${suffix}.exe"
71+
7z x -oclang-rust/ "LLVM-${LLVM_VERSION}-${suffix}.exe"
6272
ciCommandSetEnv RUST_CONFIGURE_ARGS \
6373
"${RUST_CONFIGURE_ARGS} --set llvm.clang-cl=$(pwd)/clang-rust/bin/clang-cl.exe"
6474

src/ci/scripts/install-mingw.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ if isWindows && isKnownToBeMingwBuild; then
4242

4343
curl -o mingw.7z "${MIRRORS_BASE}/${mingw_archive}"
4444
7z x -y mingw.7z > /dev/null
45-
ciCommandAddPath "$(pwd)/${mingw_dir}/bin"
45+
ciCommandAddPath "$(cygpath -m "$(pwd)/${mingw_dir}/bin")"
4646
fi

src/ci/scripts/install-ninja.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if isWindows; then
1212
7z x -oninja ninja.zip
1313
rm ninja.zip
1414
ciCommandSetEnv "RUST_CONFIGURE_ARGS" "${RUST_CONFIGURE_ARGS} --enable-ninja"
15-
ciCommandAddPath "$(pwd)/ninja"
15+
ciCommandAddPath "$(cygpath -m "$(pwd)/ninja")"
1616
elif isMacOS; then
1717
brew install ninja
1818
fi

src/ci/scripts/install-rust.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
# The Arm64 Windows Runner does not have Rust already installed
4+
# https://github.com/actions/partner-runner-images/issues/93
5+
6+
set -euo pipefail
7+
IFS=$'\n\t'
8+
9+
source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
10+
11+
if [[ "${CI_JOB_NAME}" = *aarch64* ]] && isWindows; then
12+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
13+
sh -s -- -y -q --default-host aarch64-pc-windows-msvc
14+
ciCommandAddPath "${USERPROFILE}/.cargo/bin"
15+
;;
16+
fi

src/ci/scripts/install-sccache.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ elif isWindows; then
1515
mkdir -p sccache
1616
curl -fo sccache/sccache.exe \
1717
"${MIRRORS_BASE}/2025-02-24-sccache-v0.10.0-x86_64-pc-windows-msvc.exe"
18-
ciCommandAddPath "$(pwd)/sccache"
18+
ciCommandAddPath "$(cygpath -m "$(pwd)/sccache")"
1919
fi
2020

2121
# FIXME: we should probably install sccache outside the containers and then

src/doc/nomicon

src/tools/compiletest/src/directive-list.rs

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
3535
"ignore-32bit",
3636
"ignore-64bit",
3737
"ignore-aarch64",
38+
"ignore-aarch64-pc-windows-msvc",
3839
"ignore-aarch64-unknown-linux-gnu",
3940
"ignore-aix",
4041
"ignore-android",

tests/debuginfo/step-into-match.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
//@ compile-flags: -g
22
//@ ignore-android: FIXME(#10381)
33

4+
// On Arm64 Windows, stepping at the end of a funciton on goes to the callsite, not the instruction
5+
// after it.
6+
//@ ignore-aarch64-pc-windows-msvc: Stepping out of functions behaves differently.
7+
48
// === GDB TESTS ==============================================================
59

610
// gdb-command: r

tests/debuginfo/type-names.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//@ ignore-lldb
22

3+
//@ ignore-aarch64-pc-windows-msvc: Arm64 Windows cdb doesn't support JavaScript extensions.
4+
35
// GDB changed the way that it formatted Foreign types
46
//@ min-gdb-version: 9.2
57

tests/ui/runtime/backtrace-debuginfo.rs

+4
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,13 @@ macro_rules! dump_and_die {
4242
// there, even on i686-pc-windows-msvc. We do the best we can in
4343
// rust-lang/rust to test it as well, but sometimes we just gotta keep
4444
// landing PRs.
45+
//
46+
// aarch64-msvc is broken as its backtraces are truncated.
47+
// See https://github.com/rust-lang/rust/issues/140489
4548
if cfg!(any(target_os = "android",
4649
all(target_os = "linux", target_arch = "arm"),
4750
all(target_env = "msvc", target_arch = "x86"),
51+
all(target_env = "msvc", target_arch = "aarch64"),
4852
target_os = "freebsd",
4953
target_os = "dragonfly",
5054
target_os = "openbsd")) {

0 commit comments

Comments
 (0)