Skip to content

Commit 3bc2f72

Browse files
committed
Auto merge of #116368 - shepmaster:github-actions-m1, r=<try>
Use GitHub Actions M1 builder for aarch64-apple-darwin r? `@ghost`
2 parents 59edd67 + 5cc5281 commit 3bc2f72

File tree

3 files changed

+88
-171
lines changed

3 files changed

+88
-171
lines changed

.github/workflows/ci.yml

+23-131
Original file line numberDiff line numberDiff line change
@@ -35,130 +35,6 @@ concurrency:
3535
group: "${{ github.workflow }}-${{ ((github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.sha) || github.ref }}"
3636
cancel-in-progress: true
3737
jobs:
38-
pr:
39-
name: "PR - ${{ matrix.name }}"
40-
env:
41-
PR_CI_JOB: 1
42-
CI_JOB_NAME: "${{ matrix.name }}"
43-
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
44-
HEAD_SHA: "${{ github.event.pull_request.head.sha || github.sha }}"
45-
SCCACHE_BUCKET: rust-lang-ci-sccache2
46-
TOOLSTATE_REPO: "https://github.com/rust-lang-nursery/rust-toolstate"
47-
CACHE_DOMAIN: ci-caches.rust-lang.org
48-
if: "github.event_name == 'pull_request'"
49-
continue-on-error: "${{ matrix.name == 'mingw-check-tidy' }}"
50-
strategy:
51-
matrix:
52-
include:
53-
- name: mingw-check
54-
os: ubuntu-20.04-4core-16gb
55-
env: {}
56-
- name: mingw-check-tidy
57-
os: ubuntu-20.04-4core-16gb
58-
env: {}
59-
- name: x86_64-gnu-llvm-15
60-
os: ubuntu-20.04-16core-64gb
61-
env: {}
62-
- name: x86_64-gnu-tools
63-
os: ubuntu-20.04-16core-64gb
64-
env: {}
65-
timeout-minutes: 600
66-
runs-on: "${{ matrix.os }}"
67-
steps:
68-
- name: disable git crlf conversion
69-
run: git config --global core.autocrlf false
70-
- name: checkout the source code
71-
uses: actions/checkout@v4
72-
with:
73-
fetch-depth: 2
74-
- name: configure the PR in which the error message will be posted
75-
run: "echo \"[CI_PR_NUMBER=$num]\""
76-
env:
77-
num: "${{ github.event.number }}"
78-
if: "success() && !env.SKIP_JOB && github.event_name == 'pull_request'"
79-
- name: add extra environment variables
80-
run: src/ci/scripts/setup-environment.sh
81-
env:
82-
EXTRA_VARIABLES: "${{ toJson(matrix.env) }}"
83-
if: success() && !env.SKIP_JOB
84-
- name: decide whether to skip this job
85-
run: src/ci/scripts/should-skip-this.sh
86-
if: success() && !env.SKIP_JOB
87-
- name: ensure the channel matches the target branch
88-
run: src/ci/scripts/verify-channel.sh
89-
if: success() && !env.SKIP_JOB
90-
- name: collect CPU statistics
91-
run: src/ci/scripts/collect-cpu-stats.sh
92-
if: success() && !env.SKIP_JOB
93-
- name: show the current environment
94-
run: src/ci/scripts/dump-environment.sh
95-
if: success() && !env.SKIP_JOB
96-
- name: install sccache
97-
run: src/ci/scripts/install-sccache.sh
98-
if: success() && !env.SKIP_JOB
99-
- name: select Xcode
100-
run: src/ci/scripts/select-xcode.sh
101-
if: success() && !env.SKIP_JOB
102-
- name: install clang
103-
run: src/ci/scripts/install-clang.sh
104-
if: success() && !env.SKIP_JOB
105-
- name: install WIX
106-
run: src/ci/scripts/install-wix.sh
107-
if: success() && !env.SKIP_JOB
108-
- name: disable git crlf conversion
109-
run: src/ci/scripts/disable-git-crlf-conversion.sh
110-
if: success() && !env.SKIP_JOB
111-
- name: checkout submodules
112-
run: src/ci/scripts/checkout-submodules.sh
113-
if: success() && !env.SKIP_JOB
114-
- name: install MSYS2
115-
run: src/ci/scripts/install-msys2.sh
116-
if: success() && !env.SKIP_JOB
117-
- name: install MinGW
118-
run: src/ci/scripts/install-mingw.sh
119-
if: success() && !env.SKIP_JOB
120-
- name: install ninja
121-
run: src/ci/scripts/install-ninja.sh
122-
if: success() && !env.SKIP_JOB
123-
- name: enable ipv6 on Docker
124-
run: src/ci/scripts/enable-docker-ipv6.sh
125-
if: success() && !env.SKIP_JOB
126-
- name: disable git crlf conversion
127-
run: src/ci/scripts/disable-git-crlf-conversion.sh
128-
if: success() && !env.SKIP_JOB
129-
- name: ensure line endings are correct
130-
run: src/ci/scripts/verify-line-endings.sh
131-
if: success() && !env.SKIP_JOB
132-
- name: ensure backported commits are in upstream branches
133-
run: src/ci/scripts/verify-backported-commits.sh
134-
if: success() && !env.SKIP_JOB
135-
- name: ensure the stable version number is correct
136-
run: src/ci/scripts/verify-stable-version-number.sh
137-
if: success() && !env.SKIP_JOB
138-
- name: run the build
139-
run: src/ci/scripts/run-build-from-ci.sh
140-
env:
141-
AWS_ACCESS_KEY_ID: "${{ env.CACHES_AWS_ACCESS_KEY_ID }}"
142-
AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}"
143-
TOOLSTATE_REPO_ACCESS_TOKEN: "${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}"
144-
if: success() && !env.SKIP_JOB
145-
- name: create github artifacts
146-
run: src/ci/scripts/create-doc-artifacts.sh
147-
if: success() && !env.SKIP_JOB
148-
- name: upload artifacts to github
149-
uses: actions/upload-artifact@v3
150-
with:
151-
name: "${{ env.DOC_ARTIFACT_NAME }}"
152-
path: obj/artifacts/doc
153-
if-no-files-found: ignore
154-
retention-days: 5
155-
if: success() && !env.SKIP_JOB
156-
- name: upload artifacts to S3
157-
run: src/ci/scripts/upload-artifacts.sh
158-
env:
159-
AWS_ACCESS_KEY_ID: "${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}"
160-
AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}"
161-
if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')"
16238
auto:
16339
name: "auto - ${{ matrix.name }}"
16440
env:
@@ -345,8 +221,8 @@ jobs:
345221
os: macos-13
346222
- name: dist-aarch64-apple
347223
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"
224+
SCRIPT: "./x.py dist bootstrap --include-default-paths --host=aarch64-apple-darwin --target=aarch64-apple-darwin"
225+
RUST_CONFIGURE_ARGS: "--enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false --set rust.lto=thin"
350226
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
351227
SELECT_XCODE: /Applications/Xcode_13.4.1.app
352228
USE_XCODE_CLANG: 1
@@ -356,8 +232,7 @@ jobs:
356232
NO_DEBUG_ASSERTIONS: 1
357233
NO_OVERFLOW_CHECKS: 1
358234
DIST_REQUIRE_ALL_TOOLS: 1
359-
JEMALLOC_SYS_WITH_LG_PAGE: 14
360-
os: macos-13
235+
os: macos-13-xlarge
361236
- name: x86_64-msvc
362237
env:
363238
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --enable-profiler"
@@ -458,6 +333,9 @@ jobs:
458333
- name: show the current environment
459334
run: src/ci/scripts/dump-environment.sh
460335
if: success() && !env.SKIP_JOB
336+
- name: install awscli
337+
run: src/ci/scripts/install-awscli.sh
338+
if: success() && !env.SKIP_JOB
461339
- name: install sccache
462340
run: src/ci/scripts/install-sccache.sh
463341
if: success() && !env.SKIP_JOB
@@ -544,9 +422,20 @@ jobs:
544422
strategy:
545423
matrix:
546424
include:
547-
- name: dist-x86_64-linux
548-
os: ubuntu-20.04-16core-64gb
549-
env: {}
425+
- name: dist-aarch64-apple
426+
env:
427+
SCRIPT: "./x.py dist bootstrap --include-default-paths --host=aarch64-apple-darwin --target=aarch64-apple-darwin"
428+
RUST_CONFIGURE_ARGS: "--enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false --set rust.lto=thin"
429+
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
430+
SELECT_XCODE: /Applications/Xcode_13.4.1.app
431+
USE_XCODE_CLANG: 1
432+
MACOSX_DEPLOYMENT_TARGET: 11.0
433+
MACOSX_STD_DEPLOYMENT_TARGET: 11.0
434+
NO_LLVM_ASSERTIONS: 1
435+
NO_DEBUG_ASSERTIONS: 1
436+
NO_OVERFLOW_CHECKS: 1
437+
DIST_REQUIRE_ALL_TOOLS: 1
438+
os: macos-13-xlarge
550439
timeout-minutes: 600
551440
runs-on: "${{ matrix.os }}"
552441
steps:
@@ -578,6 +467,9 @@ jobs:
578467
- name: show the current environment
579468
run: src/ci/scripts/dump-environment.sh
580469
if: success() && !env.SKIP_JOB
470+
- name: install awscli
471+
run: src/ci/scripts/install-awscli.sh
472+
if: success() && !env.SKIP_JOB
581473
- name: install sccache
582474
run: src/ci/scripts/install-sccache.sh
583475
if: success() && !env.SKIP_JOB

src/ci/github-actions/ci.yml

+36-40
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
@@ -305,28 +313,28 @@ concurrency:
305313
cancel-in-progress: true
306314

307315
jobs:
308-
pr:
309-
<<: *base-ci-job
310-
name: PR - ${{ matrix.name }}
311-
env:
312-
<<: [*shared-ci-variables, *public-variables]
313-
PR_CI_JOB: 1
314-
if: github.event_name == 'pull_request'
315-
continue-on-error: ${{ matrix.name == 'mingw-check-tidy' }}
316-
strategy:
317-
matrix:
318-
include:
319-
- name: mingw-check
320-
<<: *job-linux-4c
321-
322-
- name: mingw-check-tidy
323-
<<: *job-linux-4c
324-
325-
- name: x86_64-gnu-llvm-15
326-
<<: *job-linux-16c
327-
328-
- name: x86_64-gnu-tools
329-
<<: *job-linux-16c
316+
# pr:
317+
# <<: *base-ci-job
318+
# name: PR - ${{ matrix.name }}
319+
# env:
320+
# <<: [*shared-ci-variables, *public-variables]
321+
# PR_CI_JOB: 1
322+
# if: github.event_name == 'pull_request'
323+
# continue-on-error: ${{ matrix.name == 'mingw-check-tidy' }}
324+
# strategy:
325+
# matrix:
326+
# include:
327+
# - name: mingw-check
328+
# <<: *job-linux-4c
329+
330+
# - name: mingw-check-tidy
331+
# <<: *job-linux-4c
332+
333+
# - name: x86_64-gnu-llvm-15
334+
# <<: *job-linux-16c
335+
336+
# - name: x86_64-gnu-tools
337+
# <<: *job-linux-16c
330338

331339
auto:
332340
<<: *base-ci-job
@@ -521,19 +529,17 @@ jobs:
521529
<<: *job-macos-xl
522530

523531
# This target only needs to support 11.0 and up as nothing else supports the hardware
524-
- name: dist-aarch64-apple
532+
- &dist-aarch64-apple
533+
name: dist-aarch64-apple
525534
env:
526-
SCRIPT: ./x.py dist bootstrap --include-default-paths --stage 2
535+
SCRIPT: ./x.py dist bootstrap --include-default-paths --host=aarch64-apple-darwin --target=aarch64-apple-darwin
527536
RUST_CONFIGURE_ARGS: >-
528-
--build=x86_64-apple-darwin
529-
--host=aarch64-apple-darwin
530-
--target=aarch64-apple-darwin
531537
--enable-full-tools
532538
--enable-sanitizers
533539
--enable-profiler
534-
--disable-docs
535540
--set rust.jemalloc
536541
--set llvm.ninja=false
542+
--set rust.lto=thin
537543
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
538544
SELECT_XCODE: /Applications/Xcode_13.4.1.app
539545
USE_XCODE_CLANG: 1
@@ -543,15 +549,7 @@ jobs:
543549
NO_DEBUG_ASSERTIONS: 1
544550
NO_OVERFLOW_CHECKS: 1
545551
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
552+
<<: *job-macos-m1
555553

556554
######################
557555
# Windows Builders #
@@ -693,9 +691,7 @@ jobs:
693691
strategy:
694692
matrix:
695693
include:
696-
- &dist-x86_64-linux
697-
name: dist-x86_64-linux
698-
<<: *job-linux-16c
694+
- <<: *dist-aarch64-apple
699695

700696
master:
701697
name: master

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)