Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: get of @latest does not return latest version #42451

Closed
myitcv opened this issue Nov 8, 2020 · 5 comments
Closed

cmd/go: get of @latest does not return latest version #42451

myitcv opened this issue Nov 8, 2020 · 5 comments
Labels
FrozenDueToAge GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@myitcv
Copy link
Member

myitcv commented Nov 8, 2020

What version of Go are you using (go version)?

$ go version
go version devel +3ef8562c9c Thu Nov 5 02:48:05 2020 +0000 linux/amd64

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=""
GOCACHE="/home/myitcv/.cache/go-build"
GOENV="/home/myitcv/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/myitcv/gostuff/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/myitcv/gostuff"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/myitcv/gos"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/myitcv/gos/pkg/tool/linux_amd64"
GOVCS=""
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
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-build500659767=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I'm not totally clear this is a cmd/go problem; it feels more like a proxy issue. But like #42449 I stumbled across it whilst playing with module retractions.

Here is the timestamp sequence of events:

2020-11-08T18:11:16.1449404Z $ go list -m -versions -retracted gopher.live/ue6d1acb0d101/proverb
2020-11-08T18:11:16.1451417Z gopher.live/ue6d1acb0d101/proverb v0.1.0 v0.2.0 v0.3.0 v0.4.0 v1.0.0 v1.0.1
2020-11-08T18:11:16.1453981Z $ go list -m -versions gopher.live/ue6d1acb0d101/proverb
2020-11-08T18:11:16.1456088Z gopher.live/ue6d1acb0d101/proverb v0.1.0 v0.3.0 v0.4.0
2020-11-08T18:11:16.1458389Z $ go get gopher.live/ue6d1acb0d101/proverb@latest
2020-11-08T18:11:16.1460338Z go: gopher.live/ue6d1acb0d101/proverb latest => v0.3.0

What did you expect to see?

The go get should have resulted in v0.4.0

What did you see instead?

v0.3.0

cc @jayconrod @katiehockman @heschik

@myitcv myitcv added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. GoCommand cmd/go labels Nov 8, 2020
@bcmills
Copy link
Contributor

bcmills commented Nov 9, 2020

Is this issue consistently reproducible, or did it resolve?

If it is consistent, perhaps try rebuilding go at CL 263267 (06538fa) or later and see if it's fixed?

@myitcv
Copy link
Member Author

myitcv commented Nov 9, 2020

It definitely seems somewhat random. I will happily try a later version of tip and report back. Although doesn't the sequence above suggest that a later call to the /list endpoint (i.e. the one as part of go get gopher.live/ue6d1acb0d101/proverb@latest) returned a different list of versions to the previous call (i.e. the go list -m -versions gopher.live/ue6d1acb0d101/proverb)? To be clear, in the version list v0.1.0 v0.2.0 v0.3.0 v0.4.0 v1.0.0 v1.0.1, v0.2.0 v1.0.0 v1.0.1 are retracted. Hence v0.4.0 is indeed the latest version.

What would be useful from my perspective would be to clarify how the proxy in certain circumstances:

  • after pulling a new version through the proxy, should all subsequent go list -m -versions queries return that new version, or is there some delay?
  • after pulling a new version through the proxy, if there are other versions that have been published but are currently not known to the proxy, does pulling one of those versions make the proxy aware of all versions or just the one pulled through?

@bcmills
Copy link
Contributor

bcmills commented Nov 9, 2020

Although doesn't the sequence above suggest that a later call to the /list endpoint … returned a different list of versions to the previous call …?

Maybe, although it could also be a bug somewhere in the logic that prunes retracted versions, or something in go get involving existing dependencies.

@myitcv
Copy link
Member Author

myitcv commented Nov 9, 2020

I've just commented over at #42449 (comment) with some further context. I suspect these issues might end up being one and the same cause?

@myitcv
Copy link
Member Author

myitcv commented Nov 9, 2020

Closing this in favour of #42449, because it appears to be an artefact of proxy caching (and my incorrect assumption).

@myitcv myitcv closed this as completed Nov 9, 2020
@golang golang locked and limited conversation to collaborators Nov 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants