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: macOS PKG installer shows misleading error when installing for the wrong architecture #58235

Open
rothskeller opened this issue Feb 2, 2023 · 2 comments
Assignees
Labels
Builders x/build issues (builders, bots, dashboards) NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@rothskeller
Copy link

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

$ go version
go version go1.20 darwin/amd64

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/stever/Library/Caches/go-build"
GOENV="/Users/stever/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/stever/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/stever/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.20"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/3y/936sl4d50dd_38rvrs041qn80000gn/T/go-build2823487662=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Accidentally attempted to install the go1.20 installer for ARM64 rather than x86.64.

What did you expect to see?

An error message that I have the wrong installer.

What did you see instead?

An error message saying "Go cannot be installed on this computer." This is an inaccurate message; Go can be installed on this computer — it just needs a different installer.

@mknyszek mknyszek added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 2, 2023
@mknyszek mknyszek added this to the Backlog milestone Feb 2, 2023
@mknyszek mknyszek changed the title MacOS installer: bad error message for wrong architecture x/build: macOS PKG installer shows misleading error when installing for the wrong architecture Feb 2, 2023
@gopherbot gopherbot added the Builders x/build issues (builders, bots, dashboards) label Feb 2, 2023
@mknyszek
Copy link
Contributor

mknyszek commented Feb 2, 2023

CC @golang/release

@dmitshur
Copy link
Contributor

dmitshur commented Feb 28, 2023

Thanks for reporting.

We're using Xcode tooling to create a fairly standard macOS installer (see here). This has upsides like providing a familiar, native look and feel, and downsides in that we can only make customizations that are supported.

The "Go cannot be installed on this computer" text isn't coming from our installer directly, the installer automatically reports it based on which architecture(s) are configured to be supported by each installer. This is needed so that e.g. Rosetta isn't incorrectly required for arm64 installer (issue #43422). So the message is accurate, but doesn't take into account that Go provides macOS installers for both amd64 and arm64 architectures.

One idea is we may be able to adjust the text so that something like "Go (for darwin/arm64)" instead of just "Go" is shown. Maybe there's more customization that can be useful (e.g., there's already a custom check to report old macOS version). Otherwise we may need to rely the https://go.dev/dl/ website text to minimize the chance of users selecting a suboptimal installer for their needs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Builders x/build issues (builders, bots, dashboards) NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Status: Planned
Development

No branches or pull requests

4 participants