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 · 6 comments
Labels
BadErrorMessage Issues related compiler error messages that should be better. modules NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@bcmills
Copy link
Contributor

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 The path to resolution is known, but the work has not been done. 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 modified the milestones: Go1.17, Go1.18 Jul 15, 2021
@dwertent
Copy link

@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

@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
Contributor Author

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 modified the milestones: Go1.18, Go1.19 Nov 1, 2021
@meetme2meat
Copy link

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
Contributor Author

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).

@bcmills bcmills modified the milestones: Go1.19, Go1.20 Jun 1, 2022
@bcmills bcmills modified the milestones: Go1.20, Go1.21 Dec 12, 2022
@gopherbot gopherbot modified the milestones: Go1.21, Go1.22 Aug 8, 2023
@bcmills bcmills modified the milestones: Go1.22, Backlog Feb 1, 2024
@bcmills bcmills added the BadErrorMessage Issues related compiler error messages that should be better. label Mar 15, 2024
@bcmills bcmills removed their assignment Mar 15, 2024
@bcmills
Copy link
Contributor Author

bcmills commented Mar 15, 2024

(CC @matloob @samthanawalla)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BadErrorMessage Issues related compiler error messages that should be better. modules NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants