Skip to content

Commit c886c51

Browse files
committed
Auto merge of #140136 - dpaoliello:arm64winci, r=<try>
DRAFT: Add an aarch64-msvc build running on ARM64 Windows Resurrecting #126341 r? `@Kobzol` try-job: `*aarch64-msvc*`
2 parents 27d6200 + 0d8065d commit c886c51

File tree

14 files changed

+88
-11
lines changed

14 files changed

+88
-11
lines changed

.github/workflows/ci.yml

+3
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

compiler/rustc_target/src/spec/targets/aarch64_pc_windows_msvc.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
use crate::spec::{Target, TargetMetadata, base};
1+
use crate::spec::{LinkerFlavor, Lld, Target, TargetMetadata, base};
22

33
pub(crate) fn target() -> Target {
44
let mut base = base::windows_msvc::opts();
55
base.max_atomic_width = Some(128);
66
base.features = "+v8a,+neon,+fp-armv8".into();
77

8+
// MSVC emits a warning about code that may trip "Cortex-A53 MPCore processor bug #843419" which
9+
// is sometimes emitted by LLVM. Since Arm64 Windows 10+ isn't supported on that processor, it's
10+
// safe to disable the warning.
11+
base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No), &["/arm64hazardfree"]);
12+
813
Target {
914
llvm_target: "aarch64-pc-windows-msvc".into(),
1015
metadata: TargetMetadata {

library/std/src/fs/tests.rs

+16
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,10 @@ fn recursive_mkdir_empty() {
730730
}
731731

732732
#[test]
733+
#[cfg_attr(
734+
all(windows, target_arch = "aarch64"),
735+
ignore = "SymLinks not enabled on Arm64 Windows runners https://github.com/actions/partner-runner-images/issues/94"
736+
)]
733737
fn recursive_rmdir() {
734738
let tmpdir = tmpdir();
735739
let d1 = tmpdir.join("d1");
@@ -749,6 +753,10 @@ fn recursive_rmdir() {
749753
}
750754

751755
#[test]
756+
#[cfg_attr(
757+
all(windows, target_arch = "aarch64"),
758+
ignore = "SymLinks not enabled on Arm64 Windows runners https://github.com/actions/partner-runner-images/issues/94"
759+
)]
752760
fn recursive_rmdir_of_symlink() {
753761
// test we do not recursively delete a symlink but only dirs.
754762
let tmpdir = tmpdir();
@@ -1533,6 +1541,10 @@ fn file_open_not_found() {
15331541
}
15341542

15351543
#[test]
1544+
#[cfg_attr(
1545+
all(windows, target_arch = "aarch64"),
1546+
ignore = "SymLinks not enabled on Arm64 Windows runners https://github.com/actions/partner-runner-images/issues/94"
1547+
)]
15361548
fn create_dir_all_with_junctions() {
15371549
let tmpdir = tmpdir();
15381550
let target = tmpdir.join("target");
@@ -2011,6 +2023,10 @@ fn test_rename_symlink() {
20112023

20122024
#[test]
20132025
#[cfg(windows)]
2026+
#[cfg_attr(
2027+
all(windows, target_arch = "aarch64"),
2028+
ignore = "SymLinks not enabled on Arm64 Windows runners https://github.com/actions/partner-runner-images/issues/94"
2029+
)]
20142030
fn test_rename_junction() {
20152031
let tmpdir = tmpdir();
20162032
let original = tmpdir.join("original");

src/ci/github-actions/jobs.yml

+19-2
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
@@ -497,6 +501,19 @@ auto:
497501
SCRIPT: make ci-msvc-ps1
498502
<<: *job-windows
499503

504+
# aarch64-msvc is split into two jobs to run tests in parallel.
505+
- name: aarch64-msvc-1
506+
env:
507+
RUST_CONFIGURE_ARGS: --build=aarch64-pc-windows-msvc
508+
SCRIPT: make ci-msvc-py
509+
<<: *job-windows-aarch64
510+
511+
- name: aarch64-msvc-2
512+
env:
513+
RUST_CONFIGURE_ARGS: --build=aarch64-pc-windows-msvc
514+
SCRIPT: make ci-msvc-ps1
515+
<<: *job-windows-aarch64
516+
500517
# x86_64-msvc-ext is split into multiple jobs to run tests in parallel.
501518
- name: x86_64-msvc-ext1
502519
env:
@@ -590,14 +607,14 @@ auto:
590607
- name: dist-aarch64-msvc
591608
env:
592609
RUST_CONFIGURE_ARGS: >-
593-
--build=x86_64-pc-windows-msvc
610+
--build=aarch64-pc-windows-msvc
594611
--host=aarch64-pc-windows-msvc
595612
--target=aarch64-pc-windows-msvc,arm64ec-pc-windows-msvc
596613
--enable-full-tools
597614
--enable-profiler
598615
SCRIPT: python x.py dist bootstrap --include-default-paths
599616
DIST_REQUIRE_ALL_TOOLS: 1
600-
<<: *job-windows
617+
<<: *job-windows-aarch64
601618

602619
- name: dist-i686-mingw
603620
env:

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

+15
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

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/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/run-make/pointer-auth-link-with-c/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[link(name = "test")]
1+
#[link(name = "test", kind = "static")]
22
extern "C" {
33
fn foo() -> i32;
44
}

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)