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 <noreply@anthropic.com>
This commit is contained in:
parent
255042fe8d
commit
b6974c6797
1 changed files with 24 additions and 4 deletions
28
Taskfile.yml
28
Taskfile.yml
|
|
@ -46,8 +46,19 @@ tasks:
|
||||||
desc: >-
|
desc: >-
|
||||||
Build a bootable install ISO from the local quine-linux image, via
|
Build a bootable install ISO from the local quine-linux image, via
|
||||||
bootc-image-builder. Output lands in {{.OUTPUT_DIR}}/bootiso/install.iso.
|
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:
|
cmds:
|
||||||
|
# Not a dep: deps run before preconditions, and this should fail fast.
|
||||||
|
- task: build-image
|
||||||
- task: export-to-storage
|
- task: export-to-storage
|
||||||
vars: { IMAGES: "{{.IMAGE}}" }
|
vars: { IMAGES: "{{.IMAGE}}" }
|
||||||
- mkdir -p {{.OUTPUT_DIR}}
|
- mkdir -p {{.OUTPUT_DIR}}
|
||||||
|
|
@ -57,7 +68,6 @@ tasks:
|
||||||
-v {{.OUTPUT_DIR}}:/output
|
-v {{.OUTPUT_DIR}}:/output
|
||||||
-v {{.STORAGE}}:/var/lib/containers/storage
|
-v {{.STORAGE}}:/var/lib/containers/storage
|
||||||
{{.BIB_IMAGE}}
|
{{.BIB_IMAGE}}
|
||||||
--target-arch {{.TARGET_ARCH}}
|
|
||||||
--type iso localhost/{{.IMAGE}}
|
--type iso localhost/{{.IMAGE}}
|
||||||
generates:
|
generates:
|
||||||
- "{{.OUTPUT_DIR}}/bootiso/install.iso"
|
- "{{.OUTPUT_DIR}}/bootiso/install.iso"
|
||||||
|
|
@ -77,8 +87,19 @@ tasks:
|
||||||
image to install the quine-linux bootc image, via
|
image to install the quine-linux bootc image, via
|
||||||
bootc-image-builder's `bootc-installer` type. Output lands in
|
bootc-image-builder's `bootc-installer` type. Output lands in
|
||||||
{{.OUTPUT_DIR}}/bootc-installer/install.iso.
|
{{.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:
|
cmds:
|
||||||
|
# Not a dep: deps run before preconditions, and this should fail fast.
|
||||||
|
- task: build-image
|
||||||
- task: build-installer-image
|
- task: build-installer-image
|
||||||
- task: export-to-storage
|
- task: export-to-storage
|
||||||
vars: { IMAGES: "{{.IMAGE}} {{.INSTALLER_IMAGE}}" }
|
vars: { IMAGES: "{{.IMAGE}} {{.INSTALLER_IMAGE}}" }
|
||||||
|
|
@ -89,7 +110,6 @@ tasks:
|
||||||
-v {{.OUTPUT_DIR}}:/output
|
-v {{.OUTPUT_DIR}}:/output
|
||||||
-v {{.STORAGE}}:/var/lib/containers/storage
|
-v {{.STORAGE}}:/var/lib/containers/storage
|
||||||
{{.BIB_IMAGE}}
|
{{.BIB_IMAGE}}
|
||||||
--target-arch {{.TARGET_ARCH}}
|
|
||||||
--type bootc-installer
|
--type bootc-installer
|
||||||
--installer-payload-ref localhost/{{.IMAGE}}
|
--installer-payload-ref localhost/{{.IMAGE}}
|
||||||
localhost/{{.INSTALLER_IMAGE}}
|
localhost/{{.INSTALLER_IMAGE}}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue