cmd/go: respect GOARCH setting with automatic toolchain downloads #66562
Labels
GoCommand
cmd/go
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Go version
go version go1.21.4 linux/amd64
Output of
go env
in your module/workspace:What did you do?
GOTOOLCHAIN=auto:
What did you see happen?
What did you expect to see?
Given that one is able to fetch and download a given release of Go for a given arch manually successfully:
GOARCH=arm64 go install 'golang.org/dl/go1.21.8@latest'; <path>/go/bin/linux_arm64/go1.21.8
I would assume that by instrumenting Go with
GOARCH=<arch> GOTOOLCHAIN=auto
with e.g.go mod download
Go would also fetch a toolchain of the desired version for the desired architecture, but instead a native toolchain of the desired version is always downloaded instead, naturally failing the build on the other arch. Now, aside from Go being able to cross-compile for many platform/arch pairs out-of-the box already I'm wondering if you could consider this use case as well (have a single node to prefetch artifacts for the rest of the nodes in a multi-arch node setup) or there's some major technical blocker rendering this as a complete non-issue not worth addressing.The text was updated successfully, but these errors were encountered: