-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Open
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.GoCommandcmd/gocmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Description
$ GOBIN=/tmp/release GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go1.20rc1 install golang.org/dl/go1.19.4@latest go: cannot install cross-compiled binaries when GOBIN is set
What version of Go are you using (go version)?
$ go version go version go1.19.4 darwin/amd64
What did you do?
Want to build a go tool for a different platform, but want the compiled binary to be in a directory different from my default installation directory.
What did you expect to see?
Successfully cross-compile the binary and have the result somewhere under GOBIN.
What did you see instead?
Error.
I believe the rejection of cross-compiled binary when GOBIN is set has a long history, that predates both Go modules and the recent major change in the meaning of go install <main_package_path>@<version> repurposed for clean tool installation. There were multiple related discussion topics (#13063 #14295 #9769) but all were closed as "FrozenDueToAge".
An alternative is to support -o flag for go install or go build <main_package>@<version> which is under discussion in a different context. #44469.
thockin, kaey, xuyang2, bcmills, ybelMekk and 29 more
Metadata
Metadata
Assignees
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.GoCommandcmd/gocmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.