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 mod requires gcc when downloading dependencies when dep did not. #27810

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/logrus@v0.11.5
(2/45) Wrote github.com/satori/go.uuid@v1.2.0
(3/45) Wrote github.com/BurntSushi/toml@v0.3.0
(4/45) Wrote github.com/prometheus/client_golang@v0.8.0
(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/testify@v1.2.0
(9/45) Wrote github.com/PuerkitoBio/goquery@v1.2.0
(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/go@v1.1
(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/validator.v8@v8.18.2
(19/45) Wrote gopkg.in/alecthomas/kingpin.v2@v2.2.6
(20/45) Wrote gopkg.in/redis.v5@v5.2.9
(21/45) Wrote google.golang.org/appengine@v1.0.0
(22/45) Wrote github.com/kelseyhightower/envconfig@v1.3.0
(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/grpc@v1.9.2
(29/45) Wrote google.golang.org/genproto@master
(30/45) Wrote github.com/andybalholm/cascadia@master
(31/45) Wrote github.com/davecgh/go-spew@v1.1.0
(32/45) Wrote github.com/gin-contrib/sse@master
(33/45) Wrote cloud.google.com/go@v0.18.0
(34/45) Wrote github.com/gin-gonic/gin@v1.2
(35/45) Wrote github.com/pmezard/go-difflib@v1.0.0
(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/golang_protobuf_extensions@v1.0.0
(40/45) Wrote github.com/mattn/go-isatty@v0.0.3
(41/45) Wrote github.com/pkg/errors@v0.8.0
(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