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

Open
jsha opened this issue May 10, 2019 · 2 comments

Comments

@jsha
Copy link

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

This comment has been minimized.

Copy link
Member

commented May 13, 2019

@bcmills

This comment has been minimized.

Copy link
Member

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 label Jul 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.