-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/dist: build fails if gcc is not installed #10731
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
Comments
Most people want cgo support to be available. That means you need a C I don't see the problem with saying "If you don't have or want a C compiler On 7 May 2015 at 10:09, Dave Cheney notifications@github.com wrote:
|
Fair point. Currently the build pukes in the middle of the second stage compile. Do you have strong feelings on adding a check to cmd/dist that if cgo is enabled and gcc/$CC is not found, to abort earlier ? |
It sounds like a nice user friendly thing to do. On 7 May 2015 at 10:25, Dave Cheney notifications@github.com wrote:
|
Yeah, I think we can add that check to fail earlier and given a hint
to set CGO_ENABLED=0 if it's intended.
Note we need to check two different cases:
1. native compilation, check $CC (if non-empty) and gcc/clang in $PATH.
2. cross compilation, check $CC_FOR_TARGET (if non-empty) in $PATH.
|
This actually bit me today while setting up new builders. I agree we should fail earlier, and be helpful when failing would be nice. |
CL https://golang.org/cl/12146 mentions this issue. |
Building Go on a fresh linux/arm64 machine fails because gcc is not installed.
This might be confusing to new developers because we've made a lot of noise that we're moving away from C to Go in the 1.5 release.
The gcc build time dependency comes from cgo, and all linux/* platforms default to cgo enabled by default.
Should cmd/dist check to see if gcc (or $CC) is valid, and if not, disable cgo ?
/cc @adg @minux
The text was updated successfully, but these errors were encountered: