-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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/go: locating GOROOT fails when the go
command is run from the cross-compiled bin
subdirectory
#62119
Comments
CC @bcmills, @golang/release. |
go
command is run from the cross-compiled bin
subdirectory
The cross-compiling configuration seems to be the key here. I can reproduce the failure mode by running
|
Is this a legitimate issue or something I need to fix on my end; and if it's the latter, what's the proper way to handle a cross compile? |
It's a bug in |
Thanks! If we can help troubleshoot in any way, please let me know. Our infrastructure and my mac both run Intel/AMD but one of my colleagues (cc: @waterfoul) has an M2 mac, so we have the ability to test on either architecture without affecting anything. |
Change https://go.dev/cl/521015 mentions this issue: |
@gopherbot, please backport to Go 1.21. This interacts badly with the change to build cmd/go with |
Backport issue(s) opened: #62144 (for 1.21). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases. |
@tspearconquest, this should be fixed by https://go.dev/cl/521015 when that is merged. In the meantime, you could potentially work around it by deleting the |
Just got bit by this using a # in WSL
cd $GOROOT; GOOS=windows GOARCH=amd64 ./src/make.bash Then VS Code on Windows:
I've deleted |
Change https://go.dev/cl/521695 mentions this issue: |
…GOOS_GOARCH When running make.bash in a cross-compiled configuration (for example, GOARCH different from GOHOSTARCH), cmd/go is installed to GOROOT/bin/GOOS_GOARCH instead of GOROOT/bin. That means that we need to look for GOROOT in both ../.. and ../../.., not just the former. Fixes golang#62119. Updates golang#18678. Change-Id: I283c6a10c46df573ff44da826f870417359226a7 Reviewed-on: https://go-review.googlesource.com/c/go/+/521015 Reviewed-by: Michael Matloob <[email protected]> Auto-Submit: Bryan Mills <[email protected]> Run-TryBot: Bryan Mills <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
…installed to GOROOT/bin/GOOS_GOARCH When running make.bash in a cross-compiled configuration (for example, GOARCH different from GOHOSTARCH), cmd/go is installed to GOROOT/bin/GOOS_GOARCH instead of GOROOT/bin. That means that we need to look for GOROOT in both ../.. and ../../.., not just the former. Fixes #62144. Updates #62119. Updates #18678. Change-Id: I283c6a10c46df573ff44da826f870417359226a7 Reviewed-on: https://go-review.googlesource.com/c/go/+/521015 Reviewed-by: Michael Matloob <[email protected]> Auto-Submit: Bryan Mills <[email protected]> Run-TryBot: Bryan Mills <[email protected]> TryBot-Result: Gopher Robot <[email protected]> (cherry picked from commit 9e9556d) Reviewed-on: https://go-review.googlesource.com/c/go/+/521695 Auto-Submit: Dmitri Shuralyov <[email protected]>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I'm trying to build an internal golang image based originally on the docker-library dockerfile for golang 1.20, but customized in the following ways:
The full dockerfile with some redaction of internal repo paths:
What did you expect to see?
go version
output the versionWhat did you see instead?
The same error as in #61921
The text was updated successfully, but these errors were encountered: