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/pkgsite: "go to latest" points to a pseudo-version in a module package with semantic versions #53167

Closed
seancfoley opened this issue May 31, 2022 · 4 comments

Comments

@seancfoley
Copy link

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

$ go version
go version go1.17.5 darwin/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"
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOVERSION="go1.17.5"

What did you do?

If you go to my module on pkg.go.dev, https://pkg.go.dev/github.com/seancfoley/ipaddress-go then everything looks fine.

When you go to a subfolder https://pkg.go.dev/github.com/seancfoley/ipaddress-go/ipaddr the site thinks that a pseudo-version is the latest, not the correct version 1.2.0. When you select the correct version (https://pkg.go.dev/github.com/seancfoley/ipaddr...@v1.2.0/ipaddr) there is a bright-red "go to latest" button to take you to a pseudo-version.

How did this happen you ask?

The go modules documentation was not entirely clear that you cannot use normal versioning numbering (eg v1.0.0) if you do not put the go.mod file at the root if the repository. So initially I had the go.mod in the package ipaddr. After a lot of trial and error I realized that to use normal semantic versioning I had to move the go.mod, so the go.mod is now placed it at the root of the repo.

That left me with this problem. I have tried many things but I cannot make that red button go away.

I have tried all sorts of ways of retracting the pseudo-versions but nothing works. I cannot retract using the new go mod in ipaddress-go, that does nothing. I cannot retract using the old go mod in the sub-folder ipaddress-go/ipaddr because any retraction creates a new pseudo-version. Creating proper semantic versions of ipaddress-go never gets rid of the pseudo-version either.

What did you expect to see?

version 1.2.0 should be marked the latest

Screen Shot 2022-05-31 at 2 52 05 PM

What did you see instead?

Version 0.0.0-...-eb05ef1 is marked the latest

Screen Shot 2022-05-31 at 2 52 26 PM

@gopherbot gopherbot added this to the Unreleased milestone May 31, 2022
@bcmills
Copy link
Contributor

bcmills commented May 31, 2022

This looks like another instance of #39007.

https://proxy.golang.org/github.com/seancfoley/ipaddress-go/ipaddr/@latest reports the last version of the nested module that existed, before it was removed in seancfoley/ipaddress-go@f8f610b. Since that module has the longer path, both go get and pkg.go.dev prefer to resolve the package from that module.

The short-term workaround is to restore the nested go.mod file in some commit, have it retract all versions of itself, and push and tag that commit with something like ipaddr/v0.0.0-retracted. Then the proxy will notice that version, and (at least in theory) pkg.go.dev should suppress the retracted module unless it is requested explicitly.

Longer-term, I'd still like the proxy to have a more ergonomic behavior for this sort of module-boundary change. 😞

@bcmills
Copy link
Contributor

bcmills commented May 31, 2022

Duplicate of #39007

@bcmills bcmills marked this as a duplicate of #39007 May 31, 2022
@bcmills bcmills closed this as completed May 31, 2022
@seancfoley
Copy link
Author

Thank you @bcmills.

I had filed previous issues #50636, #50636 and #53167 and in all cases the bugs were closed summarily without providing a fix or workaround. It was very frustrating, because this issue is difficult to diagnose or understand for those not well-versed in how the proxy functions.

I would never have guessed that work-around. I did try all the steps up until tagging the commit. I did not think of tagging with a version neither semantic nor pseudo and retracting that too.

I agree with you 100% in #39007 that this deserves a fix. It is not hard to trip over this. It is behaviour that no user would want. And it is difficult for a typical user to diagnose, fix or work around.

@seancfoley
Copy link
Author

The suggested work-around fix worked, thanks.

@golang golang locked and limited conversation to collaborators Jun 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants