Skip to content

cmd/go: 'go get cloud.google.com/go@master' chooses a v0.0.0- pseudo-version #34266

Closed
@jeanbza

Description

@jeanbza

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.

Activity

jeanbza

jeanbza commented on Sep 12, 2019

@jeanbza
ContributorAuthor

$ export GOPROXY=direct does not fix it.

However, the following does:

$ GOPROXY=direct go get cloud.google.com/go@v0.45.2-0.20190912161704-ff0e67b94976
$ GOPROXY=direct go get cloud.google.com/go@master
go: finding cloud.google.com/go master
$
bcmills

bcmills commented on Sep 12, 2019

@bcmills
Contributor

Possibly related to #34092, in that both seem to be symptoms of incomplete git histories.

added
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
on Sep 12, 2019
added this to the Go1.14 milestone on Sep 12, 2019
self-assigned this
on Sep 12, 2019
changed the title [-]cmd/go: transient inconsistent versions[/-] [+]cmd/go: 'go get cloud.google.com/go@master' chooses a v0.0.0- pseudo-version[/+] on Sep 12, 2019
bcmills

bcmills commented on Sep 13, 2019

@bcmills
Contributor

This is looking like another JGit bug to me: fetches from cloud.google.com/go do not return sufficient history, while the same fetches from github.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.)

$ GO111MODULE=on GOPROXY=direct gotip list -m cloud.google.com/go@master
go: finding cloud.google.com/go master
cloud.google.com/go v0.0.0-20190912234516-79f6ed72c950

$ GO111MODULE=on GOPROXY=direct gotip list -m github.com/googleapis/google-cloud-go@master
go: finding github.com/googleapis/google-cloud-go master
github.com/googleapis/google-cloud-go v0.45.2-0.20190912234516-79f6ed72c950

$
bcmills

bcmills commented on Sep 13, 2019

@bcmills
Contributor

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

bcmills commented on Sep 23, 2019

@bcmills
Contributor

@gopherbot, please backport to Go 1.13. This can cause errors in pseudo-version resolution, and the workarounds are not at all obvious.

gopherbot

gopherbot commented on Sep 23, 2019

@gopherbot
Contributor

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

bcmills commented on Sep 23, 2019

@bcmills
Contributor

The workaround, in this case, is to pass go get the specific pseudo-version corresponding to the HEAD revision.

gopherbot

gopherbot commented on Sep 23, 2019

@gopherbot
Contributor

Change https://golang.org/cl/196961 mentions this issue: cmd/go/internal/modfetch/codehost: work around an apparent bug in 'git fetch --unshallow'

gopherbot

gopherbot commented on Sep 24, 2019

@gopherbot
Contributor

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'

locked and limited conversation to collaborators on Sep 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.modules

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jeanbza@bcmills@gopherbot

        Issue actions

          cmd/go: 'go get cloud.google.com/go@master' chooses a v0.0.0- pseudo-version · Issue #34266 · golang/go