Skip to content

DRAFT: Add an aarch64-msvc build running on ARM64 Windows #140136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ jobs:
- name: show the current environment
run: src/ci/scripts/dump-environment.sh

- name: install rust
run: src/ci/scripts/install-rust.sh

- name: install awscli
run: src/ci/scripts/install-awscli.sh

Expand Down Expand Up @@ -225,8 +228,7 @@ jobs:
fi
exit ${STATUS}
env:
AWS_ACCESS_KEY_ID: ${{ env.CACHES_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}
SCCACHE_S3_NO_CREDENTIALS: 1

- name: create github artifacts
run: src/ci/scripts/create-doc-artifacts.sh
Expand Down
19 changes: 8 additions & 11 deletions src/ci/github-actions/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ runners:
os: windows-2025-8core-32gb
<<: *base-job

- &job-windows-aarch64
os: windows-11-arm
<<: *base-job

- &job-aarch64-linux
# Free some disk space to avoid running out of space during the build.
free_disk: true
Expand Down Expand Up @@ -115,18 +119,11 @@ envs:
# These jobs automatically inherit envs.pr, to avoid repeating
# it in each job definition.
pr:
- name: mingw-check
<<: *job-linux-4c
- name: mingw-check-tidy
continue_on_error: true
<<: *job-linux-4c
- name: x86_64-gnu-llvm-19
- name: aarch64-msvc
env:
ENABLE_GCC_CODEGEN: "1"
DOCKER_SCRIPT: x86_64-gnu-llvm.sh
<<: *job-linux-16c
- name: x86_64-gnu-tools
<<: *job-linux-16c
RUST_CONFIGURE_ARGS: --build=aarch64-pc-windows-msvc
SCRIPT: make ci-msvc
<<: *job-windows-aarch64

# Jobs that run when you perform a try build (@bors try)
# These jobs automatically inherit envs.try, to avoid repeating
Expand Down
18 changes: 14 additions & 4 deletions src/ci/scripts/install-clang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"

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

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

mkdir -p citools/clang-rust
cd citools
retry curl -f "${MIRRORS_BASE}/LLVM-${LLVM_VERSION}-win64.exe" \
-o "LLVM-${LLVM_VERSION}-win64.exe"
7z x -oclang-rust/ "LLVM-${LLVM_VERSION}-win64.exe"

if [[ "${CI_JOB_NAME}" = *aarch64* ]]; then
suffix=woa64

# On Arm64, the Ring crate requires that Clang be on the PATH.
# https://github.com/briansmith/ring/blob/main/BUILDING.md
ciCommandAddPath "$(cygpath -m "$(pwd)/clang-rust/bin")"
else
suffix=win64
fi
retry curl -f "${MIRRORS_BASE}/LLVM-${LLVM_VERSION}-${suffix}.exe" \
-o "LLVM-${LLVM_VERSION}-${suffix}.exe"
7z x -oclang-rust/ "LLVM-${LLVM_VERSION}-${suffix}.exe"
ciCommandSetEnv RUST_CONFIGURE_ARGS \
"${RUST_CONFIGURE_ARGS} --set llvm.clang-cl=$(pwd)/clang-rust/bin/clang-cl.exe"

Expand Down
2 changes: 1 addition & 1 deletion src/ci/scripts/install-mingw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ if isWindows && isKnownToBeMingwBuild; then

curl -o mingw.7z "${MIRRORS_BASE}/${mingw_archive}"
7z x -y mingw.7z > /dev/null
ciCommandAddPath "$(pwd)/${mingw_dir}/bin"
ciCommandAddPath "$(cygpath -m "$(pwd)/${mingw_dir}/bin")"
fi
2 changes: 1 addition & 1 deletion src/ci/scripts/install-ninja.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if isWindows; then
7z x -oninja ninja.zip
rm ninja.zip
ciCommandSetEnv "RUST_CONFIGURE_ARGS" "${RUST_CONFIGURE_ARGS} --enable-ninja"
ciCommandAddPath "$(pwd)/ninja"
ciCommandAddPath "$(cygpath -m "$(pwd)/ninja")"
elif isMacOS; then
brew install ninja
fi
17 changes: 17 additions & 0 deletions src/ci/scripts/install-rust.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
# For mingw builds use a vendored mingw.

set -euo pipefail
IFS=$'\n\t'

source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"

if isWindows; then
case "${CI_JOB_NAME}" in
*aarch64*)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
sh -s -- -y -q --default-host aarch64-pc-windows-msvc
ciCommandAddPath "${USERPROFILE}/.cargo/bin"
;;
esac
fi
2 changes: 1 addition & 1 deletion src/ci/scripts/install-sccache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ elif isWindows; then
mkdir -p sccache
curl -fo sccache/sccache.exe \
"${MIRRORS_BASE}/2025-02-24-sccache-v0.10.0-x86_64-pc-windows-msvc.exe"
ciCommandAddPath "$(pwd)/sccache"
ciCommandAddPath "$(cygpath -m "$(pwd)/sccache")"
fi

# FIXME: we should probably install sccache outside the containers and then
Expand Down
2 changes: 1 addition & 1 deletion src/doc/nomicon
Submodule nomicon updated 1 files
+3 −3 src/exotic-sizes.md
1 change: 1 addition & 0 deletions src/tools/compiletest/src/directive-list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
"ignore-32bit",
"ignore-64bit",
"ignore-aarch64",
"ignore-aarch64-pc-windows-msvc",
"ignore-aarch64-unknown-linux-gnu",
"ignore-aix",
"ignore-android",
Expand Down
1 change: 1 addition & 0 deletions tests/debuginfo/step-into-match.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@ compile-flags: -g
//@ ignore-android: FIXME(#10381)
//@ ignore-aarch64-pc-windows-msvc: Stepping at the end of a funciton on Arm64 Windows goes to the callsite, not the instruction after it.

// === GDB TESTS ==============================================================

Expand Down
2 changes: 2 additions & 0 deletions tests/debuginfo/type-names.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//@ ignore-lldb

//@ ignore-aarch64-pc-windows-msvc: Arm64 Windows cdb doesn't support JavaScript extensions.

// GDB changed the way that it formatted Foreign types
//@ min-gdb-version: 9.2

Expand Down
4 changes: 4 additions & 0 deletions tests/ui/runtime/backtrace-debuginfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,13 @@ macro_rules! dump_and_die {
// there, even on i686-pc-windows-msvc. We do the best we can in
// rust-lang/rust to test it as well, but sometimes we just gotta keep
// landing PRs.
//
// aarch64-msvc is broken as its backtraces are truncated.
// See https://github.com/rust-lang/rust/issues/140489
if cfg!(any(target_os = "android",
all(target_os = "linux", target_arch = "arm"),
all(target_env = "msvc", target_arch = "x86"),
all(target_env = "msvc", target_arch = "aarch64"),
target_os = "freebsd",
target_os = "dragonfly",
target_os = "openbsd")) {
Expand Down
Loading