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: suggest 'go get' instead of 'go mod tidy' when indirect dependencies are missing #46710

Open
bcmills opened this issue Jun 11, 2021 · 5 comments
Assignees
Labels
modules NeedsFix
Milestone

Comments

@bcmills
Copy link
Member

@bcmills bcmills commented Jun 11, 2021

(Noticed while testing #45979.)

If a lazy module (#36460) is missing explicit requirements on indirect dependencies, we currently emit the error message:

go: updates to go.mod needed; to update it:
	go mod tidy

This advice is correct, but it's too big a hammer — we should instead suggest go get on the specific packages within the main repo whose transitive dependencies are missing.

CC @jayconrod @matloob

@bcmills bcmills added NeedsFix modules labels Jun 11, 2021
@bcmills bcmills added this to the Go1.17 milestone Jun 11, 2021
@bcmills bcmills self-assigned this Jun 11, 2021
@bcmills bcmills removed this from the Go1.17 milestone Jul 15, 2021
@bcmills bcmills added this to the Go1.18 milestone Jul 15, 2021
@dwertent
Copy link

@dwertent dwertent commented Oct 21, 2021

@bcmills I'm encountering this issue. How do you recommend I approach this issue until it's fixed? how can I know what module is the problematic one?
Thank you

@meetme2meat
Copy link

@meetme2meat meetme2meat commented Nov 1, 2021

@bcmills we are facing the similar problem all our CI test for golang 1.17 are failing with exact same error, downgraded the go version on drone.yml to 1.16 seem to work. Is there any specific that need to done to have our test working under go 1.17

@bcmills
Copy link
Member Author

@bcmills bcmills commented Nov 1, 2021

@dwertent, @meetme2meat: this issue is about changing which command we suggest when the go.mod file is inconsistent; the go mod tidy command that we suggest today is correct, it just makes more changes than are strictly necessary to resolve the condition. (This is a UX issue, not a bug to be fixed or worked around.)

@bcmills bcmills removed this from the Go1.18 milestone Nov 1, 2021
@bcmills bcmills added this to the Go1.19 milestone Nov 1, 2021
@meetme2meat
Copy link

@meetme2meat meetme2meat commented Nov 1, 2021

@bcmills Understood, but now our Drone CI running under go 1.17 result in failure(and work when go 1.16) with the exact same message. I don't know why it exiting at the above test as on my machine it work correctly

@bcmills
Copy link
Member Author

@bcmills bcmills commented Nov 1, 2021

Run go mod tidy, as the error message says, and then commit the result. If that doesn't resolve the error, please file a new issue from the issue template (https://golang.org/issue/new).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
modules NeedsFix
Projects
None yet
Development

No branches or pull requests

3 participants