You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you are on a Mac and you run (say) GOOS=linux GOARCH=ppc64 go install cmd/go, it needs somewhere to write the binary, and $GOROOT/bin/go has the Mac copy of the go command, so it uses $GOROOT/bin/linux_ppc64/go. So far so good.
But if $GOBIN is set, it uses $GOBIN/linux_ppc64/go. Since $GOBIN is not under Go's control (not part of $GOROOT's conventions) we should not be creating subdirectories. The install command should report an error instead.
Closing this bug means completely killing go install support for cross compilation. I can now probably simulate the previous go install cleverness by using Makefile and go build -o, but it's a sad moment that Makefile is now required where previously go install was everything that was needed.
Can this issue please be revisited. I really liked the way this worked before, native binaries to $GOPATH/bin, cross-compiled to $GOPATH/bin/$GOOS_$GOARCH, it was a great FEATURE!
@zcalusic that is a feature, but this issue is about not creating subdirectories when the GOBIN environment variable is set. You seem to be describing the case when GOBIN is not set. If that is not working, that is a bug. I see you've opened #11778 for that.
If you are on a Mac and you run (say) GOOS=linux GOARCH=ppc64 go install cmd/go, it needs somewhere to write the binary, and $GOROOT/bin/go has the Mac copy of the go command, so it uses $GOROOT/bin/linux_ppc64/go. So far so good.
But if $GOBIN is set, it uses $GOBIN/linux_ppc64/go. Since $GOBIN is not under Go's control (not part of $GOROOT's conventions) we should not be creating subdirectories. The install command should report an error instead.
@robpike just ran into this with GOARCH=386 set.
The text was updated successfully, but these errors were encountered: