-
Notifications
You must be signed in to change notification settings - Fork 4.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
Do dockerized builds for minikube and localkube #1656
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1656 +/- ##
=======================================
Coverage 38.65% 38.65%
=======================================
Files 51 51
Lines 2667 2667
=======================================
Hits 1031 1031
Misses 1455 1455
Partials 181 181 Continue to review full report at Codecov.
|
Nice, this looks really good. |
Makefile
Outdated
LOCALKUBE_BUILD_IN_DOCKER=y | ||
endif | ||
|
||
ifeq ($(IN_DOCKER),1) |
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.
Maybe just a quick comment here explaining that this prevents infinite recursion, at first this reads incorrect.
Makefile
Outdated
|
||
# $(call MINIKUBE_GO_BUILD_CMD, output file, OS) | ||
define MINIKUBE_GO_BUILD_CMD | ||
$($(shell echo MINIKUBE_ENV_$(2) | tr a-z A-Z)) go build --installsuffix cgo -ldflags="$(MINIKUBE_LDFLAGS) $(K8S_VERSION_LDFLAGS)" -o $(1) k8s.io/minikube/cmd/minikube |
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.
Quick question: I accidently dropped the -a
flag to go build here, but I don't think we need it. What was the reasoning initially?
-a
force rebuilding of packages that are already up-to-date.
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.
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.
added it back
BUILD_IN_DOCKER=y will build both localkube and minikube in docker LOCALKUBE_BUILD_IN_DOCKER=y, MINIKUBE_BUILD_IN_DOCKER=y will toggle docker builds for each respective binary Regardless of the options provided, if you attempt to build localkube on a non-linux platform, it will run in docker. This ensures that `make` still works as expected on darwin.
minikube-linux-amd64 and minikube-darwin-amd64 cannot be cross built natively on different platforms and must be built in the container.
@minikube-bot retest this please |
BUILD_IN_DOCKER=y will build both localkube and minikube in docker
LOCALKUBE_BUILD_IN_DOCKER=y, MINIKUBE_BUILD_IN_DOCKER=y will toggle docker builds for each
respective binary
Regardless of the options provided, if you attempt to build localkube on a
non-linux platform, it will run in docker. This ensures that
make
still works as expected on darwin.
The only thing that I couldn't get working was the extra platform detection when cross building. So BUILD_IN_DOCKER=y is required when
make cross
. Any suggestions on how to avoid that would be greatI originally planned something like
ifneq(,$(or $(filter $(MINIKUBE_BUILD_IN_DOCKER),y),$(filter-out $(BUILD_OS),$*)))
, but automatic variables like$*
aren't expanded in GNU make conditionals.We might want to just move a lot of this to bash for simplicity and debugging.