Skip to content

Go test complains gcc is missing when importing net/http #27639

Closed
@palsivertsen

Description

@palsivertsen

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

Tested using the docker image golang:1-alpine (233ed4ed14bf)

/go/src/foo # go version
go version go1.11 linux/amd64

Does this issue reproduce with the latest release?

Yes go1.11

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

/go/src/foo # go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/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-build067204781=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Create project foo
Add file bar.go

package main

import  _ "net/http"

Other imports would probably give similar results.

What did you expect to see?

/go/src/foo # go test ./...
?   	foo	[no test files]

What did you see instead?

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

Related issues

#27303

Activity

ianlancetaylor

ianlancetaylor commented on Sep 12, 2018

@ianlancetaylor
Contributor

I'm going to close this as a dup of #27303 (as you mention), #26988 and/or #27285. Please comment if you disagree.

locked and limited conversation to collaborators on Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ianlancetaylor@gopherbot@palsivertsen

        Issue actions

          Go test complains gcc is missing when importing net/http · Issue #27639 · golang/go