go: x/playground: exec: "gcc": executable file not found in $PATH
I’m getting errors looking for gcc (!?) on the playground:
https://play.golang.org/p/5GlPtcESJm
# net
exec: "gcc": executable file not found in $PATH
Go vet exited.
/cc @andybons
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 16 (15 by maintainers)
In the execution of cmd/compile,
CGO_ENABLED=1is being passed becauseMkEnvin cmd/go/internal/envcmd/env.go is seeing thatcfg.BuildContext.CgoEnabledistrue. The setting there gets put into the environment by code in cmd/go/main.go.cfg.BuildContextis initialized frombuild.Defaultin the go/build package.build.Defaultis set fromdefaultContextin go/build/build.go. There you can see thatCgoEnabledis set from the value in zcgo.go which should reflect the setting ofCGO_ENABLEDat the time that the package was built.