Runner: Add ARM + MacOS target to be able to use on self-hosted runners

Created on 12 Nov 2020  路  7Comments  路  Source: actions/runner

Describe the enhancement
A new architecture+OS build target to enable adding runners on the new Apple Silicon (ARM) Macs.

Additional information
This would be useful both for GitHub-hosted and self-hosted runners. I have no idea how much work would be necessary :)

enhancement

Most helpful comment

Made forward progress here. We are able to boot the runner using intel emulation, and then escape the emulation when our CI script calls xcodebuild using:

arch -arm64 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild ...

The big win came from realizing that arch can be used to escape emulation, though it's not documented.

Detailed writeup here: https://gregmfoster.medium.com/using-m1-mac-minis-to-power-our-github-actions-ios-ci-540c55af13ea

All 7 comments

(seems like https://github.com/dotnet/core/issues/4879 is entailed, though)

for now you can run it with arch -x86_64 at the beginning of the commands

for example

arch -x86_64 ./config.sh ...
arch -x86_64 ./run.sh

the arch did not help us:

arch -x86_64  ./config.sh --url https://github.com/sparta-science --token <GENERATED-TOKEN>
arch: posix_spawnp: ./config.sh: Bad CPU type in executable

we are using preview version of the new Mac mini:

uname -v
Darwin Kernel Version 20.1.0: Sat Oct 31 00:07:18 PDT 2020; root:xnu-7195.50.7~2/RELEASE_ARM64_T8020

@paulz do you have Rosetta 2 installed? It's working for us on Homebrew.

At my company, we use mac mini's + github actions to trigger xcodebuild in order to run XCUITests. By starting the github action runner, we find that all subprocesses also boot in Rosetta, causing the xcodebuild to create x86 artifacts. The mac mini is then unable to run the XCUITest because it only supports arm iOS simulators.

When we boot xcode without rosetta by hand, the tests run fine. We'd really appreciate it if Github added support for ARM + MacOS target.

cc @tomasreimers

Made forward progress here. We are able to boot the runner using intel emulation, and then escape the emulation when our CI script calls xcodebuild using:

arch -arm64 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild ...

The big win came from realizing that arch can be used to escape emulation, though it's not documented.

Detailed writeup here: https://gregmfoster.medium.com/using-m1-mac-minis-to-power-our-github-actions-ios-ci-540c55af13ea

Just an addendum to @gregorymfoster's post. You can find out which architecture you are running on your mac with uname -m. This will output arm64 for AS and x86_64 for Intel. I suspect that you can just run all the bash commands from within the runner prefixed with arch -$(uname -m) my_command and this code will execute for the appropriate platform.

Maybe this can act as a substitute until the team provides an arm64 compiled version for the M1?

EDIT: just realised that if you call uname -m from within Rosetta 2 it will output x86_64 馃槅

Was this page helpful?
0 / 5 - 0 ratings