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

x/build/cmd/release: darwin/arm64 installer prompts for installing Rosetta 2 #43422

Closed
usmannajib opened this issue Dec 29, 2020 · 10 comments
Closed
Labels
arch-arm64 Builders x/build issues (builders, bots, dashboards) FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. OS-Darwin
Milestone

Comments

@usmannajib
Copy link

What version of Go are you using (go version)?

1.16beta1

$ go version

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

MacOS Big Sur on arm64 M1

go env Output
$ go env

What did you do?

Ran installation

What did you expect to see?

The installer should have installed Go in native M1 mode.

What did you see instead?

The installer asked for Rosetta to be installed as a mandatory install dependency.

@cherrymui
Copy link
Member

Just to be sure, is https://golang.org/dl/go1.16beta1.darwin-arm64.pkg the installer you used?

cc @dmitshur

@usmannajib
Copy link
Author

Yes take a look at the screenshot below
image

@dmitshur
Copy link
Contributor

dmitshur commented Dec 29, 2020

Thanks for reporting. Perhaps there's some configuration in the installer causing macOS to think Rosetta will be needed, when that shouldn't be the case. We'll take a look.

After installing, does go version output end with "darwin/arm64"?
Also, what macOS version did you test with?

@dmitshur dmitshur changed the title Installation asks for installing Rosetta 2 x/build/cmd/release: darwin/arm64 installer prompts for installing Rosetta 2 Dec 29, 2020
@gopherbot gopherbot added the Builders x/build issues (builders, bots, dashboards) label Dec 29, 2020
@dmitshur dmitshur added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. and removed Builders x/build issues (builders, bots, dashboards) labels Dec 29, 2020
@gopherbot gopherbot added this to the Unreleased milestone Dec 29, 2020
@dmitshur dmitshur modified the milestones: Unreleased, Go1.16 Dec 29, 2020
@dmitshur dmitshur added arch-arm64 OS-Darwin Builders x/build issues (builders, bots, dashboards) labels Dec 29, 2020
@dmitshur
Copy link
Contributor

The problem may be that we're not including a hostArchitectures property in the installer Distribution options:

$ pkgutil --expand go1.16beta1.darwin-arm64.pkg out
$ cat out/Distribution | grep options
    <options customize="never" allow-external-scripts="no"/>

It likely needs to be set to a value that includes arm64:

<options hostArchitectures="arm64" customize="never" allow-external-scripts="no"/>

CC @golang/release, @markmentovai.

@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Dec 29, 2020
@dmitshur dmitshur self-assigned this Dec 29, 2020
@usmannajib
Copy link
Author

I actually didn't install it as I wanted a "pure" experience 😄

I am testing with 11.1

Let me know if it helps to actually install it.

@dmitshur
Copy link
Contributor

Thanks.

We should fix this in time for the next pre-release of Go 1.16. If you'd like, you can wait until then, but you certainly don't have to. This issue affects only the installer, the actual Go distribution is already built for ARM64. You can also use the go1.16beta1.darwin-arm64.tar.gz archive to avoid having to install Rosetta 2.

@usmannajib
Copy link
Author

@dmitshur Thank you

@dmitshur dmitshur added this to In Progress in Go Release Team Feb 2, 2021
@dmitshur
Copy link
Contributor

dmitshur commented Feb 5, 2021

I tested the change described in #43422 (comment) by making use of pkgutil --expand and pkgutil --flatten to adjust the distribution XML:

$ pkgutil --expand go1.16rc1.darwin-arm64.pkg out
$ $EDITOR out/Distribution  # set hostArchitectures="arm64" in options
$ pkgutil --flatten out go1.16rc1.darwin-arm64-edited.pkg

(This process strips the signing, but that's not a problem for the purpose of testing the change described here.)

I tested this on a Mac without Rosetta 2 installed (thanks @cagedmantis). Prior to explicitly setting hostArchitectures, Rosetta 2 was required and the installer would not proceed without it. After setting it, Go was successfully installed without Rosetta 2.

It also had the added benefit of reporting "Go can't be installed on this computer." if the ARM64 installer is opened on an Intel-based Mac (previously, the ARM64 installer would run without letting the user know it's the wrong architecture, but then the installed distribution wouldn't work because Intel-based Macs can't run arm64 binaries).

We've updated our release process to apply this change, so the next Go 1.16 release will have this fix. Thanks again for the report. Closing.

@dmitshur dmitshur closed this as completed Feb 5, 2021
Go Release Team automation moved this from In Progress to Done Feb 5, 2021
@ifacodes
Copy link

ifacodes commented Sep 9, 2021

Hi. this still happens to me on my M1 Mac with version 1.17.

@dmitshur
Copy link
Contributor

dmitshur commented Sep 9, 2021

@ifamakes I've checked the Distribution file in go1.17.darwin-arm64.pkg, and it still has hostArchitectures="arm64" set, so that hasn't regressed on our side.

Since this issue has been closed for a good while, I think we should treat this as a possible new problem. Can you please file a new issue that references this one, and provide more information, such as what macOS version you've tested with. Thank you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-arm64 Builders x/build issues (builders, bots, dashboards) FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. OS-Darwin
Projects
Archived in project
Development

No branches or pull requests

5 participants