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 test" needs gcc when importing "net" #33840

Open
cespedes opened this issue Aug 26, 2019 · 0 comments

Comments

@cespedes
Copy link

commented Aug 26, 2019

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

$ go version
go version go1.12.9 linux/amd64

Does this issue reproduce with the latest release?

Yes, tested with latest stable version (1.12.9).

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/cespedes/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/cespedes/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/lib/go-1.12"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build945969099=/tmp/go-build -gno-record-gcc-switches"

What did you do?

$ ls
foo.go
$ cat foo.go 
package foo

import _ "net"
$ go test foo.go 
# runtime/cgo
exec: "gcc": executable file not found in $PATH

"go build" runs without problems, but "go test" needs gcc.

AFAIK, this bug is the same as #27303, but not #26988. Both were closed, but the former is not fixed yet (at least with 1.12.9).

@bcmills bcmills changed the title "go test" needs gcc when importing "net" cmd/go: "go test" needs gcc when importing "net" Aug 26, 2019

@bcmills bcmills added this to the Go1.14 milestone Aug 26, 2019

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