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: go list -u -m all fails loading module retractions: module requires go >= 1.N+1 (running go 1.N) #66403

Closed
cardil opened this issue Mar 19, 2024 · 6 comments
Assignees
Labels
GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@cardil
Copy link

cardil commented Mar 19, 2024

Go version

go version go1.21.4 linux/amd64

Output of go env in your module/workspace:

go env output:
GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/ksuszyns/.cache/go-build'
GOENV='/home/ksuszyns/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/ksuszyns/.gvm/pkgsets/go1.21.4/global/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/ksuszyns/.gvm/pkgsets/go1.21.4/global'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/home/ksuszyns/.gvm/gos/go1.21.4'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/home/ksuszyns/.gvm/gos/go1.21.4/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.21.4'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/home/ksuszyns/git/ghet/go.mod'
GOWORK='/home/ksuszyns/git/ghet/go.work'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build221871812=/tmp/go-build -gno-record-gcc-switches'

What did you do?

When a module with retractions is a dependency, and that module has a newer version, which requires a newer version of Go than it's currently running, the command: go list -u -m all fails.

Other similar issues: #45305, #41350 (although with different reasons)

Reproducer:

  1. Checkout the example https://github.com/cardil/repro-golang-66403
  2. Switch to Go < 1.22
  3. Execute go list -u -m all

What did you see happen?

The command go list -u -m all fails with:

go: loading module retractions for github.com/buildkite/agent/v3@v3.62.0: module github.com/buildkite/agent/v3@v3.66.0 requires go >= 1.22 (running go 1.21.4)

What did you expect to see?

I expected to see the list of modules.

@cardil cardil changed the title cmd/go: go list -u -m all fails with: loading module retractions for X@v0.1.0: module X@v0.6.0 requires go >= 1.22 (running go 1.21.4) cmd/go: go list -u -m all fails with: loading module retractions for X@x: module X@y requires go >= 1.FF (running go 1.FE) Mar 19, 2024
@seankhliao seankhliao changed the title cmd/go: go list -u -m all fails with: loading module retractions for X@x: module X@y requires go >= 1.FF (running go 1.FE) cmd/go: go list -u -m all fails loading module retractions: module requires go >= 1.N+1 (running go 1.N) Mar 19, 2024
@seankhliao seankhliao added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. GoCommand cmd/go labels Mar 19, 2024
@samthanawalla samthanawalla modified the milestones: Go1.23, Go1.24 May 16, 2024
@matloob matloob modified the milestones: Go1.24, Go1.23 May 28, 2024
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/588775 mentions this issue: cmd/go: fix go list -u -m all with retractions dependency

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/593136 mentions this issue: cmd/go: fix go list -u -m all with too new retractions dependency

@samthanawalla
Copy link
Contributor

@gopherbot pretty please backport this to 1.21 and 1.22 🙏

@gopherbot
Copy link
Contributor

Backport issue(s) opened: #68051 (for 1.21), #68052 (for 1.22).

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

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/593355 mentions this issue: [release-branch.go1.22] cmd/go: fix go list -u -m all with too new retractions dependency

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/593375 mentions this issue: [release-branch.go1.21] cmd/go: fix go list -u -m all with too new retractions dependency

gopherbot pushed a commit that referenced this issue Jun 24, 2024
…tractions dependency

Previously, go would not report retractions of dependencies that have a
newer version of Go. With this change, we will still display retractions despite a version difference when go list -u -m is used.

For: #66403
Fixes: #68051

Change-Id: I6406680235e294269836ae4cbe3d5680ca10eea0
Reviewed-on: https://go-review.googlesource.com/c/go/+/588775
Auto-Submit: Sam Thanawalla <samthanawalla@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
(cherry picked from commit e44fa1c)
Reviewed-on: https://go-review.googlesource.com/c/go/+/593375
gopherbot pushed a commit that referenced this issue Jun 24, 2024
…tractions dependency

Previously, go would not report retractions of dependencies that have a
newer version of Go. With this change, we will still display retractions despite a version difference when go list -u -m is used.

For: #66403
Fixes: #68052

Change-Id: I6406680235e294269836ae4cbe3d5680ca10eea0
Reviewed-on: https://go-review.googlesource.com/c/go/+/588775
Auto-Submit: Sam Thanawalla <samthanawalla@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
(cherry picked from commit e44fa1c)
Reviewed-on: https://go-review.googlesource.com/c/go/+/593355
@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

7 participants
@cardil @dmitshur @gopherbot @seankhliao @matloob @samthanawalla and others