cmd/go: document/clarify how go env
infers CC
and CXX
when not set.
#37886
Labels
Milestone
go env
infers CC
and CXX
when not set.
#37886
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
I don't know
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I probably had
gcc-5
as the default compiler on my ubuntu system. Then I did change the default compiler (withupdate-alternative
) so thatgcc
now invokesgcc-8
(same for g++).I have some c++ code I try to bridge with cgo that relies on c++ 17. I try to build it this way
The output shows me it is using
g++-5
(and the build fails, of course).go env
also shows:Somehow,
go
does not want to use the default compiler. He might have cache somewhere the default compiler from an earlier invocation. Or it might use the compiler at the time I installedgo
(usingbrew
).What did you expect to see?
I expect the
CC/CXX
are inferred to be the default compiler of the platform.If I'm wrong, then you should clearly document how
CC/CXX
are inferred.The text was updated successfully, but these errors were encountered: