go: cmd/go: "v1.x.y is not a tag" when .gitconfig sets `log.decorate` to `full`
What version of Go are you using (go version
)?
$ go version go version go1.16.14 darwin/amd64
Does this issue reproduce with the latest release?
yes
Not Reproduced:
go1.14.15, go1.15.15, go1.18beta2
go1.16.13, go1.17.6
Reproduced: go1.16.14, go1.17.7, go1.18rc1
What operating system and processor architecture are you using (go env
)?
go env
Output
$ go env GO111MODULE="on" GOARCH="amd64" GOBIN="/Users/work/go/bin" GOCACHE="/Users/work/Library/Caches/go-build" GOENV="/Users/work/Library/Application Support/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOINSECURE="" GOMODCACHE="/Users/work/go/pkg/mod" GONOPROXY="*mydomain.com*" GONOSUMDB="*" GOOS="darwin" GOPATH="/Users/work/go" GOPRIVATE="" GOPROXY="https://goproxy.cn,direct" GOROOT="/Users/work/sdk/go1.16.14" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/Users/work/sdk/go1.16.14/pkg/tool/darwin_amd64" GOVCS="" GOVERSION="go1.16.14" GCCGO="gccgo" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="/Users/work/workspace/myapp/go.mod" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/72/byjy11cs0dj_z3rjtxnj_nn00000gn/T/go-build1154361502=/tmp/go-build -gno-record-gcc-switches -fno-common"
What did you do?
- repo
mydomain.com/a/bnet
has tagv1.23.13
. - repo
mydomain.com/a/bnet
download direct:GONOPROXY="*mydomain.com*"
- repo
mydomain.com/myapp
requiremydomain.com/a/bnet@v1.23.13
- clean mod cache:
go clean -modcache
- cd
mydomain.com/myapp
- exec
go version
,output:go version go1.16.14 darwin/amd64
- exec
go mod download
has error:
go mod download: mydomain.com/a/bnet@v1.23.13: invalid version: resolves to version v1.23.15-0.20220221055748-c5a5cd77b294 (v1.23.13 is not a tag)
- with go1.16.13, exec
go1.16.13 mod download
,there is no error, download success - retry with go1.16.14 ,exec
go1.16.14 mod download
again, success
there was no useful error message, when exec go mod doanload -x
What did you expect to see?
What did you see instead?
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 38 (31 by maintainers)
Commits related to this issue
- cmd/go/internal/modfetch: simplify handling of weird version tags This fixes an obscure bug in 'go list -versions' if the repo contains a tag with an explicit "+incompatible" suffix. However, I've ne... — committed to golang/go by bcmills 2 years ago
- [release-branch.go1.17] cmd/go: pass --no-decorate when listing git tags for a commit This avoids a parse error when the user's global .gitconfig sets log.decorate to true. Updates #51312. Fixes #51... — committed to golang/go by hidu 2 years ago
- [release-branch.go1.18] cmd/go: pass --no-decorate when listing git tags for a commit This avoids a parse error when the user's global .gitconfig sets log.decorate to true. Updates #51312. Fixes #53... — committed to golang/go by hidu 2 years ago
- [release-branch.go1.18] cmd/go: pass --no-decorate when listing git tags for a commit This avoids a parse error when the user's global .gitconfig sets log.decorate to true. Updates #51312. Fixes #53... — committed to tailscale/go by hidu 2 years ago
- cmd/go: pass --no-decorate when listing git tags for a commit This avoids a parse error when the user's global .gitconfig sets log.decorate to true. Fixes #51312. Change-Id: Ic47b0f604c0c3a404ec50d... — committed to jproberts/go by hidu 2 years ago
yes, i have:
v1.23.13, v1.23.14 is the same cimmit when v1.23.13 occurred this error, i create tag v1.23.14, v1.23.14 also occurred the same error
with
go get
has the some error.go1.16.14 get -x mydomain.com/a/bnet@v1.23.13
the lastest version is
v1.23.15
i found it @bcmills https://github.com/golang/go/blob/go1.16.14/src/cmd/go/internal/modfetch/codehost/git.go#L437-L469
with
log.decorate = full
, Output:without
log.decorate = full
, output:but only support like this:
Could you run
go clean -modcache
and then postgo1.17,7 mod download -x mydomain.com/a/bnet@v1.23.13
specifically?go get
does a lot of package-to-version resolution that makes it substantially more complicated to debug, and 1.17.7 is closer to the current code than 1.16.14 is (so it’s easier to narrow down the interactions with other changes).Could you also check whether the issue reproduces with
go1.18rc1
?git ,is Annotated Tags,i create is by: