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: list modifies local go.sum even when package does not exist in queried module #36260

Closed
kortschak opened this issue Dec 24, 2019 · 3 comments
Labels
FrozenDueToAge modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@kortschak
Copy link
Contributor

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

$ go version
go version go1.13.5 linux/amd64

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="on"
GOARCH="amd64"
GOBIN="/home/user/bin"
GOCACHE="/home/user/.cache/go-build"
GOENV="/home/user/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/user"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/user/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/user/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/user/tmp/go.mod"
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-build218352463=/tmp/go-build -gno-record-gcc-switches"

What did you do?

~ $ mkdir tmp
~ $ cd tmp
~/tmp $ go mod init module
go: creating new go.mod: module module
~/tmp $ stat go.sum
stat: cannot stat 'go.sum': No such file or directory
~/tmp $ go list golang.org/x/tools/nonexistent
go: finding golang.org/x/tools latest
can't load package: package golang.org/x/tools/nonexistent: module golang.org/x/tools@latest found (v0.0.0-20191223235410-3721262b3e7c), but does not contain package golang.org/x/tools/nonexistent
~/tmp $ cat go.sum
golang.org/x/tools v0.0.0-20191223235410-3721262b3e7c h1:PeFrxQ8YTAKg53UR8aP/nxa82lQYIdb+pd1bfg3dBDM=

What did you expect to see?

No change to go.sum.

What did you see instead?

An addition to go.sum.

@cagedmantis cagedmantis added this to the Backlog milestone Jan 2, 2020
@cagedmantis cagedmantis added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jan 2, 2020
@cagedmantis
Copy link
Contributor

@kortschak Thanks for creating an issue. I've been able to reproduce what you've described.

@cagedmantis
Copy link
Contributor

/cc @bcmills @jayconrod

@bcmills bcmills added the modules label Jan 6, 2020
@gopherbot
Copy link

Change https://golang.org/cl/237017 mentions this issue: cmd/go: don't save sums for modules loaded for import resolution

@golang golang locked and limited conversation to collaborators Aug 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge 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

4 participants