Skip to content

Commit 52376ff

Browse files
authored
Merge pull request #2835 from Alovchin91/alovchin91/win-arm64
Support building rustup for Windows arm64
2 parents 38f4479 + e2a3e12 commit 52376ff

File tree

9 files changed

+17
-7
lines changed

9 files changed

+17
-7
lines changed

.github/workflows/windows-builds-on-master.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
matrix:
2222
target:
2323
- x86_64-pc-windows-msvc
24+
- aarch64-pc-windows-msvc # skip-pr skip-stable
2425
- x86_64-pc-windows-gnu # skip-pr
2526
include:
2627
- target: x86_64-pc-windows-gnu
@@ -29,6 +30,8 @@ jobs:
2930
- target: i686-pc-windows-gnu
3031
mingwdir: mingw32
3132
mingw: https://ci-mirrors.rust-lang.org/rustc/i686-6.3.0-release-posix-dwarf-rt_v5-rev2.7z
33+
- target: aarch64-pc-windows-msvc # skip-pr skip-stable
34+
skip_tests: yes # skip-pr skip-stable
3235
steps:
3336
- uses: actions/checkout@v2
3437
# v2 defaults to a shallow checkout, but we need at least to the previous tag
@@ -62,7 +65,7 @@ jobs:
6265
run: |
6366
echo "%USERPROFILE%\.cargo\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
6467
echo "TARGET=${{ matrix.target }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
65-
echo "SKIP_TESTS=" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
68+
echo "SKIP_TESTS=${{ matrix.skip_tests }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
6669
- name: Cache cargo registry and git trees
6770
uses: actions/cache@v2
6871
with:

.github/workflows/windows-builds-on-pr.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
run: |
6060
echo "%USERPROFILE%\.cargo\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
6161
echo "TARGET=${{ matrix.target }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
62-
echo "SKIP_TESTS=" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
62+
echo "SKIP_TESTS=${{ matrix.skip_tests }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
6363
- name: Cache cargo registry and git trees
6464
uses: actions/cache@v2
6565
with:

.github/workflows/windows-builds-on-stable.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
run: |
6363
echo "%USERPROFILE%\.cargo\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
6464
echo "TARGET=${{ matrix.target }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
65-
echo "SKIP_TESTS=" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
65+
echo "SKIP_TESTS=${{ matrix.skip_tests }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
6666
- name: Cache cargo registry and git trees
6767
uses: actions/cache@v2
6868
with:

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ci/actions-templates/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ system.
6767
| x86_64-pc-windows-gnu | No | One | No | Yes |
6868
| i686-pc-windows-msvc | No | One | No | No |
6969
| i686-pc-windows-gnu | No | One | No | No |
70+
| aarch64-pc-windows-msvc | Yes | Two | No | Yes |
7071

7172
We also have a clippy/shellcheck target which runs on x86_64 linux and is
7273
run in all cases. It does a `cargo fmt` check, a `cargo clippy` check on the

ci/actions-templates/windows-builds-template.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
target:
2929
- x86_64-pc-windows-msvc
3030
- i686-pc-windows-msvc # skip-pr skip-master
31+
- aarch64-pc-windows-msvc # skip-pr skip-stable
3132
- x86_64-pc-windows-gnu # skip-pr
3233
- i686-pc-windows-gnu # skip-pr skip-master
3334
include:
@@ -37,6 +38,8 @@ jobs:
3738
- target: i686-pc-windows-gnu
3839
mingwdir: mingw32
3940
mingw: https://ci-mirrors.rust-lang.org/rustc/i686-6.3.0-release-posix-dwarf-rt_v5-rev2.7z
41+
- target: aarch64-pc-windows-msvc # skip-pr skip-stable
42+
skip_tests: yes # skip-pr skip-stable
4043
steps:
4144
- uses: actions/checkout@v2
4245
# v2 defaults to a shallow checkout, but we need at least to the previous tag
@@ -70,7 +73,7 @@ jobs:
7073
run: |
7174
echo "%USERPROFILE%\.cargo\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
7275
echo "TARGET=${{ matrix.target }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
73-
echo "SKIP_TESTS=" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
76+
echo "SKIP_TESTS=${{ matrix.skip_tests }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
7477
- name: Cache cargo registry and git trees
7578
uses: actions/cache@v2
7679
with:

ci/run.bash

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ case "$TARGET" in
2020
mips* ) ;;
2121
riscv* ) ;;
2222
s390x* ) ;;
23+
aarch64-pc-windows-msvc ) ;;
2324
# default case, build with rustls enabled
2425
* ) FEATURES+=('--features' 'reqwest-rustls-tls') ;;
2526
esac

doc/src/installation/windows.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ tools" and "Windows 10 SDK" option. No additional software installation is
1616
necessary for basic use of the GNU build.
1717

1818
By default `rustup` on Windows configures Rust to target the MSVC ABI, that is
19-
a target triple of either `i686-pc-windows-msvc` or `x86_64-pc-windows-msvc`
19+
a target triple of either `i686-pc-windows-msvc`, `x86_64-pc-windows-msvc`, or `aarch64-pc-windows-msvc`
2020
depending on the CPU architecture of the host Windows OS. The toolchains that
2121
`rustup` chooses to install, unless told otherwise through the [toolchain
2222
specification], will be compiled to run on that target triple host and will

src/dist/dist.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ impl TargetTriple {
234234
// First detect architecture
235235
const PROCESSOR_ARCHITECTURE_AMD64: u16 = 9;
236236
const PROCESSOR_ARCHITECTURE_INTEL: u16 = 0;
237+
const PROCESSOR_ARCHITECTURE_ARM64: u16 = 12;
237238

238239
let mut sys_info;
239240
unsafe {
@@ -244,6 +245,7 @@ impl TargetTriple {
244245
let arch = match unsafe { sys_info.u.s() }.wProcessorArchitecture {
245246
PROCESSOR_ARCHITECTURE_AMD64 => "x86_64",
246247
PROCESSOR_ARCHITECTURE_INTEL => "i686",
248+
PROCESSOR_ARCHITECTURE_ARM64 => "aarch64",
247249
_ => return None,
248250
};
249251

0 commit comments

Comments
 (0)