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

tools/go/packages: must go.sum exist? #29635

Closed
sunliver opened this issue Jan 9, 2019 · 1 comment
Closed

tools/go/packages: must go.sum exist? #29635

sunliver opened this issue Jan 9, 2019 · 1 comment

Comments

@sunliver
Copy link

sunliver commented Jan 9, 2019

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

$ go version
go version go1.11.4 darwin/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
GOARCH="amd64"
GOBIN="/Users/sunliver/go/bin"
GOCACHE="/Users/sunliver/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/sunliver/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.11.4/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.11.4/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/sunliver/Documents/gomod-test/package/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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/r3/fxzm7n8s0497vkmvnj0qygkr0000gp/T/go-build304816994=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

make sure GO111MODULE=on

  1. compile x/tools/package_test
  2. create a minimal mod package, change root dir to 555 ( rm write permission) and rm go.sum
    make sure your minimal package add at lease one third-party dependence
  3. try use package generated in step1 to visit imports

What did you see instead?

gopackages: go [list -e -json -compiled -test=false -export=false -deps=true -find=false -- gopkg.in/yaml.v2]: exit status 1: go: writing go.sum: open /Users/sunliver/go/pkg/mod/gopkg.in/[email protected]/go.sum: permission denied

I find this behavior when I try to visit imports under mod cache, but the package only have go.mod but miss go.sum(eg. yaml).

Q: Currently, is go.sum necessary for x/tools/go/packages to work?

@ALTree ALTree changed the title tools/go/packages [question]go.sum must exists? tools/go/packages: must go.sum exist? Jan 9, 2019
@ALTree ALTree added the Question label Jan 9, 2019
@bcmills
Copy link
Contributor

bcmills commented Jan 10, 2019

go list should probably not fail if go.sum cannot be written. (See #29452.)

@bcmills bcmills closed this as completed Jan 10, 2019
@golang golang locked and limited conversation to collaborators Jan 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants