diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93316b9cff7b1..972e2f1793c93 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 diff --git a/compiler/rustc_target/src/spec/targets/aarch64_pc_windows_msvc.rs b/compiler/rustc_target/src/spec/targets/aarch64_pc_windows_msvc.rs index 98d78520c9838..94671b4e209b5 100644 --- a/compiler/rustc_target/src/spec/targets/aarch64_pc_windows_msvc.rs +++ b/compiler/rustc_target/src/spec/targets/aarch64_pc_windows_msvc.rs @@ -1,10 +1,18 @@ -use crate::spec::{Target, TargetMetadata, base}; +use std::borrow::Cow; + +use crate::spec::{LinkerFlavor, Lld, Target, TargetMetadata, base}; pub(crate) fn target() -> Target { let mut base = base::windows_msvc::opts(); base.max_atomic_width = Some(128); base.features = "+v8a,+neon,+fp-armv8".into(); + // MSVC emits a warning about code that may trip "Cortex-A53 MPCore processor bug #843419" which + // is sometimes emitted by LLVM. Since Arm64 Windows 10+ isn't supported on that processor, it's + // safe to disable the warning. + let msvc_pre_link_args = base.pre_link_args.get_mut(&LinkerFlavor::Msvc(Lld::No)).unwrap(); + msvc_pre_link_args.push(Cow::Borrowed("/arm64hazardfree")); + Target { llvm_target: "aarch64-pc-windows-msvc".into(), metadata: TargetMetadata { diff --git a/library/std/src/fs/tests.rs b/library/std/src/fs/tests.rs index 4712e58980cc6..a9062bea09e90 100644 --- a/library/std/src/fs/tests.rs +++ b/library/std/src/fs/tests.rs @@ -714,6 +714,10 @@ fn recursive_mkdir_empty() { } #[test] +#[cfg_attr( + all(windows, target_arch = "aarch64"), + ignore = "SymLinks not enabled on Arm64 Windows runners https://github.com/actions/partner-runner-images/issues/94" +)] fn recursive_rmdir() { let tmpdir = tmpdir(); let d1 = tmpdir.join("d1"); @@ -733,6 +737,10 @@ fn recursive_rmdir() { } #[test] +#[cfg_attr( + all(windows, target_arch = "aarch64"), + ignore = "SymLinks not enabled on Arm64 Windows runners https://github.com/actions/partner-runner-images/issues/94" +)] fn recursive_rmdir_of_symlink() { // test we do not recursively delete a symlink but only dirs. let tmpdir = tmpdir(); @@ -1517,6 +1525,10 @@ fn file_open_not_found() { } #[test] +#[cfg_attr( + all(windows, target_arch = "aarch64"), + ignore = "SymLinks not enabled on Arm64 Windows runners https://github.com/actions/partner-runner-images/issues/94" +)] fn create_dir_all_with_junctions() { let tmpdir = tmpdir(); let target = tmpdir.join("target"); @@ -1995,6 +2007,10 @@ fn test_rename_symlink() { #[test] #[cfg(windows)] +#[cfg_attr( + all(windows, target_arch = "aarch64"), + ignore = "SymLinks not enabled on Arm64 Windows runners https://github.com/actions/partner-runner-images/issues/94" +)] fn test_rename_junction() { let tmpdir = tmpdir(); let original = tmpdir.join("original"); diff --git a/src/ci/github-actions/jobs.yml b/src/ci/github-actions/jobs.yml index afcc092e78e8d..2f957baef635e 100644 --- a/src/ci/github-actions/jobs.yml +++ b/src/ci/github-actions/jobs.yml @@ -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 @@ -115,18 +119,18 @@ 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 + # aarch64-msvc is split into two jobs to run tests in parallel. + - name: aarch64-msvc-1 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-py + <<: *job-windows-aarch64 + + - name: aarch64-msvc-2 + env: + RUST_CONFIGURE_ARGS: --build=aarch64-pc-windows-msvc + SCRIPT: make ci-msvc-ps1 + <<: *job-windows-aarch64 # Jobs that run when you perform a try build (@bors try) # These jobs automatically inherit envs.try, to avoid repeating diff --git a/src/ci/scripts/install-clang.sh b/src/ci/scripts/install-clang.sh index 5522095e3049b..228d14fc0138b 100755 --- a/src/ci/scripts/install-clang.sh +++ b/src/ci/scripts/install-clang.sh @@ -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 @@ -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" diff --git a/src/ci/scripts/install-mingw.sh b/src/ci/scripts/install-mingw.sh index c8c501e646a9d..ad852071f2950 100755 --- a/src/ci/scripts/install-mingw.sh +++ b/src/ci/scripts/install-mingw.sh @@ -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 diff --git a/src/ci/scripts/install-ninja.sh b/src/ci/scripts/install-ninja.sh index 23cbc2eb6d107..7ac19173923cf 100755 --- a/src/ci/scripts/install-ninja.sh +++ b/src/ci/scripts/install-ninja.sh @@ -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 diff --git a/src/ci/scripts/install-rust.sh b/src/ci/scripts/install-rust.sh new file mode 100644 index 0000000000000..d87bb28aa303b --- /dev/null +++ b/src/ci/scripts/install-rust.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# The Arm64 Windows Runner does not have Rust already installed +# https://github.com/actions/partner-runner-images/issues/93 + +set -euo pipefail +IFS=$'\n\t' + +source "$(cd "$(dirname "$0")" && pwd)/../shared.sh" + +if [[ "${CI_JOB_NAME}" = *aarch64* ]] && isWindows; then + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \ + sh -s -- -y -q --default-host aarch64-pc-windows-msvc + ciCommandAddPath "${USERPROFILE}/.cargo/bin" +fi diff --git a/src/ci/scripts/install-sccache.sh b/src/ci/scripts/install-sccache.sh index b055e76a80504..fed06063fa0b3 100755 --- a/src/ci/scripts/install-sccache.sh +++ b/src/ci/scripts/install-sccache.sh @@ -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 diff --git a/src/doc/nomicon b/src/doc/nomicon index c76a20f0d9871..0c10c30cc5473 160000 --- a/src/doc/nomicon +++ b/src/doc/nomicon @@ -1 +1 @@ -Subproject commit c76a20f0d987145dcedf05c5c073ce8d91f2e82a +Subproject commit 0c10c30cc54736c5c194ce98c50e2de84eeb6e79 diff --git a/src/doc/reference b/src/doc/reference index 3bf3402aea982..3340922df189b 160000 --- a/src/doc/reference +++ b/src/doc/reference @@ -1 +1 @@ -Subproject commit 3bf3402aea982b876eb56c87da17b0685c6461d5 +Subproject commit 3340922df189bddcbaad17dc3927d51a76bcd5ed diff --git a/src/tools/compiletest/src/directive-list.rs b/src/tools/compiletest/src/directive-list.rs index 1449e9af19aa5..5757e422ae21e 100644 --- a/src/tools/compiletest/src/directive-list.rs +++ b/src/tools/compiletest/src/directive-list.rs @@ -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", diff --git a/tests/debuginfo/step-into-match.rs b/tests/debuginfo/step-into-match.rs index 577e553c11985..a4abe9a29aae3 100644 --- a/tests/debuginfo/step-into-match.rs +++ b/tests/debuginfo/step-into-match.rs @@ -1,6 +1,10 @@ //@ compile-flags: -g //@ ignore-android: FIXME(#10381) +// On Arm64 Windows, stepping at the end of a funciton on goes to the callsite, not the instruction +// after it. +//@ ignore-aarch64-pc-windows-msvc: Stepping out of functions behaves differently. + // === GDB TESTS ============================================================== // gdb-command: r diff --git a/tests/debuginfo/type-names.rs b/tests/debuginfo/type-names.rs index 4df6daf7b6ef0..3c7eab7e8d718 100644 --- a/tests/debuginfo/type-names.rs +++ b/tests/debuginfo/type-names.rs @@ -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 diff --git a/tests/ui/runtime/backtrace-debuginfo.rs b/tests/ui/runtime/backtrace-debuginfo.rs index afc96d6bb5f54..37fce2788b7f0 100644 --- a/tests/ui/runtime/backtrace-debuginfo.rs +++ b/tests/ui/runtime/backtrace-debuginfo.rs @@ -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")) {