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

cmd/dist: builds amd64 toolchain on macOS arm64 system #50643

Closed
rsc opened this issue Jan 16, 2022 · 1 comment
Closed

cmd/dist: builds amd64 toolchain on macOS arm64 system #50643

rsc opened this issue Jan 16, 2022 · 1 comment
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Jan 16, 2022

p1% env|grep GO
GOPATH=/Users/rsc
GOROOT=/Users/rsc/go
p1% ./make.bash
Building Go cmd/dist using /Users/rsc/sdk/go1.17. (go1.17 darwin/arm64) <<<<
Building Go toolchain1 using /Users/rsc/sdk/go1.17.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
Building Go toolchain3 using go_bootstrap and Go toolchain2.
Building packages and commands for darwin/amd64.  <<<<
---
Installed Go for darwin/amd64 in /Users/rsc/go.
Installed commands in /Users/rsc/go/bin
p1% 

Note the two marked lines: the bootstrap toolchain is ARM64 but somehow cmd/dist has reverted to x86-64.
I know this is caused by running under some x86 process, like my shell or terminal or whatever.
It doesn't matter: this is incredibly confusing and we should stop it if we can. And we can.
I will send a CL.

@rsc rsc self-assigned this Jan 16, 2022
@rsc rsc added NeedsFix The path to resolution is known, but the work has not been done. release-blocker labels Jan 16, 2022
@rsc rsc added this to the Go1.18 milestone Jan 16, 2022
@gopherbot
Copy link

Change https://golang.org/cl/378894 mentions this issue: cmd/dist: avoid lapsing into x86 builds on ARM64 Macs

jproberts pushed a commit to jproberts/go that referenced this issue Jun 21, 2022
We use uname -m to decide the GOHOSTARCH default,
and on my ARM64 Mac laptop, uname -m prints x86_64.

uname -a prints:

Darwin p1.local 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:01 PDT 2021; root:xnu-8019.41.5~1/RELEASE_ARM64_T6000 x86_64

(Note the x86_64 at the end, consistent with uname -m.)

The effect of this is that make.bash builds an x86 toolchain
even when I start with an ARM64 bootstrap toolchain!
Avoid being tricked by looking for RELEASE_ARM64 instead.

Fixes golang#50643.

Change-Id: I76eded84bde8009d29419d5982bf964a0bf1c8fd
Reviewed-on: https://go-review.googlesource.com/c/go/+/378894
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
@rsc rsc removed their assignment Jun 22, 2022
@golang golang locked and limited conversation to collaborators Jun 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

2 participants