Skip to content

Commit 2be5ac4

Browse files
committed
DRAFT: Add an aarch64-msvc build running on ARM64 Windows
1 parent 3c877f6 commit 2be5ac4

File tree

11 files changed

+54
-22
lines changed

11 files changed

+54
-22
lines changed

.github/workflows/ci.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ jobs:
134134
- name: show the current environment
135135
run: src/ci/scripts/dump-environment.sh
136136

137+
- name: install rust
138+
run: src/ci/scripts/install-rust.sh
139+
137140
- name: install awscli
138141
run: src/ci/scripts/install-awscli.sh
139142

@@ -212,8 +215,7 @@ jobs:
212215
fi
213216
exit ${STATUS}
214217
env:
215-
AWS_ACCESS_KEY_ID: ${{ env.CACHES_AWS_ACCESS_KEY_ID }}
216-
AWS_SECRET_ACCESS_KEY: ${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}
218+
SCCACHE_S3_NO_CREDENTIALS: 1
217219

218220
- name: create github artifacts
219221
run: src/ci/scripts/create-doc-artifacts.sh

src/ci/github-actions/jobs.yml

+8-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
@@ -100,18 +104,11 @@ envs:
100104
# These jobs automatically inherit envs.pr, to avoid repeating
101105
# it in each job definition.
102106
pr:
103-
- name: mingw-check
104-
<<: *job-linux-4c
105-
- name: mingw-check-tidy
106-
continue_on_error: true
107-
<<: *job-linux-4c
108-
- name: x86_64-gnu-llvm-19
107+
- name: aarch64-msvc
109108
env:
110-
ENABLE_GCC_CODEGEN: "1"
111-
DOCKER_SCRIPT: x86_64-gnu-llvm.sh
112-
<<: *job-linux-16c
113-
- name: x86_64-gnu-tools
114-
<<: *job-linux-16c
109+
RUST_CONFIGURE_ARGS: --build=aarch64-pc-windows-msvc
110+
SCRIPT: make ci-msvc
111+
<<: *job-windows-aarch64
115112

116113
# Jobs that run when you perform a try build (@bors try)
117114
# 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
@@ -54,11 +54,21 @@ elif isWindows && ! isKnownToBeMingwBuild; then
5454
# don't want to run the installer directly; extracting it is more reliable
5555
# in CI environments.
5656

57+
if [[ "${CI_JOB_NAME}" = *aarch64* ]]; then
58+
suffix=woa64
59+
60+
# On Arm64, the Ring crate requires that Clang be on the PATH.
61+
# https://github.com/briansmith/ring/blob/main/BUILDING.md
62+
ciCommandAddPath "$(cygpath -m "$(pwd)/clang-rust/bin")"
63+
else
64+
suffix=win64
65+
fi
66+
5767
mkdir -p citools/clang-rust
5868
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"
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

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
# For mingw builds use a vendored mingw.
3+
4+
set -euo pipefail
5+
IFS=$'\n\t'
6+
7+
source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
8+
9+
if isWindows; then
10+
case "${CI_JOB_NAME}" in
11+
*aarch64*)
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+
esac
17+
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

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")) {

tests/ui/sanitizer/asan_odr_windows.rs

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
//@ compile-flags:-Zsanitizer=address
66
//@ aux-build: asan_odr_win-2.rs
77
//@ only-windows-msvc
8+
//@ needs-sanitizer-support
9+
//@ needs-sanitizer-address
810

911
extern crate othercrate;
1012

0 commit comments

Comments
 (0)