joefitzgerald / go-plus

An Enhanced Go Experience For The Atom Editor
https://atom.io/packages/go-plus
Other
1.51k stars 128 forks source link

permission denied errors when running tests #776

Open dominicbarnes opened 6 years ago

dominicbarnes commented 6 years ago

Prerequisites

Description

When saving files, go-plus is running tests in the background. After upgrading to 1.10, I started getting this error:

go test runtime/cgo: open /usr/lib/go-1.10/pkg/linux_amd64/runtime/cgo.a: permission denied

I'm installing golang following instructions in the wiki.

I found someone else with the same error message (see golang/go#24674) and they determined it was caused by the -i flag used for go build|test.

It looks like go-plus runs the following command:

go test -c -i -o /dev/null .

From the other issue I linked, it sounds like -i is unnecessary. When running this command in the terminal, I can reproduce the error message by adding/removing -i.

Is it possible to configure this command? If not, can the ability to configure this be added?

Output from atom -v && apm -v

$ atom -v
atom -v
Atom    : 1.26.1
Electron: 1.7.11
Chrome  : 58.0.3029.110
Node    : 7.9.0

$ apm -v
apm  1.19.0
npm  3.10.10
node 6.9.5 x64
atom 1.26.1
python 2.7.15rc1
git 2.17.0

Output From go env

$ go env
go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/dominic/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/dominic/dev"
GORACE=""
GOROOT="/usr/lib/go-1.10"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.10/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-I/home/dominic/src/db2/clidriver/include"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-L/home/dominic/src/db2/clidriver/lib"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build343043220=/tmp/go-build -gno-record-gcc-switches"
zmb3 commented 6 years ago

We should remove the -i flag for Go 1.10+.

I am curious though - do you see the same error if you install the official Go distribution from golang.org instead of the one provided by your OS package manager?

sjauld commented 5 years ago

I'm also seeing this error using the official Go distribution.

go version go1.11.1 linux/amd64

dominicbarnes commented 5 years ago

I'm still seeing this error, I was using go 1.10 and even tried upgrading to 1.11.