Skip to content

Commit 576e227

Browse files
committed
Auto merge of #75991 - shepmaster:silicon-ci, r=pietroalbini
Set up CI for aarch64-apple-darwin
2 parents c71248b + 2fe271e commit 576e227

File tree

5 files changed

+83
-6
lines changed

5 files changed

+83
-6
lines changed

.github/workflows/ci.yml

+24
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ jobs:
8989
- name: install sccache
9090
run: src/ci/scripts/install-sccache.sh
9191
if: success() && !env.SKIP_JOB
92+
- name: select Xcode
93+
run: src/ci/scripts/select-xcode.sh
94+
if: success() && !env.SKIP_JOB
9295
- name: install clang
9396
run: src/ci/scripts/install-clang.sh
9497
if: success() && !env.SKIP_JOB
@@ -300,6 +303,18 @@ jobs:
300303
NO_LLVM_ASSERTIONS: 1
301304
NO_DEBUG_ASSERTIONS: 1
302305
os: macos-latest
306+
- name: dist-aarch64-apple
307+
env:
308+
SCRIPT: "./x.py dist --stage 2"
309+
RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --host=aarch64-apple-darwin --target=aarch64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false --tools=rls,clippy,rustfmt,analysis,src"
310+
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
311+
SELECT_XCODE: /Applications/Xcode_12_beta.app
312+
USE_XCODE_CLANG: 1
313+
MACOSX_DEPLOYMENT_TARGET: 11.0
314+
MACOSX_STD_DEPLOYMENT_TARGET: 11.0
315+
NO_LLVM_ASSERTIONS: 1
316+
NO_DEBUG_ASSERTIONS: 1
317+
os: macos-latest
303318
- name: x86_64-msvc-1
304319
env:
305320
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --enable-profiler"
@@ -437,6 +452,9 @@ jobs:
437452
- name: install sccache
438453
run: src/ci/scripts/install-sccache.sh
439454
if: success() && !env.SKIP_JOB
455+
- name: select Xcode
456+
run: src/ci/scripts/select-xcode.sh
457+
if: success() && !env.SKIP_JOB
440458
- name: install clang
441459
run: src/ci/scripts/install-clang.sh
442460
if: success() && !env.SKIP_JOB
@@ -544,6 +562,9 @@ jobs:
544562
- name: install sccache
545563
run: src/ci/scripts/install-sccache.sh
546564
if: success() && !env.SKIP_JOB
565+
- name: select Xcode
566+
run: src/ci/scripts/select-xcode.sh
567+
if: success() && !env.SKIP_JOB
547568
- name: install clang
548569
run: src/ci/scripts/install-clang.sh
549570
if: success() && !env.SKIP_JOB
@@ -648,6 +669,9 @@ jobs:
648669
- name: install sccache
649670
run: src/ci/scripts/install-sccache.sh
650671
if: success() && !env.SKIP_JOB
672+
- name: select Xcode
673+
run: src/ci/scripts/select-xcode.sh
674+
if: success() && !env.SKIP_JOB
651675
- name: install clang
652676
run: src/ci/scripts/install-clang.sh
653677
if: success() && !env.SKIP_JOB

src/ci/github-actions/ci.yml

+32
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ x--expand-yaml-anchors--remove:
149149
run: src/ci/scripts/install-sccache.sh
150150
<<: *step
151151

152+
- name: select Xcode
153+
run: src/ci/scripts/select-xcode.sh
154+
<<: *step
155+
152156
- name: install clang
153157
run: src/ci/scripts/install-clang.sh
154158
<<: *step
@@ -457,6 +461,34 @@ jobs:
457461
NO_DEBUG_ASSERTIONS: 1
458462
<<: *job-macos-xl
459463

464+
# This target only needs to support 11.0 and up as nothing else supports the hardware
465+
- name: dist-aarch64-apple
466+
env:
467+
SCRIPT: ./x.py dist --stage 2
468+
RUST_CONFIGURE_ARGS: >-
469+
--build=x86_64-apple-darwin
470+
--host=aarch64-apple-darwin
471+
--target=aarch64-apple-darwin
472+
--enable-sanitizers
473+
--enable-profiler
474+
--set rust.jemalloc
475+
--set llvm.ninja=false
476+
--tools=rls,clippy,rustfmt,analysis,src
477+
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
478+
SELECT_XCODE: /Applications/Xcode_12_beta.app
479+
USE_XCODE_CLANG: 1
480+
MACOSX_DEPLOYMENT_TARGET: 11.0
481+
MACOSX_STD_DEPLOYMENT_TARGET: 11.0
482+
NO_LLVM_ASSERTIONS: 1
483+
NO_DEBUG_ASSERTIONS: 1
484+
# TODO: Cargo is disabled until OpenSSL 1.1.1 can be
485+
# compiled for aarch64-apple-darwin::
486+
# https://github.com/openssl/openssl/pull/12369. Once
487+
# fixed, remove `--tools`, add back
488+
# `--enable-full-tools`, and enable this again
489+
# DIST_REQUIRE_ALL_TOOLS: 1
490+
<<: *job-macos-xl
491+
460492
######################
461493
# Windows Builders #
462494
######################

src/ci/scripts/install-clang.sh

+11-3
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,18 @@ source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
1212
LLVM_VERSION="10.0.0"
1313

1414
if isMacOS; then
15-
curl -f "${MIRRORS_BASE}/clang%2Bllvm-${LLVM_VERSION}-x86_64-apple-darwin.tar.xz" | tar xJf -
15+
# If the job selects a specific Xcode version, use that instead of
16+
# downloading our own version.
17+
if [[ ${USE_XCODE_CLANG-0} -eq 1 ]]; then
18+
bindir="$(xcode-select --print-path)/Toolchains/XcodeDefault.xctoolchain/usr/bin"
19+
else
20+
file="${MIRRORS_BASE}/clang%2Bllvm-${LLVM_VERSION}-x86_64-apple-darwin.tar.xz"
21+
curl -f "${file}" | tar xJf -
22+
bindir="$(pwd)/clang+llvm-${LLVM_VERSION}-x86_64-apple-darwin/bin"
23+
fi
1624

17-
ciCommandSetEnv CC "$(pwd)/clang+llvm-${LLVM_VERSION}-x86_64-apple-darwin/bin/clang"
18-
ciCommandSetEnv CXX "$(pwd)/clang+llvm-${LLVM_VERSION}-x86_64-apple-darwin/bin/clang++"
25+
ciCommandSetEnv CC "${bindir}/clang"
26+
ciCommandSetEnv CXX "${bindir}/clang++"
1927

2028
# macOS 10.15 onwards doesn't have libraries in /usr/include anymore: those
2129
# are now located deep into the filesystem, under Xcode's own files. The

src/ci/scripts/select-xcode.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
# This script selects the Xcode instance to use.
3+
4+
set -euo pipefail
5+
IFS=$'\n\t'
6+
7+
source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
8+
9+
if isMacOS; then
10+
if [[ -s "${SELECT_XCODE-}" ]]; then
11+
sudo xcode-select -s "${SELECT_XCODE}"
12+
fi
13+
fi

src/doc/rustc/src/platform-support.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ target | std | host | notes
3737
`i686-pc-windows-gnu` | ✓ | ✓ | 32-bit MinGW (Windows 7+)
3838
`i686-pc-windows-msvc` | ✓ | ✓ | 32-bit MSVC (Windows 7+)
3939
`i686-unknown-linux-gnu` | ✓ | ✓ | 32-bit Linux (kernel 2.6.32+, glibc 2.11+)
40-
`x86_64-apple-darwin` | ✓ | ✓ | 64-bit OSX (10.7+, Lion+)
40+
`x86_64-apple-darwin` | ✓ | ✓ | 64-bit macOS (10.7+, Lion+)
4141
`x86_64-pc-windows-gnu` | ✓ | ✓ | 64-bit MinGW (Windows 7+)
4242
`x86_64-pc-windows-msvc` | ✓ | ✓ | 64-bit MSVC (Windows 7+)
4343
`x86_64-unknown-linux-gnu` | ✓ | ✓ | 64-bit Linux (kernel 2.6.32+, glibc 2.11+)
@@ -57,6 +57,7 @@ Specifically, these platforms are required to have each of the following:
5757

5858
target | std | host | notes
5959
-------|-----|------|-------
60+
`aarch64-apple-darwin` | ✓ | | ARM64 macOS (11.0+, Big Sur+)
6061
`aarch64-apple-ios` | ✓ | | ARM64 iOS
6162
`aarch64-fuchsia` | ✓ | | ARM64 Fuchsia
6263
`aarch64-linux-android` | ✓ | | ARM64 Android
@@ -145,7 +146,6 @@ not available.
145146

146147
target | std | host | notes
147148
-------|-----|------|-------
148-
`aarch64-apple-darwin` | ? | | ARM64 macOS
149149
`aarch64-apple-tvos` | * | | ARM64 tvOS
150150
`aarch64-unknown-cloudabi` | ✓ | | ARM64 CloudABI
151151
`aarch64-unknown-freebsd` | ✓ | ✓ | ARM64 FreeBSD
@@ -168,7 +168,7 @@ target | std | host | notes
168168
`avr-unknown-gnu-atmega328` | ✗ | | AVR. Requires `-Z build-std=core`
169169
`hexagon-unknown-linux-musl` | ? | |
170170
`i386-apple-ios` | ✓ | | 32-bit x86 iOS
171-
`i686-apple-darwin` | ✓ | ✓ | 32-bit OSX (10.7+, Lion+)
171+
`i686-apple-darwin` | ✓ | ✓ | 32-bit macOS (10.7+, Lion+)
172172
`i686-pc-windows-msvc` | ✓ | | 32-bit Windows XP support
173173
`i686-unknown-cloudabi` | ✓ | | 32-bit CloudABI
174174
`i686-unknown-uefi` | ? | | 32-bit UEFI

0 commit comments

Comments
 (0)