Go: x/build: add builder for macOS on Apple silicon

Created on 23 Jun 2020  路  16Comments  路  Source: golang/go

Apple has announced plans to transition their Mac platform to run on Apple silicon chips. A set of builders would be needed for the resulting port.

/cc @andybons @dmitshur @toothrot

Builders NeedsInvestigation OS-Darwin arch-arm64 new-builder release-blocker

Most helpful comment

Will be cool see native support M1 and what happen with Docker xD
M1 is out!

All 16 comments

38485 Tracks related changes to the runtime.

This issue corresponds to the following bullet points in https://golang.org/wiki/PortingPolicy#requirements-for-a-new-port:

  • A developer must be named (and agree) to maintain the builder, the machine trying each git revision and providing data for https://build.golang.org.

  • The builder must already be running (and failing, because the code is not yet in the main repository).

What about Universal Binaries?

Hey @eacp, broader support for the new architecture will be discussed on a separate issue. This issue is just about our build infrastructure. Thanks!

@toothrot Hey I have just received my DTK earlier today. Is there anything I can do to help the project with adoption of the architecture or help build prebuilt packages? I just installed the darwin-amd64 macOS package from golang.org and it took a bit to install but succeeded and go version is giving me this:

cj@cjs-Mac ~ % go version
go version go1.14.4 darwin/amd64

(I used to work for CircleCI and helped maintain the macOS infrastructure so I have a little bit of experience with this but I am entirely clueless as to what is required for Go)

@tzeejay Thanks for the offer to help! We're currently in the release freeze period for Go 1.15, so active work on this will likely wait until the tree re-opens in a bit over a month from now. Also follow issue #38485 for any port-specific updates. We'll reach out to you if we find a way you can contribute.

Based on what you said, it seems like the darwin/amd64 port is working via Rosetta 2, which is great to see.

To be honest I have not yet had the time to compile the projects that I am working on for work (neither Objective-C nor Go).

Overall the system feels exactly like presented in the keynote. I can't wait to have code running on this that was actually compiled for it.
I am too young to have gone through an architecture transition like this so I am not sure where to begin. Once there is headroom to tackle this problem I would be very much interested in helping though 馃憤

Little update for anybody interested.

  1. It does compile x86_64 code which can be executed through Rosetta 2 on the Mac itself. I develop our central server backend that way on my 16" MacBook Pro, and then deploy to Linux. Everything feels equivalent to a build on an Intel Mac.

  2. It successfully cross compiles to Linux x86_64.
    Granted I haven't added any crazy dependencies to it. It mostly depends on lib/pg and julienschmidt/httprouter.
    It is interesting to see though that this is possible at all with a regular release of Go from the website compiled for a foreign architecture.

Will be cool see native support M1 and what happen with Docker xD
M1 is out!

Come to think of it, we should probably have two builder configurations, at least in the short term: one running native GOARCH=arm64 binaries, and one running GOARCH=amd64 binaries under Rosetta 2 (to catch issues like #42700).

@bcmills No idea where your CI currently runs. I used to work at macstadium.com . They ordered 600 M1 based Mac minis. Let me know if I should establish a connection for these machines

Once we do have builders for this, we should make sure they have mingw-llvm installed and that its GCC compatibility wrapper is in PATH (see the comments on CL 271178).

(@aclements, was that last comment intended for #38607?)

@tzeejay Thanks. We do use MacStadium, as you can see at https://github.com/golang/build/tree/master/env/darwin/macstadium. @cagedmantis reached out to them on November 10, and we are now waiting for the new machines to become available.

Change https://golang.org/cl/278432 mentions this issue: dashboard: add new darwin-arm64-11_0-toothrot builder

Change https://golang.org/cl/278772 mentions this issue: dashboard: remove known issue for darwin arm builder

Was this page helpful?
0 / 5 - 0 ratings

Related issues

griesemer picture griesemer  路  808Comments

rsc picture rsc  路  242Comments

DemiMarie picture DemiMarie  路  320Comments

tklauser picture tklauser  路  219Comments

ianlancetaylor picture ianlancetaylor  路  138Comments