Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
cmd/dist: build fails if gcc is not installed #10731
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 ?
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 firstname.lastname@example.org wrote:
It sounds like a nice user friendly thing to do.
On 7 May 2015 at 10:25, Dave Cheney email@example.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.