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 build should give a warning when is cgo has been disabled #5190

Closed
davecheney opened this issue Apr 3, 2013 · 2 comments
Closed

Comments

@davecheney
Copy link
Contributor

https://code.google.com/p/go/source/detail?r=139b5fe32880b8c9b3c705f6435b359f09f0a255
disabled cgo by default when cross compiling. 

The go tool should be enhanced to give a warning (probably not by default, possibly in a
verbose mode), when cgo has been disabled and give a hint on how to override.

See also: https://golang.org/cl/8134043#msg13
@davecheney
Copy link
Contributor Author

Comment 1:

Labels changed: added go1.2maybe.

@rsc
Copy link
Contributor

rsc commented Sep 10, 2013

Comment 2:

I disagree. You want a warning because you don't want it disabled.
But when I cross-compile I am happy to have it disabled automatically,
because otherwise my build would fail entirely. I don't want to see
a warning telling me about something that, if it weren't true, would cause
even more problems.
One could imagine trying to second-guess a build failure and say well
if cgo was implicitly disabled and there are cgo files then maybe we 
could say (cgo is disabled) somewhere. But there's no guarantee that the
problem is cgo being disabled and not, say, a syntax error in the non-cgo
version of the code. It's very hard to be sure the added text is helping and
not confusing things more.
I also don't see why cgo should be different from all the other possible build
constraints.

Status changed to Unfortunate.

@rsc rsc added this to the Go1.2 milestone Apr 14, 2015
@rsc rsc removed the go1.2maybe label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
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