From b6974c6797d9e485b6a8b28b85431f80443400a6 Mon Sep 17 00:00:00 2001 From: Philip Peterson <1326208+philip-peterson@users.noreply.github.com> Date: Sun, 27 Sep 2026 06:27:25 -0800 Subject: [PATCH] Fail ISO builds fast on a non-x86_64 host bootc-image-builder's --target-arch cross build fails late on Apple Silicon (its lsinitrd step runs the amd64 image, which needs qemu-user inside its container). Check the host arch up front, before the long image builds, and drop --target-arch since only native builds are supported now. Co-Authored-By: Claude Opus 5.5 --- Taskfile.yml | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index b47762e..2bdb360 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -46,8 +46,19 @@ tasks: desc: >- Build a bootable install ISO from the local quine-linux image, via bootc-image-builder. Output lands in {{.OUTPUT_DIR}}/bootiso/install.iso. - deps: [build-image] + preconditions: + - sh: | + case "$(uname -m)" in x86_64|amd64) a=amd64 ;; aarch64|arm64) a=arm64 ;; *) a="$(uname -m)" ;; esac + [ "$a" = "{{.TARGET_ARCH}}" ] + msg: >- + ISO builds need a host of architecture {{.TARGET_ARCH}}. This one is + {{ARCH}}, and bootc-image-builder's cross-arch mode fails partway + (it runs the image for inspection, which needs emulation inside + its own container). Build the ISO on an x86_64 machine, e.g. the + Aurora box. cmds: + # Not a dep: deps run before preconditions, and this should fail fast. + - task: build-image - task: export-to-storage vars: { IMAGES: "{{.IMAGE}}" } - mkdir -p {{.OUTPUT_DIR}} @@ -57,7 +68,6 @@ tasks: -v {{.OUTPUT_DIR}}:/output -v {{.STORAGE}}:/var/lib/containers/storage {{.BIB_IMAGE}} - --target-arch {{.TARGET_ARCH}} --type iso localhost/{{.IMAGE}} generates: - "{{.OUTPUT_DIR}}/bootiso/install.iso" @@ -77,8 +87,19 @@ tasks: image to install the quine-linux bootc image, via bootc-image-builder's `bootc-installer` type. Output lands in {{.OUTPUT_DIR}}/bootc-installer/install.iso. - deps: [build-image] + preconditions: + - sh: | + case "$(uname -m)" in x86_64|amd64) a=amd64 ;; aarch64|arm64) a=arm64 ;; *) a="$(uname -m)" ;; esac + [ "$a" = "{{.TARGET_ARCH}}" ] + msg: >- + ISO builds need a host of architecture {{.TARGET_ARCH}}. This one is + {{ARCH}}, and bootc-image-builder's cross-arch mode fails partway + (it runs the image for inspection, which needs emulation inside + its own container). Build the ISO on an x86_64 machine, e.g. the + Aurora box. cmds: + # Not a dep: deps run before preconditions, and this should fail fast. + - task: build-image - task: build-installer-image - task: export-to-storage vars: { IMAGES: "{{.IMAGE}} {{.INSTALLER_IMAGE}}" } @@ -89,7 +110,6 @@ tasks: -v {{.OUTPUT_DIR}}:/output -v {{.STORAGE}}:/var/lib/containers/storage {{.BIB_IMAGE}} - --target-arch {{.TARGET_ARCH}} --type bootc-installer --installer-payload-ref localhost/{{.IMAGE}} localhost/{{.INSTALLER_IMAGE}}