Problem
nihil build fails on ARM64 hosts (Apple Silicon, ARM Linux).
_cmd_build shells out to docker build with no --platform flag (nihil/cli/controller.py:1217), and all our Dockerfiles are based on FROM archlinux:latest, which upstream publishes for linux/amd64 only. On an ARM64 host the build aborts while resolving the base image, with the same error #5 fixed for pulls:
no matching manifest for linux/arm64/v8 in the manifest list entries
This is the third code path needing an explicit platform hint. #5 covered the other two (image pull and container creation) but deliberately scoped build out.
Suggested fix
Reuse get_image_platform(), added in #5, in _cmd_build when assembling the docker build argv:
image_platform = get_image_platform()
if image_platform:
cmd += ["--platform", image_platform]
Note that the same import-cycle constraint applies as in manager.py: import get_image_platform inside the function, not at module scope, otherwise nihil.utils -> doctor -> nihil.manager becomes circular.
Acceptance
nihil build <variant> completes on an ARM64 host with emulation available (Rosetta or QEMU).
- Behaviour on amd64 hosts is unchanged, no
--platform passed.
- Unit test asserting the flag is present on ARM and absent on amd64, mirroring the existing tests in
tests/test_nihilManager.py.
Notes
Worth checking whether nihil build --tag and the blueteam / test variants need anything beyond this.
@whiteov3rflow this follows on from your #5 and you already have the ARM setup to verify it, so it's yours if you want it. No obligation either way.
Problem
nihil buildfails on ARM64 hosts (Apple Silicon, ARM Linux)._cmd_buildshells out todocker buildwith no--platformflag (nihil/cli/controller.py:1217), and all our Dockerfiles are based onFROM archlinux:latest, which upstream publishes forlinux/amd64only. On an ARM64 host the build aborts while resolving the base image, with the same error #5 fixed for pulls:This is the third code path needing an explicit platform hint. #5 covered the other two (image pull and container creation) but deliberately scoped
buildout.Suggested fix
Reuse
get_image_platform(), added in #5, in_cmd_buildwhen assembling thedocker buildargv:Note that the same import-cycle constraint applies as in
manager.py: importget_image_platforminside the function, not at module scope, otherwisenihil.utils->doctor->nihil.managerbecomes circular.Acceptance
nihil build <variant>completes on an ARM64 host with emulation available (Rosetta or QEMU).--platformpassed.tests/test_nihilManager.py.Notes
Worth checking whether
nihil build --tagand theblueteam/testvariants need anything beyond this.@whiteov3rflow this follows on from your #5 and you already have the ARM setup to verify it, so it's yours if you want it. No obligation either way.