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/go: do not create subdirs of $GOBIN #9769

Closed
rsc opened this issue Feb 3, 2015 · 4 comments
Closed

cmd/go: do not create subdirs of $GOBIN #9769

rsc opened this issue Feb 3, 2015 · 4 comments
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Feb 3, 2015

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.

@rsc rsc added this to the Go1.5 milestone Feb 3, 2015
@minux
Copy link
Member

minux commented Feb 5, 2015

A slightly related problem is that we don't append installsuffix to bin/$GOOS_$GOARCH directory name. See #9737.

@gopherbot
Copy link

CL https://golang.org/cl/12080 mentions this issue.

@zcalusic
Copy link

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!

@ianlancetaylor
Copy link
Contributor

@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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants