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

[Feature Request] Let the user choose which architecture to build #160

Open
mgrzybek opened this issue Feb 3, 2023 · 0 comments
Open

[Feature Request] Let the user choose which architecture to build #160

mgrzybek opened this issue Feb 3, 2023 · 0 comments

Comments

@mgrzybek
Copy link

mgrzybek commented Feb 3, 2023

The target architecture(s) (amd64 or arm64) should be configurable.

Expected Behaviour

I would like to be able to choose which architecture I want to build without patching rules.mk.

Current Behaviour

The targets actually build both amd64 and arm64.

Possible Solution

The dirty way, patching rules.mk:

diff --git a/rules.mk b/rules.mk
index b2c5133..717e1da 100644
--- a/rules.mk
+++ b/rules.mk
@@ -22,7 +22,7 @@ ifeq ($(ARCH),aarch64)
 ARCH = arm64
 endif
 
-arches := amd64 arm64
+arches := amd64
 modes := rel dbg
 
 hook-bootkit-deps := $(wildcard hook-bootkit/*)
@@ -87,7 +87,7 @@ push-hook-bootkit push-hook-docker:
        docker buildx build --platform $$platforms --push -t $(ORG)/$(container):$T $(container)
 
 .PHONY: dist
-dist: out/$T/rel/amd64/hook.tar out/$T/rel/arm64/hook.tar ## Build tarballs for distribution
+dist: out/$T/rel/amd64/hook.tar ## Build tarballs for distribution
 dbg-dist: out/$T/dbg/$(ARCH)/hook.tar ## Build debug enabled tarball
 dist dbg-dist:
        for f in $^; do
ubuntu@factory:~/tinkerbell/hook$ git diff > ../hook.patch
ubuntu@factory:~/tinkerbell/hook$ cat ../hook.patch 
diff --git a/rules.mk b/rules.mk
index b2c5133..717e1da 100644
--- a/rules.mk
+++ b/rules.mk
@@ -22,7 +22,7 @@ ifeq ($(ARCH),aarch64)
 ARCH = arm64
 endif
 
-arches := amd64 arm64
+arches := amd64
 modes := rel dbg
 
 hook-bootkit-deps := $(wildcard hook-bootkit/*)
@@ -87,7 +87,7 @@ push-hook-bootkit push-hook-docker:
        docker buildx build --platform $$platforms --push -t $(ORG)/$(container):$T $(container)
 
 .PHONY: dist
-dist: out/$T/rel/amd64/hook.tar out/$T/rel/arm64/hook.tar ## Build tarballs for distribution
+dist: out/$T/rel/amd64/hook.tar ## Build tarballs for distribution
 dbg-dist: out/$T/dbg/$(ARCH)/hook.tar ## Build debug enabled tarball
 dist dbg-dist:
        for f in $^; do

Context

Three reasons:

  • I only need one architecture, the one I am using
  • I want to reduce my building time skipping arm64
  • I want to avoid possible building failures outside of my scope
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant