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 -m -u' fails when latest version is retracted #53594

Closed
jayconrod opened this issue Jun 29, 2022 · 2 comments
Closed

cmd/go: 'go list -m -u' fails when latest version is retracted #53594

jayconrod opened this issue Jun 29, 2022 · 2 comments
Labels
FrozenDueToAge GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@jayconrod
Copy link
Contributor

What version of Go are you using (go version)?

$ go version
go version go1.18.3 darwin/arm64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/jay/Library/Caches/go-build"
GOENV="/Users/jay/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/jay/go/pkg/mod"
GONOPROXY="[redacted]"
GONOSUMDB="[redacted]"
GOOS="darwin"
GOPATH="/Users/jay/go"
GOPRIVATE="[redacted]"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/opt/go/installed"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/go/installed/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.18.3"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/58/l_czn8qd73v1dstwqh3xmf2m0000gn/T/go-build1355845410=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

  1. Require a module, say example.com/m, at the highest release version, say v1.2.0, which is retracted.
  2. Run go list -m -u example.com/m

What did you expect to see?

go list -m -u should report the module path and current version and note that the current version is retracted. It should not report an update.

$ go list -m -u example.com/m
example.com/m v1.2.0 (retracted)

What did you see instead?

go list -m -u exits with a non-zero status and prints an error about the retraction.

$ go list -m -u example.com/m
go: example.com/m@v1.2.0: retracted by module author: Accidentally published. Use v0.2.0 instead.
$ echo $?
1
@gopherbot
Copy link

Change https://go.dev/cl/414825 mentions this issue: cmd/go/internal/modload: ignore disallowed errors when checking for updates

@dr2chase dr2chase added the NeedsFix The path to resolution is known, but the work has not been done. label Jun 30, 2022
@dr2chase
Copy link
Contributor

@bcmills can you (in your copious free time) have a look at the CL? It looks safe and sensible to me.

@dmitshur dmitshur added the GoCommand cmd/go label Jun 30, 2022
@dmitshur dmitshur added this to the Go1.19 milestone Jul 13, 2022
jproberts pushed a commit to jproberts/go that referenced this issue Aug 10, 2022
…pdates

addUpdate calls Query with the query "upgrade". Normally, this returns
the highest release version (or prerelease, etc.) that is higher than
the current version and is not retracted or excluded. If there is no
such version, Query should return the current version. If the current
version is retracted or excluded, then Query currently returns an error.

addUpdate should ignore this error, as it ignores ErrNotExist and
NoMatchingVersionError. For 'go list -m -u', addRetraction is also
called, and that will detect the retraction.

Fixes golang#53594

Change-Id: I90a2872cdeabf03894acad9e0cbdd7db4a4e269e
Reviewed-on: https://go-review.googlesource.com/c/go/+/414825
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
@golang golang locked and limited conversation to collaborators Jul 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge 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

4 participants