Skip to content

cmd/go: go mod requires gcc when downloading dependencies when dep did not. #27810

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

Closed
tevjef opened this issue Sep 22, 2018 · 1 comment
Closed

Comments

@tevjef
Copy link

tevjef commented Sep 22, 2018

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

go version go1.11 linux/amd64

Does this issue reproduce with the latest release?

yes

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

+ 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="/go/src/github.com/tevjef/uct-backend/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=/tmp/go-build807384563=/tmp/go-build -gno-record-gcc-switches"

What did you do?

While updating my project fromdep to the new module system, I now see a requirement where the wasn't before on gcc. In my build environment, go [test|build] commands fails because gcc is not in my build environment's PATH.

dep vendoring logs (go1.10beta2 linux/amd64)
dep ensure -v
Gopkg.lock was already in sync with imports and Gopkg.toml
(1/45) Wrote github.com/Sirupsen/[email protected]
(2/45) Wrote github.com/satori/[email protected]
(3/45) Wrote github.com/BurntSushi/[email protected]
(4/45) Wrote github.com/prometheus/[email protected]
(5/45) Wrote github.com/prometheus/client_model@master
(6/45) Wrote github.com/prometheus/common@master
(7/45) Wrote github.com/prometheus/procfs@master
(8/45) Wrote github.com/stretchr/[email protected]
(9/45) Wrote github.com/PuerkitoBio/[email protected]
(10/45) Wrote gopkg.in/yaml.v2@v2
(11/45) Wrote github.com/tevjef/go-fcm@master
(12/45) Wrote github.com/robfig/go-cache@master
(13/45) Wrote github.com/ugorji/[email protected]
(14/45) Wrote github.com/tevjef/go-runtime-metrics@master
(15/45) Wrote golang.org/x/oauth2@master
(16/45) Wrote golang.org/x/time@master
(17/45) Wrote golang.org/x/sync@master
(18/45) Wrote gopkg.in/go-playground/[email protected]
(19/45) Wrote gopkg.in/alecthomas/[email protected]
(20/45) Wrote gopkg.in/[email protected]
(21/45) Wrote google.golang.org/[email protected]
(22/45) Wrote github.com/kelseyhightower/[email protected]
(23/45) Wrote golang.org/x/net@master
(24/45) Wrote github.com/alecthomas/template@master
(25/45) Wrote github.com/alecthomas/units@master
(26/45) Wrote golang.org/x/sys@master
(27/45) Wrote github.com/beorn7/perks@master
(28/45) Wrote google.golang.org/[email protected]
(29/45) Wrote google.golang.org/genproto@master
(30/45) Wrote github.com/andybalholm/cascadia@master
(31/45) Wrote github.com/davecgh/[email protected]
(32/45) Wrote github.com/gin-contrib/sse@master
(33/45) Wrote cloud.google.com/[email protected]
(34/45) Wrote github.com/gin-gonic/[email protected]
(35/45) Wrote github.com/pmezard/[email protected]
(36/45) Wrote github.com/jmoiron/sqlx@de8647470aafe4854c976707c431dbe1eb2822c6
(37/45) Wrote github.com/golang/protobuf@master
(38/45) Wrote github.com/lib/pq@83612a56d3dd153a94a629cd64925371c9adad78
(39/45) Wrote github.com/matttproud/[email protected]
(40/45) Wrote github.com/mattn/[email protected]
(41/45) Wrote github.com/pkg/[email protected]
(42/45) Wrote github.com/pquerna/ffjson@d49c2bc1aa135aad0c6f4fc2056623ec78f5d5ac
(43/45) Wrote golang.org/x/text@master
(44/45) Wrote github.com/gogo/protobuf@909568be09de550ed094403c2bf8a261b5bb730a
(45/45) Wrote google.golang.org/api@master
go mod vendoring logs
go test github.com/tevjef/uct-backend/ein/...
go: finding github.com/pmezard/go-difflib v1.0.0
go: finding github.com/prometheus/client_golang v0.8.0
go: finding github.com/pkg/errors v0.8.0
go: finding github.com/tevjef/go-fcm v0.0.0-20180107005934-84e4deb7d3da
go: finding github.com/ugorji/go v0.0.0-20180112141927-9831f2c3ac10
go: finding github.com/davecgh/go-spew v1.1.0
go: finding golang.org/x/oauth2 v0.0.0-20180118004544-b28fcf2b08a1
go: finding golang.org/x/sys v0.0.0-20180125145336-03467258950d
go: finding golang.org/x/text v0.0.0-20171227012246-e19ae1496984
go: finding github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc
go: finding github.com/gogo/protobuf v0.0.0-20160824171236-909568be09de
go: finding github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf
go: finding cloud.google.com/go v0.18.0
go: finding golang.org/x/sync v0.0.0-20171101214715-fd80eb99c8f6
go: finding github.com/tevjef/go-runtime-metrics v0.0.0-20170326170900-527a54029307
go: finding github.com/stretchr/testify v1.2.0
go: finding gopkg.in/yaml.v2 v2.0.0
go: finding github.com/Sirupsen/logrus v0.11.5
go: finding github.com/matttproud/golang_protobuf_extensions v1.0.0
go: finding github.com/gin-gonic/gin v0.0.0-20170702092826-d459835d2b07
go: finding github.com/mattn/go-isatty v0.0.3
go: finding github.com/robfig/go-cache v0.0.0-20130306151617-9fc39e0dbf62
go: finding gopkg.in/go-playground/validator.v8 v8.18.2
go: finding github.com/prometheus/common v0.0.0-20180110214958-89604d197083
go: finding github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7
go: finding github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a
go: finding golang.org/x/time v0.0.0-20170927054726-6dc17368e09b
go: finding google.golang.org/grpc v1.9.2
go: finding github.com/PuerkitoBio/goquery v1.2.0
go: finding gopkg.in/alecthomas/kingpin.v2 v2.2.6
go: finding github.com/kelseyhightower/envconfig v1.3.0
go: finding github.com/satori/go.uuid v1.2.0
go: finding google.golang.org/genproto v0.0.0-20180125080656-4eb30f4778ee
go: finding github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7
go: finding google.golang.org/api v0.0.0-20180126000317-61a5611191ce
go: finding github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5
go: finding gopkg.in/redis.v5 v5.2.9
go: finding github.com/jmoiron/sqlx v0.0.0-20171211234905-de8647470aaf
go: finding github.com/andybalholm/cascadia v0.0.0-20161224141413-349dd0209470
go: finding github.com/pquerna/ffjson v0.0.0-20171002144729-d49c2bc1aa13
go: finding github.com/lib/pq v0.0.0-20171126050459-83612a56d3dd
go: finding github.com/BurntSushi/toml v0.3.0
go: finding google.golang.org/appengine v1.0.0
go: finding golang.org/x/net v0.0.0-20180124060956-0ed95abb35c4
go: finding github.com/golang/protobuf v1.0.0
go: downloading github.com/Sirupsen/logrus v0.11.5
go: downloading github.com/pquerna/ffjson v0.0.0-20171002144729-d49c2bc1aa13
go: downloading gopkg.in/redis.v5 v5.2.9
go: downloading github.com/lib/pq v0.0.0-20171126050459-83612a56d3dd
go: downloading github.com/jmoiron/sqlx v0.0.0-20171211234905-de8647470aaf
go: downloading github.com/pkg/errors v0.8.0
go: downloading github.com/gogo/protobuf v0.0.0-20160824171236-909568be09de
go: downloading gopkg.in/alecthomas/kingpin.v2 v2.2.6
go: downloading github.com/tevjef/go-runtime-metrics v0.0.0-20170326170900-527a54029307
go: downloading github.com/prometheus/client_golang v0.8.0
go: downloading github.com/BurntSushi/toml v0.3.0
go: downloading github.com/kelseyhightower/envconfig v1.3.0
go: downloading github.com/golang/protobuf v1.0.0
go: downloading github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5
go: downloading github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7
go: downloading github.com/prometheus/common v0.0.0-20180110214958-89604d197083
go: downloading github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc
go: downloading github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf
go: downloading github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a
go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.0
# runtime/cgo
exec: "gcc": executable file not found in $PATH

What did you expect to see?

I expect go mod to not require gcc.

What did you see instead?

go mod required when downloading/vendoring dependencies gcc when dep did not.

What did I do to fix it?

Setting CGO_ENABLED=0

@ALTree
Copy link
Member

ALTree commented Sep 22, 2018

Thanks for the report.

This is a dup of #26988. See the discussion there for a little bit of background on the issue. This is being investigated, so I'm closing here as a dup.

@ALTree ALTree closed this as completed Sep 22, 2018
@golang golang locked and limited conversation to collaborators Sep 22, 2019
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

3 participants