-
Notifications
You must be signed in to change notification settings - Fork 303
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
Conversation
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.
Confirmed that this updated install script behaves correctly on an Apple Silicon Mac, and that the |
There was a problem hiding this 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) 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌🏼
There was a problem hiding this 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.
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.
Upcoming macOS computers will use the
arm64
architecture. On such machines, our install script will currently fall through to attempting to fetch adarwin-arm
binary, which does not exist. This future version of macOS allowsarm64
Macs to runamd64
binaries through an emulation layer called Rosetta 2, and thusdarwin-amd64
is the most appropriate binary type for these machines until golang supports nativedarwin-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.