Closed
Description
What version of Go are you using (go version
)?
$ go version go version go1.13 linux/amd6
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (go env
)?
go env
Output
$ go env GO111MODULE="" GOARCH="amd64" GOBIN="/usr/local/google/home/deklerk/dev/go1.13.linux-amd64/go//bin" GOCACHE="/usr/local/google/home/deklerk/.cache/go-build" GOENV="/usr/local/google/home/deklerk/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/usr/local/google/home/deklerk/go" GOPRIVATE="" GOPROXY="direct" GOROOT="/usr/local/google/home/deklerk/dev/go1.13.linux-amd64/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/google/home/deklerk/dev/go1.13.linux-amd64/go/pkg/tool/linux_amd64" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/tmp/foo/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 -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build484796474=/tmp/go-build -gno-record-gcc-switches"
What did you do?
deklerk at deklerk in /tmp/foo
$ go get cloud.google.com/go@master
go: finding cloud.google.com/go master
go get: inconsistent versions:
cloud.google.com/go@v0.0.0-20190912161704-ff0e67b94976 from cloud.google.com/go@master requires cloud.google.com/go@v0.45.1 (not cloud.google.com/go@v0.0.0-20190912161704-ff0e67b94976 from cloud.google.com/go@master)
What did you expect to see?
It works.
What did you see instead?
It provides a go get: inconsistent versions
error.
Metadata
Metadata
Assignees
Labels
Type
Projects
Relationships
Development
No branches or pull requests
Activity
jeanbza commentedon Sep 12, 2019
$ export GOPROXY=direct
does not fix it.However, the following does:
bcmills commentedon Sep 12, 2019
Possibly related to #34092, in that both seem to be symptoms of incomplete
git
histories.[-]cmd/go: transient inconsistent versions[/-][+]cmd/go: 'go get cloud.google.com/go@master' chooses a v0.0.0- pseudo-version[/+]bcmills commentedon Sep 13, 2019
This is looking like another JGit bug to me: fetches from
cloud.google.com/go
do not return sufficient history, while the same fetches fromgithub.com/googleapis/google-cloud-go
do.(The repo for
cloud.google.com/go
is served from https://code.googlesource.com/gocloud, which I believe uses a fork of JGit under the hood. See previously #31399; CC @draftcode.)bcmills commentedon Sep 13, 2019
I have filed a Google-internal bug to track the issue in the
code.googlesource.com
server. Will post here with any relevant updates.bcmills commentedon Sep 23, 2019
@gopherbot, please backport to Go 1.13. This can cause errors in pseudo-version resolution, and the workarounds are not at all obvious.
gopherbot commentedon Sep 23, 2019
Backport issue(s) opened: #34477 (for 1.13).
Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases.
bcmills commentedon Sep 23, 2019
The workaround, in this case, is to pass
go get
the specific pseudo-version corresponding to theHEAD
revision.gopherbot commentedon Sep 23, 2019
Change https://golang.org/cl/196961 mentions this issue:
cmd/go/internal/modfetch/codehost: work around an apparent bug in 'git fetch --unshallow'
gopherbot commentedon Sep 24, 2019
Change https://golang.org/cl/197060 mentions this issue:
[release-branch.go1.13] cmd/go/internal/modfetch/codehost: work around an apparent bug in 'git fetch --unshallow'
[release-branch.go1.13] cmd/go/internal/modfetch/codehost: work aroun…