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 mod verify reports "all modules verified" in auto mode #31974

Closed
jsha opened this issue May 10, 2019 · 3 comments
Closed

cmd/go: go mod verify reports "all modules verified" in auto mode #31974

jsha opened this issue May 10, 2019 · 3 comments
Labels
FrozenDueToAge GoCommand cmd/go modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@jsha
Copy link

jsha commented May 10, 2019

go version go1.12 linux/amd64

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/jsha/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/jsha/gopkg"
GOPROXY=""
GORACE=""
GOROOT="/home/jsha/go1.12"
GOTMPDIR=""
GOTOOLDIR="/home/jsha/go1.12/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build307902328=/tmp/go-build -gno-record-gcc-switches"

What did you do?

  • Added a go.mod to my package, converting it to module mode.
  • Intentionally modified one of its dependencies (yaml.v2) in the module cache.
  • Ran go mod verify.

What did you expect to see?

gopkg.in/yaml.v2 v2.2.2: dir has been modified (/home/jsha/gopkg/pkg/mod/gopkg.in/yaml.v2@v2.2.2)

What did you see instead?

all modules verified

This is with GO111MODULE unset, which I understand should put Go modules in "auto" mode, which should be equivalent to "on" for this command, since go.mod was present.

I get the same results if I run with an explicit GO111MODULE=auto or GO111MODULE=off. If I run with GO111MODULE=on, I see the expected error.

I think regardless of whether go mod verify chooses module mode or not, it should never report "all modules verified" if it didn't do any verification. Similarly it should never return 0 if it didn't do any verification.

@jsha jsha changed the title mod: go mod verify reports "all modules verified" in auto mode cmd/mod: go mod verify reports "all modules verified" in auto mode May 10, 2019
@andybons
Copy link
Member

@bcmills @jayconrod

@andybons andybons added this to the Unplanned milestone May 13, 2019
@andybons andybons added modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels May 13, 2019
@bcmills
Copy link
Contributor

bcmills commented May 13, 2019

This is the same underlying problem as #31237, I believe.

@dmitshur dmitshur changed the title cmd/mod: go mod verify reports "all modules verified" in auto mode cmd/go: go mod verify reports "all modules verified" in auto mode Jul 19, 2019
@dmitshur dmitshur added the GoCommand cmd/go label Jul 19, 2019
@bcmills
Copy link
Contributor

bcmills commented Sep 16, 2019

Should be fixed by CL 174697. Please let us know if you're still seeing a problem with go 1.13 or later.

@bcmills bcmills closed this as completed Sep 16, 2019
@golang golang locked and limited conversation to collaborators Sep 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge GoCommand cmd/go modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants