Skip to content
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

Set up CI for aarch64-apple-darwin #75991

Merged
merged 2 commits into from
Oct 12, 2020
Merged
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
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ jobs:
- name: install sccache
run: src/ci/scripts/install-sccache.sh
if: success() && !env.SKIP_JOB
- name: select Xcode
run: src/ci/scripts/select-xcode.sh
if: success() && !env.SKIP_JOB
- name: install clang
run: src/ci/scripts/install-clang.sh
if: success() && !env.SKIP_JOB
Expand Down Expand Up @@ -300,6 +303,18 @@ jobs:
NO_LLVM_ASSERTIONS: 1
NO_DEBUG_ASSERTIONS: 1
os: macos-latest
- name: dist-aarch64-apple
env:
SCRIPT: "./x.py dist --stage 2"
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"
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
SELECT_XCODE: /Applications/Xcode_12_beta.app
USE_XCODE_CLANG: 1
MACOSX_DEPLOYMENT_TARGET: 11.0
MACOSX_STD_DEPLOYMENT_TARGET: 11.0
NO_LLVM_ASSERTIONS: 1
NO_DEBUG_ASSERTIONS: 1
os: macos-latest
- name: x86_64-msvc-1
env:
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --enable-profiler"
Expand Down Expand Up @@ -437,6 +452,9 @@ jobs:
- name: install sccache
run: src/ci/scripts/install-sccache.sh
if: success() && !env.SKIP_JOB
- name: select Xcode
run: src/ci/scripts/select-xcode.sh
if: success() && !env.SKIP_JOB
- name: install clang
run: src/ci/scripts/install-clang.sh
if: success() && !env.SKIP_JOB
Expand Down Expand Up @@ -544,6 +562,9 @@ jobs:
- name: install sccache
run: src/ci/scripts/install-sccache.sh
if: success() && !env.SKIP_JOB
- name: select Xcode
run: src/ci/scripts/select-xcode.sh
if: success() && !env.SKIP_JOB
- name: install clang
run: src/ci/scripts/install-clang.sh
if: success() && !env.SKIP_JOB
Expand Down Expand Up @@ -648,6 +669,9 @@ jobs:
- name: install sccache
run: src/ci/scripts/install-sccache.sh
if: success() && !env.SKIP_JOB
- name: select Xcode
run: src/ci/scripts/select-xcode.sh
if: success() && !env.SKIP_JOB
- name: install clang
run: src/ci/scripts/install-clang.sh
if: success() && !env.SKIP_JOB
Expand Down
32 changes: 32 additions & 0 deletions src/ci/github-actions/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ x--expand-yaml-anchors--remove:
run: src/ci/scripts/install-sccache.sh
<<: *step

- name: select Xcode
run: src/ci/scripts/select-xcode.sh
<<: *step

- name: install clang
run: src/ci/scripts/install-clang.sh
<<: *step
Expand Down Expand Up @@ -457,6 +461,34 @@ jobs:
NO_DEBUG_ASSERTIONS: 1
<<: *job-macos-xl

# This target only needs to support 11.0 and up as nothing else supports the hardware
- name: dist-aarch64-apple
env:
SCRIPT: ./x.py dist --stage 2
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
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
SELECT_XCODE: /Applications/Xcode_12_beta.app
USE_XCODE_CLANG: 1
MACOSX_DEPLOYMENT_TARGET: 11.0
MACOSX_STD_DEPLOYMENT_TARGET: 11.0
NO_LLVM_ASSERTIONS: 1
NO_DEBUG_ASSERTIONS: 1
# TODO: Cargo is disabled until OpenSSL 1.1.1 can be
# compiled for aarch64-apple-darwin::
# https://github.com/openssl/openssl/pull/12369. Once
# fixed, remove `--tools`, add back
# `--enable-full-tools`, and enable this again
# DIST_REQUIRE_ALL_TOOLS: 1
<<: *job-macos-xl

######################
# Windows Builders #
######################
Expand Down
14 changes: 11 additions & 3 deletions src/ci/scripts/install-clang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,18 @@ source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
LLVM_VERSION="10.0.0"

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

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

# macOS 10.15 onwards doesn't have libraries in /usr/include anymore: those
# are now located deep into the filesystem, under Xcode's own files. The
Expand Down
13 changes: 13 additions & 0 deletions src/ci/scripts/select-xcode.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
# This script selects the Xcode instance to use.

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

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

if isMacOS; then
if [[ -s "${SELECT_XCODE-}" ]]; then
sudo xcode-select -s "${SELECT_XCODE}"
fi
fi
6 changes: 3 additions & 3 deletions src/doc/rustc/src/platform-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ target | std | host | notes
`i686-pc-windows-gnu` | ✓ | ✓ | 32-bit MinGW (Windows 7+)
`i686-pc-windows-msvc` | ✓ | ✓ | 32-bit MSVC (Windows 7+)
`i686-unknown-linux-gnu` | ✓ | ✓ | 32-bit Linux (kernel 2.6.32+, glibc 2.11+)
`x86_64-apple-darwin` | ✓ | ✓ | 64-bit OSX (10.7+, Lion+)
`x86_64-apple-darwin` | ✓ | ✓ | 64-bit macOS (10.7+, Lion+)
`x86_64-pc-windows-gnu` | ✓ | ✓ | 64-bit MinGW (Windows 7+)
`x86_64-pc-windows-msvc` | ✓ | ✓ | 64-bit MSVC (Windows 7+)
`x86_64-unknown-linux-gnu` | ✓ | ✓ | 64-bit Linux (kernel 2.6.32+, glibc 2.11+)
Expand All @@ -57,6 +57,7 @@ Specifically, these platforms are required to have each of the following:

target | std | host | notes
-------|-----|------|-------
`aarch64-apple-darwin` | ✓ | | ARM64 macOS (11.0+, Big Sur+)
`aarch64-apple-ios` | ✓ | | ARM64 iOS
`aarch64-fuchsia` | ✓ | | ARM64 Fuchsia
`aarch64-linux-android` | ✓ | | ARM64 Android
Expand Down Expand Up @@ -145,7 +146,6 @@ not available.

target | std | host | notes
-------|-----|------|-------
`aarch64-apple-darwin` | ? | | ARM64 macOS
`aarch64-apple-tvos` | * | | ARM64 tvOS
`aarch64-unknown-cloudabi` | ✓ | | ARM64 CloudABI
`aarch64-unknown-freebsd` | ✓ | ✓ | ARM64 FreeBSD
Expand All @@ -168,7 +168,7 @@ target | std | host | notes
`avr-unknown-gnu-atmega328` | ✗ | | AVR. Requires `-Z build-std=core`
`hexagon-unknown-linux-musl` | ? | |
`i386-apple-ios` | ✓ | | 32-bit x86 iOS
`i686-apple-darwin` | ✓ | ✓ | 32-bit OSX (10.7+, Lion+)
`i686-apple-darwin` | ✓ | ✓ | 32-bit macOS (10.7+, Lion+)
`i686-pc-windows-msvc` | ✓ | | 32-bit Windows XP support
`i686-unknown-cloudabi` | ✓ | | 32-bit CloudABI
`i686-unknown-uefi` | ? | | 32-bit UEFI
Expand Down