Skip to content

Commit 8581200

Browse files
committed
Auto merge of #116368 - shepmaster:github-actions-m1, r=Mark-Simulacrum
Use GitHub Actions M1 builder for aarch64-apple-darwin r? `@ghost`
2 parents 0d16646 + 821b03d commit 8581200

File tree

3 files changed

+52
-18
lines changed

3 files changed

+52
-18
lines changed

.github/workflows/ci.yml

+12-4
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ jobs:
9393
- name: show the current environment
9494
run: src/ci/scripts/dump-environment.sh
9595
if: success() && !env.SKIP_JOB
96+
- name: install awscli
97+
run: src/ci/scripts/install-awscli.sh
98+
if: success() && !env.SKIP_JOB
9699
- name: install sccache
97100
run: src/ci/scripts/install-sccache.sh
98101
if: success() && !env.SKIP_JOB
@@ -345,8 +348,8 @@ jobs:
345348
os: macos-13
346349
- name: dist-aarch64-apple
347350
env:
348-
SCRIPT: "./x.py dist bootstrap --include-default-paths --stage 2"
349-
RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --host=aarch64-apple-darwin --target=aarch64-apple-darwin --enable-full-tools --enable-sanitizers --enable-profiler --disable-docs --set rust.jemalloc --set llvm.ninja=false"
351+
SCRIPT: "./x.py dist bootstrap --include-default-paths --host=aarch64-apple-darwin --target=aarch64-apple-darwin"
352+
RUST_CONFIGURE_ARGS: "--enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false --set rust.lto=thin"
350353
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
351354
SELECT_XCODE: /Applications/Xcode_13.4.1.app
352355
USE_XCODE_CLANG: 1
@@ -356,8 +359,7 @@ jobs:
356359
NO_DEBUG_ASSERTIONS: 1
357360
NO_OVERFLOW_CHECKS: 1
358361
DIST_REQUIRE_ALL_TOOLS: 1
359-
JEMALLOC_SYS_WITH_LG_PAGE: 14
360-
os: macos-13
362+
os: macos-13-xlarge
361363
- name: x86_64-msvc
362364
env:
363365
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --enable-profiler"
@@ -458,6 +460,9 @@ jobs:
458460
- name: show the current environment
459461
run: src/ci/scripts/dump-environment.sh
460462
if: success() && !env.SKIP_JOB
463+
- name: install awscli
464+
run: src/ci/scripts/install-awscli.sh
465+
if: success() && !env.SKIP_JOB
461466
- name: install sccache
462467
run: src/ci/scripts/install-sccache.sh
463468
if: success() && !env.SKIP_JOB
@@ -578,6 +583,9 @@ jobs:
578583
- name: show the current environment
579584
run: src/ci/scripts/dump-environment.sh
580585
if: success() && !env.SKIP_JOB
586+
- name: install awscli
587+
run: src/ci/scripts/install-awscli.sh
588+
if: success() && !env.SKIP_JOB
581589
- name: install sccache
582590
run: src/ci/scripts/install-sccache.sh
583591
if: success() && !env.SKIP_JOB

src/ci/github-actions/ci.yml

+11-14
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ x--expand-yaml-anchors--remove:
9191
os: macos-13 # We use the standard runner for now
9292
<<: *base-job
9393

94+
- &job-macos-m1
95+
os: macos-13-xlarge
96+
<<: *base-job
97+
9498
- &job-windows-8c
9599
os: windows-2019-8core-32gb
96100
<<: *base-job
@@ -153,6 +157,10 @@ x--expand-yaml-anchors--remove:
153157
run: src/ci/scripts/dump-environment.sh
154158
<<: *step
155159

160+
- name: install awscli
161+
run: src/ci/scripts/install-awscli.sh
162+
<<: *step
163+
156164
- name: install sccache
157165
run: src/ci/scripts/install-sccache.sh
158166
<<: *step
@@ -523,17 +531,14 @@ jobs:
523531
# This target only needs to support 11.0 and up as nothing else supports the hardware
524532
- name: dist-aarch64-apple
525533
env:
526-
SCRIPT: ./x.py dist bootstrap --include-default-paths --stage 2
534+
SCRIPT: ./x.py dist bootstrap --include-default-paths --host=aarch64-apple-darwin --target=aarch64-apple-darwin
527535
RUST_CONFIGURE_ARGS: >-
528-
--build=x86_64-apple-darwin
529-
--host=aarch64-apple-darwin
530-
--target=aarch64-apple-darwin
531536
--enable-full-tools
532537
--enable-sanitizers
533538
--enable-profiler
534-
--disable-docs
535539
--set rust.jemalloc
536540
--set llvm.ninja=false
541+
--set rust.lto=thin
537542
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
538543
SELECT_XCODE: /Applications/Xcode_13.4.1.app
539544
USE_XCODE_CLANG: 1
@@ -543,15 +548,7 @@ jobs:
543548
NO_DEBUG_ASSERTIONS: 1
544549
NO_OVERFLOW_CHECKS: 1
545550
DIST_REQUIRE_ALL_TOOLS: 1
546-
# Corresponds to 16K page size
547-
#
548-
# Shouldn't be needed if jemalloc-sys is updated to
549-
# handle this platform like iOS or if we build on
550-
# aarch64-apple-darwin itself.
551-
#
552-
# https://github.com/gnzlbg/jemallocator/blob/c27a859e98e3cb790dc269773d9da71a1e918458/jemalloc-sys/build.rs#L237
553-
JEMALLOC_SYS_WITH_LG_PAGE: 14
554-
<<: *job-macos-xl
551+
<<: *job-macos-m1
555552

556553
######################
557554
# Windows Builders #

src/ci/scripts/install-awscli.sh

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
# This script downloads and installs the awscli binaries directly from
3+
# Amazon.
4+
5+
set -euo pipefail
6+
IFS=$'\n\t'
7+
8+
source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
9+
10+
AWS_VERSION="2.13.25"
11+
12+
# Only the macOS arm64/aarch64 GitHub Actions runner needs to have AWS
13+
# installed; other platforms have it preinstalled.
14+
15+
if isMacOS; then
16+
platform=$(uname -m)
17+
case $platform in
18+
x86_64)
19+
;;
20+
arm64)
21+
file="https://awscli.amazonaws.com/AWSCLIV2-${AWS_VERSION}.pkg"
22+
retry curl -f "${file}" -o "AWSCLIV2.pkg"
23+
sudo installer -pkg "AWSCLIV2.pkg" -target /
24+
;;
25+
*)
26+
echo "unsupported architecture: ${platform}"
27+
exit 1
28+
esac
29+
fi

0 commit comments

Comments
 (0)