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 · 7 comments
Labels
FrozenDueToAge modules NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@bcmills
Copy link
Contributor

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

bcmills commented Jun 2, 2021

Compare #46496, #45332; CC @jayconrod @matloob

@bcmills bcmills added modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. NeedsFix The path to resolution is known, but the work has not been done. labels Jun 2, 2021
@bcmills bcmills added this to the Go1.17 milestone Jun 2, 2021
@gopherbot gopherbot removed the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 2, 2021
@bcmills
Copy link
Contributor Author

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

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

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

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

@gopherbot
Copy link

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

@gopherbot
Copy link

Change https://golang.org/cl/334371 mentions this issue: [release-branch.go1.16] cmd/go: remove hint when no module is suggested

gopherbot pushed a commit that referenced this issue Aug 2, 2021
Updates #46528
Fixes #46551

Change-Id: I2453d321ece878ea7823865758aa4a16b3ed7fe8
Reviewed-on: https://go-review.googlesource.com/c/go/+/325430
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Trust: Heschi Kreinick <heschi@google.com>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
(cherry picked from commit e552a6d)
Reviewed-on: https://go-review.googlesource.com/c/go/+/334371
Trust: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
@golang golang locked and limited conversation to collaborators Jul 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge modules NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

2 participants