Closed spenczar closed 5 years ago
cc @bcmills @rsc @myitcv
Confirmed.
export GOPATH=$(mktemp -d)
cd $(mktemp -d)
mkdir hello
cd hello
go mod init example.com/hello/v6
cat <<EOD > main.go
package main
func main() {}
EOD
go build .
Now:
$ ls
go.mod main.go v6
But:
$ go install
$ ls $GOPATH/bin
hello
go install
was fixed in https://github.com/golang/go/issues/24667; sounds like a similar fix needed for go build
.
Change https://golang.org/cl/140863 mentions this issue: cmd/go: fix the default build output name for versioned binaries
If this does not land before RC1 (in the next couple of days), open a backport issue if it should be cherry-picked into 1.12.
/cc @hyangah
Change https://golang.org/cl/157798 mentions this issue: cmd/go: fix the default build output name for versioned binaries
Modules with name 'example.com/mymodule.git' ,where the .git extension is used to trigger the local VCS command, get a binary named mymodule.git.exe. Shouldn't '.git' be stripped?
If this does not land before RC1 (in the next couple of days), open a backport issue if it should be cherry-picked into 1.12.
/cc @hyangah
Looks like it didn't make 1.12. I don't know how a backport issue is started, but if this could be cherry-picked into 1.12 I'd be very happy.
@gopherbot please backport to 1.12
Backport issue(s) opened: #30266 (for 1.12).
Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases.
Are we trying to get https://golang.org/cl/140863 into 1.12? @hyangah @bcmills
@ianlancetaylor from the "backport" wording earlier, I presume 1.12.1 was meant.
@mvdan is correct: we're targeting 1.12.1.
Change https://golang.org/cl/167384 mentions this issue: [release-branch.go1.12] cmd/go: fix the default build output name for versioned binaries
Change https://golang.org/cl/167617 mentions this issue: Revert "[release-branch.go1.12] cmd/go: fix the default build output name for versioned binaries"
Change https://golang.org/cl/167503 mentions this issue: cmd/go: fix the default build output name for versioned binaries
Change https://golang.org/cl/168958 mentions this issue: [release-branch.go1.12] cmd/go: fix the default build output name for versioned binaries
What version of Go are you using (
go version
)?go1.11
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?darwin amd64
What did you do?
In a
package main
's directory (specifically, github.com/twitchtv/twirp/protoc-gen-twirp), I had ago.mod
like this:module github.com/twitchtv/twirp/protoc-gen-twirp/v5
I then ran
GO111MODULE=on go build .
from within $GOPATH/src/github.com/twitchtv/twirp/protoc-gen-twirp.I expected an executable named
protoc-gen-twirp
, because that is the last element of the directory. This is the documented behavior in https://tip.golang.org/cmd/go/#hdr-Compile_packages_and_dependencies:Instead, an executable was produced named
v5
.However, if I invoke
go build
with a full path, I get the expected name.GO111MODULE=on go build github.com/twitchtv/twirp/protoc-gen-twirp
produces an executable namedprotoc-gen-twirp
.This is either a documentation error, or a bug.