golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
124.34k stars 17.7k forks source link

x/build/internal/installer/darwinpkg: make the darwin/amd64 installer warn the user or fail when running on arm64 #59010

Open cespare opened 1 year ago

cespare commented 1 year ago

The download website makes it easy for all macOS users, even the ones running on Apple Silicon, to download the amd64 package. This is #52487.

As described in https://github.com/golang/go/issues/52487#issuecomment-1466854907, this mostly works, and users can go on quite a while not realizing that they're running the Go toolchain under emulation (and producing amd64 binaries which are also running under emulation). The problems that eventually arise can be very subtle.

Besides fixing the website download links, we should consider making the amd64 installer refuse to run on arm64 chips or at least warn the user that they are not installing the correct package for their architecture.

cespare commented 1 year ago

This is tangentially related to #58235.

Also cc @golang/release and @dmitshur.

hyangah commented 1 year ago

Another idea is whether the installer carries only a bootstrap part (either universal, or a binary running on rosetta, or a bash script) and during install, it downloads the right versions. For extended forward compatibility support (https://github.com/golang/go/issues/57001) I think there will be compact versions of core toolings and standard libraries. I wonder if they can be utilized.