Skip to content

Commit e5a36c5

Browse files
Auto merge of #140136 - dpaoliello:arm64winci, r=<try>
Add an aarch64-msvc build running on ARM64 Windows Resurrecting #126341 Per <rust-lang/rfcs#3817> we intend to promote `aarch64-pc-windows-msvc` to Tier 1. As part of that work, we are adding a pre-merge CI job to validate that changes do not break this target. Additionally, for consistency, the `dist-aarch64-msvc` job will also be run on Arm64 Windows runners. r? `@Kobzol` try-job: `*aarch64-msvc*`
2 parents 3bc767e + 2953787 commit e5a36c5

File tree

4 files changed

+50
-5
lines changed

4 files changed

+50
-5
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ jobs:
163163
- name: show the current environment
164164
run: src/ci/scripts/dump-environment.sh
165165

166+
- name: install rust
167+
run: src/ci/scripts/install-rust.sh
168+
166169
- name: install awscli
167170
run: src/ci/scripts/install-awscli.sh
168171

src/ci/github-actions/jobs.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ runners:
4646
os: windows-2025-8core-32gb
4747
<<: *base-job
4848

49+
- &job-windows-aarch64
50+
os: windows-11-arm
51+
<<: *base-job
52+
4953
- &job-aarch64-linux
5054
# Free some disk space to avoid running out of space during the build.
5155
free_disk: true
@@ -539,6 +543,19 @@ auto:
539543
SCRIPT: make ci-msvc-ps1
540544
<<: *job-windows
541545

546+
# aarch64-msvc is split into two jobs to run tests in parallel.
547+
- name: aarch64-msvc-1
548+
env:
549+
RUST_CONFIGURE_ARGS: --build=aarch64-pc-windows-msvc
550+
SCRIPT: make ci-msvc-py
551+
<<: *job-windows-aarch64
552+
553+
- name: aarch64-msvc-2
554+
env:
555+
RUST_CONFIGURE_ARGS: --build=aarch64-pc-windows-msvc
556+
SCRIPT: make ci-msvc-ps1
557+
<<: *job-windows-aarch64
558+
542559
# x86_64-msvc-ext is split into multiple jobs to run tests in parallel.
543560
- name: x86_64-msvc-ext1
544561
env:
@@ -634,14 +651,14 @@ auto:
634651
- name: dist-aarch64-msvc
635652
env:
636653
RUST_CONFIGURE_ARGS: >-
637-
--build=x86_64-pc-windows-msvc
654+
--build=aarch64-pc-windows-msvc
638655
--host=aarch64-pc-windows-msvc
639656
--target=aarch64-pc-windows-msvc,arm64ec-pc-windows-msvc
640657
--enable-full-tools
641658
--enable-profiler
642659
SCRIPT: python x.py dist bootstrap --include-default-paths
643660
DIST_REQUIRE_ALL_TOOLS: 1
644-
<<: *job-windows
661+
<<: *job-windows-aarch64
645662

646663
- name: dist-i686-mingw
647664
env:

src/ci/scripts/install-clang.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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-rust.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
# The Arm64 Windows Runner does not have Rust already installed
4+
# https://github.com/actions/partner-runner-images/issues/77
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+
fi

0 commit comments

Comments
 (0)