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: https://github.com/golang/go/issues/45305, https://github.com/golang/go/issues/41350 (although with different reasons)
Reproducer:
- Checkout the example https://github.com/cardil/repro-golang-66403
- Switch to Go < 1.22
- 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.
Comment From: gopherbot
Change https://go.dev/cl/588775 mentions this issue: cmd/go: fix go list -u -m all with retractions dependency
Comment From: gopherbot
Change https://go.dev/cl/593136 mentions this issue: cmd/go: fix go list -u -m all with too new retractions dependency
Comment From: samthanawalla
@gopherbot pretty please backport this to 1.21 and 1.22 🙏
Comment From: gopherbot
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.
Comment From: gopherbot
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
Comment From: gopherbot
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