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: unhelpful error message when running "go install" on a replaced-but-not-required package #46528

Closed
bcmills opened this issue Jun 2, 2021 · 6 comments

Comments

@bcmills
Copy link
Member

@bcmills bcmills commented Jun 2, 2021

$ go1.16.4 mod init tools
go: creating new go.mod: module tools

$ go mod edit -replace=sigs.k8s.io/controller-tools@v0.5.0=github.com/markusthoemmes/controller-tools@v0.5.1-0.20210420220833-f284e2e8098c

$ go1.16.4 install sigs.k8s.io/controller-tools
missing go.sum entry for module providing package sigs.k8s.io/controller-tools; to add:
        go mod download

$ go1.16.4 mod download

$ go1.16.4 install sigs.k8s.io/controller-tools
missing go.sum entry for module providing package sigs.k8s.io/controller-tools; to add:
        go mod download
@bcmills bcmills changed the title cmd/go: un error message when running "go install" on a replaced-but-not-required package cmd/go: unhelpful error message when running "go install" on a replaced-but-not-required package Jun 2, 2021
@bcmills
Copy link
Member Author

@bcmills bcmills commented Jun 2, 2021

@bcmills
Copy link
Member Author

@bcmills bcmills commented Jun 2, 2021

The suggestion to run go mod download here is not helpful: no module in the requirement graph could provide the requested package to begin with. (One is replaced, but not yet required.)

@bcmills
Copy link
Member Author

@bcmills bcmills commented Jun 3, 2021

@gopherbot, please backport to Go 1.16.

This condition is fairly rare, but an unhelpful error message can be very confusing and frustrating when it happens, and the fix will hopefully be small and non-invasive.

@gopherbot
Copy link

@gopherbot gopherbot commented Jun 3, 2021

Backport issue(s) opened: #46551 (for 1.16).

Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases.

@gopherbot
Copy link

@gopherbot gopherbot commented Jun 5, 2021

Change https://golang.org/cl/325430 mentions this issue: cmd/go: remove unhelpful hint in some cases when using go list

@gopherbot
Copy link

@gopherbot gopherbot commented Jun 8, 2021

Change https://golang.org/cl/324470 mentions this issue: cmd/go: remove hint when no module is suggested

@gopherbot gopherbot closed this in e552a6d Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants