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: go list -u -m all fails with module/import name mismatch while loading module retractions on forked/renamed module #41350
Comments
Neat find! Thanks for testing and reporting. |
@jayconrod, I wonder if we should expand the If I have a repo at, say, |
@bcmills I wonder if that should be combined with aliasing? A while back, I think you had a design for a directive specifying paths by which a module was previously known. If we had that, then a retraction of |
Hmm, that's true. And the version range for the previous path(s) shouldn't overlap with the version range for the current path anyway. (The tags on the repo would be ambiguous.) |
So probably we should just ignore the declared module path for the purpose of retractions‽ |
Yeah, I think that would work. And we don't need any new syntax for that, which is very nice. |
Change https://golang.org/cl/255961 mentions this issue: |
What version of Go is this fix available in? I'm seeing the issue on
|
@ryancurrah This was fixed before |
Ack thank you. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
No, this works fine in Go 1.15. On tip, it fails.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
This is a cut down version of something I see in one of my projects, where some dependency of a dependency (and so on) causes this.
And a
go.mod
:Run
go list -u -m all
.What did you expect to see?
A listing of all modules, with possible upgrades listed. This command is used by tooling like
gopls
to offer upgrades as well.What did you see instead?
viper
requiresgithub.com/coreos/bbolt@v1.3.2
, which predates the addition of ago.mod
. When this fork ofbolt
was turned into a module, it gained the new import pathgo.etcd.io/bbolt
. I'm assuming that this breaks down with-u
because it's scanning newer versions and finding the mismatch.Normally, I'd say "viper should update its use to the new module path", but I'm not sure that this is going to really fix the issue if these sorts of mismatches are living happily in the wild. The code still builds, but it causes anyone who depends on it to no longer be able to run
go list -u -m all
seemingly without much recourse in a situation that worked in previous versions of Go.I bisected the issue, assuming it was something related to the new
all
changes, but it's actually the-retracted
CL. (On reflection, I didn't read the error message closely enough; it says "loading module retractions" right there!)I'll preemptively cc @jayconrod and @bcmills, if that's okay. 🙂
The text was updated successfully, but these errors were encountered: