-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
make.bash: clarify that CGO_ENABLED=0 sets default into resulting compiler #51305
Comments
This is working as intended, ref #12808 |
@seankhliao This behavior is not at all implied by the current documentation for make.bash.
That does not make it clear that it is actually going to burn a default into the resulting compiler. Probably there need to be two different flags:
Please re-open this issue. |
The current behavior is working as intended. We aren't going to change how Reopening to clarify the documentation. |
@ianlancetaylor I'd like to request that you reconsider this. Today if I build a compiler targeting linux from an Alpine image (yes I know this isn't fully supported), then my options are either:
I think it would make more sense (and be more consistent) if there were
|
I'm not opposed to adding |
We are planning some changes to the way cgo in std is handled, and it may be worth revisiting this behavior at that time. For now we should probably sit on this issue. |
For anyone looking for a workaround for the original issue, on linux/amd64 you can explicitly set |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What did you do?
Ran
CGO_ENABLED=0 ./make.bash
.What did you expect to see?
I expected it to produce a compiler (without using cgo) that abides by the documented behavior for cgo. Namely, host builds have cgo enabled by default.
What did you see instead?
The resulting compiler defaults to cgo disabled even for the host, as confirmed by
go env
.The text was updated successfully, but these errors were encountered: