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

x/website/tour: installing @latest gets older version #47236

Open
dmitshur opened this issue Jul 16, 2021 · 3 comments
Open

x/website/tour: installing @latest gets older version #47236

dmitshur opened this issue Jul 16, 2021 · 3 comments
Labels
modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@dmitshur
Copy link
Contributor

dmitshur commented Jul 16, 2021

A reasonable way to install the latest version of the tour binary from its latest location is by using go install:

go install golang.org/x/website/tour@latest

However, doing so currently gets a slightly older version of the tour, before the x/website/tour nested module was merged into the x/website module in CL 323897.


$ go install golang.org/x/website/tour@latest
go: downloading golang.org/x/website v0.0.0-20210715154925-11adafea15f8
go: downloading golang.org/x/website/tour v0.0.0-20210616181959-e0d934b43647

$ go version -m $(which tour) | head -n 3
/Users/dmitshur/go/bin/tour: go1.16.6
	path	golang.org/x/website/tour
	mod	golang.org/x/website/tour	v0.0.0-20210616181959-e0d934b43647	h1:IFK+1/z6bm51XIJD3ksijCgwsZXJJxliWFiIYVEG6F8=

Note that module path is golang.org/x/website/tour and version is a month-old v0.0.0-20210616181959-e0d934b43647, rather than the latest commit on master branch:

$ go install golang.org/x/website/tour@HEAD
$ go version -m $(which tour) | head -n 3  
/Users/dmitshur/go/bin/tour: go1.16.6
	path	golang.org/x/website/tour
	mod	golang.org/x/website	v0.0.0-20210715154925-11adafea15f8	h1:xRFLa1Fo4NnOCH0yKaPu6H36MmmA/GJEZyTEO+HOWlI=

A workaround is to specify @HEAD or the exact version of tour one wants.

@dmitshur dmitshur added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. modules labels Jul 16, 2021
@dmitshur dmitshur added this to the Unreleased milestone Jul 16, 2021
@dmitshur
Copy link
Contributor Author

Hmm, this doesn't seem to happen in GOPROXY=direct mode, so maybe the module mirror is playing a role. I'll check again later.

@dmitshur dmitshur self-assigned this Jul 16, 2021
@dmitshur
Copy link
Contributor Author

dmitshur commented Jul 16, 2021

I understand why this is happening and can confirm both the go command and module mirror are working as expected. Specifically, https://golang.org/ref/mod#resolve-pkg-mod specifies that:

If one or more modules contain the requested package, the module with the longest path is used.

When the module mirror is used, the latest versions of both x/website and x/website/tour modules are found, both contain the tour package, and the x/website/tour with the its longer module path gets selected (despite being older).

I suspect we'll need to fix this by publishing a newer version of the x/website/tour module that retracts its past versions and/or deletes the tour package.

@bcmills
Copy link
Contributor

bcmills commented Jul 16, 2021

#39007 is closely related.

@dmitshur dmitshur removed their assignment Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
modules 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

2 participants