-
Notifications
You must be signed in to change notification settings - Fork 710
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
disable use of cgo only for the ci builds #182
Conversation
Makefile
Outdated
@@ -12,7 +13,7 @@ EMBEDDED_STATIC = generated/statik/statik.go | |||
default: kubeapps | |||
|
|||
kubeapps: $(EMBEDDED_STATIC) | |||
CGO_ENABLED=0 $(GO) build -i -o $(BINARY) $(GO_FLAGS) $(IMPORT_PATH) | |||
CGO_ENABLED=$(CGO_ENABLED) $(GO) build -i -o $(BINARY) $(GO_FLAGS) $(IMPORT_PATH) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this needed? wouldn't it already be in the env?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it does not exist in the env in the default case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, but the default is CGO_ENABLED=1 right? if you ran go build
without the env var, it shouldn't try to install anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from https://golang.org/cmd/cgo/
The cgo tool is enabled by default for native builds on systems where it is expected to work. It is disabled by default when cross-compiling.
So yes, I believe we can remove it like you pointed out.
from https://golang.org/cmd/cgo/ > The cgo tool is enabled by default for native builds on systems where > it is expected to work. It is disabled by default when > cross-compiling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm - and confirmed in travis logs from go env
output that CGO_ENABLED=0.
If you set
CGO_ENABLED=0
, the go tool has to rebuild all the standard lib packages at$GOROOT
.GOROOT
may be a system path on the developer host and thus would require dev's to executemake
as aprivileged user.
This PR re-enables the use of cgo by default, while disabling it in CI builds