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: improve diagnostic for module graph errors from unpruned transitive dependencies in 'go get' #48024

Closed
bcmills opened this issue Aug 27, 2021 · 3 comments
Labels
GoCommand cmd/go help wanted modules NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Aug 27, 2021

In the Go 1.17 release I left a TODO for a better error in a fairly obscure case (an error loading the versions found in the upgraded module graph, when that path arises from a transitive dependency of a go 1.16 or earlier module).

The error today should indicate which module produced the error, but ideally the error should also log the path to that module.

Such errors should become more rare over time as modules upgrade to go 1.17 and higher. However, it would still be nice to do the TODO for the better diagnostic at some point.

if go117LazyTODO {
// Compute the requirement path from a module path in tryUpgrade to the
// error, and the requirement path (if any) from rs.rootModules to the
// tryUpgrade module path. Return a *mvs.BuildListError showing the
// concatenation of the paths (with an upgrade in the middle).
}

@bcmills bcmills added help wanted NeedsFix The path to resolution is known, but the work has not been done. GoCommand cmd/go modules labels Aug 27, 2021
@bcmills bcmills added this to the Backlog milestone Aug 27, 2021
@gopherbot
Copy link

Change https://golang.org/cl/345392 mentions this issue: cmd/go/internal/modload: remove go117LazyTODO

@bcmills bcmills changed the title cmd/go: improve diagnostic for module graph errors from unpruned transitive dependencies 'go get' cmd/go: improve diagnostic for module graph errors from unpruned transitive dependencies in 'go get' Aug 30, 2021
gopherbot pushed a commit that referenced this issue Aug 30, 2021
Replace the last remaining use with a reference to #48024.

Change-Id: I699711b4e42abe9c6d3512c28d2ee81a84e3263a
Reviewed-on: https://go-review.googlesource.com/c/go/+/345392
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
@quantonganh
Copy link
Contributor

345392 had been merged, this can be closed?

@bcmills
Copy link
Contributor Author

bcmills commented Nov 6, 2023

I completely overhauled src/cmd/go/internal/modload/edit.go in https://go.dev/cl/471595.

The conflicting path is now logged (in src/cmd/go/internal/modget/get.go) if the -v flag is set. I think we can consider this issue to be fixed. Thanks for following up!

@bcmills bcmills closed this as completed Nov 6, 2023
@bcmills bcmills modified the milestones: Backlog, Go1.21 Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GoCommand cmd/go help wanted modules NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants