From 371972e76e4a9cf3b6b67e93b5139e64765d432a Mon Sep 17 00:00:00 2001 From: Christopher Serr Date: Thu, 31 Dec 2020 15:56:44 +0100 Subject: [PATCH 1/5] Add ARM macOS target to CI Rust 1.49 just released with support for the new macs that use ARM CPUs. Let's add this to our CI. --- .github/workflows/rust.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 12242ddf..aa5f2c60 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -83,6 +83,7 @@ jobs: # - Linux sparc64 # macOS + - macOS aarch64 - macOS x86_64 # iOS @@ -466,6 +467,11 @@ jobs: # tests: skip # macOS + - label: macOS aarch64 + toolchain: stable-aarch64-apple-darwin + os: macOS-latest + cross: skip + - label: macOS x86_64 target: x86_64-apple-darwin os: macOS-latest From c3dbcd014096a4c5227098e0b8266a3050bd1d8f Mon Sep 17 00:00:00 2001 From: Christopher Serr Date: Thu, 31 Dec 2020 16:06:23 +0100 Subject: [PATCH 2/5] Try target The toolchain obviously won't run on x86_64 macOS that GitHub Actions is running on. Let's try cross compiling instead. --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index aa5f2c60..7f85159f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -468,7 +468,7 @@ jobs: # macOS - label: macOS aarch64 - toolchain: stable-aarch64-apple-darwin + target: aarch64-apple-darwin os: macOS-latest cross: skip From d7aac8afbdae9d067e751ad36b4268c5dcdbc113 Mon Sep 17 00:00:00 2001 From: Christopher Serr Date: Thu, 31 Dec 2020 16:11:29 +0100 Subject: [PATCH 3/5] Install the target We need to install the target and since we cross compile without cross, we can't run any tests either. --- .github/workflows/rust.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 7f85159f..5f4b1a60 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -471,6 +471,8 @@ jobs: target: aarch64-apple-darwin os: macOS-latest cross: skip + tests: skip + install_target: true - label: macOS x86_64 target: x86_64-apple-darwin From 46a6b52e064ab039e0ee5ee8c5d66c3bb677d9ac Mon Sep 17 00:00:00 2001 From: Christopher Serr Date: Thu, 31 Dec 2020 16:23:18 +0100 Subject: [PATCH 4/5] latest doesn't mean latest Apparently when they mean latest, they don't actually mean that. --- .github/workflows/rust.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 5f4b1a60..8778a187 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -469,10 +469,13 @@ jobs: # macOS - label: macOS aarch64 target: aarch64-apple-darwin - os: macOS-latest + os: macOS-11.0 cross: skip tests: skip install_target: true + # FIXME: Switch OS back to latest once that means 11. + # FIXME: Switch OS to ARM macOS once GitHub Actions provides that, + # use the toolchain instead of the target and run the tests. - label: macOS x86_64 target: x86_64-apple-darwin From c009b1034e5244379aeee442fccf17bd2ec8b3f4 Mon Sep 17 00:00:00 2001 From: Christopher Serr Date: Wed, 17 Mar 2021 14:32:12 +0100 Subject: [PATCH 5/5] Use xcode-select instead Embark seems to use xcode-select on GitHub Actions to switch to a newer version of XCode instead of switching the macOS version itself: https://twitter.com/Ca1ne/status/1372120481147535363 --- .github/workflows/rust.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 8778a187..1de57feb 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -469,12 +469,11 @@ jobs: # macOS - label: macOS aarch64 target: aarch64-apple-darwin - os: macOS-11.0 + os: macOS-latest cross: skip tests: skip install_target: true - # FIXME: Switch OS back to latest once that means 11. - # FIXME: Switch OS to ARM macOS once GitHub Actions provides that, + # FIXME: Switch OS to ARM macOS once GitHub Actions provides that, # use the toolchain instead of the target and run the tests. - label: macOS x86_64 @@ -615,6 +614,13 @@ jobs: run: sh .github/workflows/install.sh env: OS_NAME: ${{ matrix.os }} + TARGET: ${{ matrix.target }} + + - name: Select XCode to use + if: matrix.target == 'aarch64-apple-darwin' + run: | + sudo xcode-select -s "/Applications/Xcode_12.3.app" + sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/* - name: Build Static Library run: sh .github/workflows/build_static.sh