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

Fetch amd64 binaries on Apple Silicon Macs #1237

Merged
merged 1 commit into from
Jul 9, 2020

Conversation

ticky
Copy link
Contributor

@ticky ticky commented Jul 7, 2020

Upcoming macOS computers will use the arm64 architecture. On such machines, our install script will currently fall through to attempting to fetch a darwin-arm binary, which does not exist. This future version of macOS allows arm64 Macs to run amd64 binaries through an emulation layer called Rosetta 2, and thus darwin-amd64 is the most appropriate binary type for these machines until golang supports native darwin-arm64 (see golang/go#38485).

This updates our install script to special-case the arm64 architecture when the platform is darwin, emit a message to the user, and proceed more or less as expected.

image

Upcoming macOS computers will use the arm64 architecture (see https://developer.apple.com/documentation/xcode/building_a_universal_macos_binary). On such machines, our install script will currently fall through to attempting to fetch a darwin-arm binary, which does not exist. This future version of macOS allows arm64 Macs to run amd64 binaries through an emulation layer called Rosetta 2, and thus darwin-amd64 is the most appropriate binary type for these machines until golang supports native darwin-arm64.

This updates our install script to special-case the arm64 architecture when the platform is darwin, emit a message to the user, and proceed more or less as expected.
@ticky ticky requested review from yob, sj26 and pda July 7, 2020 18:52
@ticky
Copy link
Contributor Author

ticky commented Jul 7, 2020

Confirmed that this updated install script behaves correctly on an Apple Silicon Mac, and that the buildkite-agent-darwin-amd64 binary runs (enough to emit usage, which seems like plenty in this case) 👍🏼

Copy link
Contributor

@yob yob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a Apple Silicon Mac to check this on, but the diff makes sense and we have independent confirmation in #1236 that the amd64 is working on the transition dev kit (via rosetta) 👍

Copy link
Member

@pda pda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌🏼

Copy link
Contributor

@plaindocs plaindocs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@ticky ticky merged commit d4dfbe9 into master Jul 9, 2020
@ticky ticky deleted the amd64-binary-on-darwin-arm64 branch July 9, 2020 16:46
ticky added a commit that referenced this pull request Sep 9, 2020
Following on from #1237, with new discoveries!

Turns out that in many cases, Apple Silicon Macs will in fact run Bash in amd64 mode, which in turn means the reported architecture is amd64, even though it's an Apple Silicon Mac. Homebrew has worked around this in Homebrew/brew#7995, and we more or less follow their lead here.

This makes it so that we _always_ show our little notice on Apple Silicon Macs, whether their shell is in amd64 or arm64 mode.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants