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` complains about missing gcc (even if no tests exist, and only for certain imports) #27303

Closed
jhinrichsen opened this issue Aug 28, 2018 · 5 comments

Comments

Projects
None yet
5 participants
@jhinrichsen
Copy link

commented Aug 28, 2018

Please answer these questions before submitting your issue. Thanks!

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

go version go1.11 linux/amd64

Does this issue reproduce with the latest release?

Yes, 1.11 is the latest release.

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

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/jot/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/jot/go"
GOPROXY=""
GORACE=""
GOROOT="/home/jot/bin/go"
GOTMPDIR=""
GOTOOLDIR="/home/jot/bin/go/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-build025056307=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Create an empty directory, and copy a single main.go file.

Working: https://play.golang.org/p/sctz4PAGjf1
Breaking: https://play.golang.org/p/aZu1NZdtXel

Run go test

What did you expect to see?

The working main.go file shows the expected message [no test files].

What did you see instead?

The breaking main.go shows the error message

# runtime/cgo exec: "gcc": executable file not found in $PATH

Go 1.10.4 shows the correct message. Setting CGO_ENABLED="0" also leads to the correct message.

Using debian 9 (stretch) in a Windows Linux Subsystem.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Aug 29, 2018

Most likely a dup of #26988 and/or #27285.

@ianlancetaylor ianlancetaylor changed the title `go test` complains about missing gcc (even if no tests exist, and only for certain imports) cmd/go: `go test` complains about missing gcc (even if no tests exist, and only for certain imports) Aug 29, 2018

@FiloSottile FiloSottile added this to the Go1.12 milestone Aug 30, 2018

@palsivertsen

This comment has been minimized.

Copy link

commented Sep 13, 2018

Shouldn't this be part of Go1.11.1? Or are there any workarounds?

Running a CI pipeline is problematic when go test fails on the simplest of files:

package foo
import  _ "net/http"
@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Sep 13, 2018

This problem has been reported several times in several different bugs. We should probably try to concentrate on one issue. CC @bcmills

@bcmills

This comment has been minimized.

Copy link
Member

commented Sep 13, 2018

I'm starting with #27285 because it's easy to reproduce and leads to similar symptoms. I plan to recheck this issue once that one is resolved, in case the underlying cause is the same for both.

@bcmills

This comment has been minimized.

Copy link
Member

commented Sep 17, 2018

Pretty sure this one in particular is a dup of #26988.

@bcmills bcmills closed this Sep 17, 2018

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