Skip to content

Build images for the other architecture - #48

Merged
The127 merged 27 commits into
mainfrom
cross-arch
Oct 11, 2026
Merged

The127 merged 27 commits into
mainfrom
cross-arch

Conversation

@The127

@The127 The127 commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

miso build --arch now takes amd64 and arm64 on both hosts. miso plan and miso shell take --arch too.

How it works:

  • The builder VM runs on the host architecture with KVM.
  • Programs of the target architecture run through QEMU user mode. miso fetches Debian's static qemu-user package by digest and registers it with binfmt_misc in the builder VM.
  • A CHECK of an image for the other architecture boots on TCG.
  • Base images, layer keys and the EFI loader and stub follow the target architecture.
  • RUN and shell get TARGETARCH in their environment.
  • The deb and rpm packages recommend the qemu-system package of the other architecture.

Not tested on real hardware yet: RUN steps under QEMU user mode, and a TCG check of a full disk.

Docs: I checked them and updated cli.md, imagefile.md, base-images.md, checks.md and caching.md.

Closes #31

BEGIN_COMMIT_OVERRIDE
feat: build images for the other architecture
END_COMMIT_OVERRIDE

The127 and others added 27 commits October 11, 2026 12:08
KVM runs only machines of the host's architecture, so the check of an
image built for another one boots on TCG and says why.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: karo <karolin.kostial@gmail.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: karo <karolin.kostial@gmail.com>
A scratch stage has no base digest, so without the architecture in the
key an amd64 and an arm64 build would share its layers.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: karo <karolin.kostial@gmail.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: karo <karolin.kostial@gmail.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: karo <karolin.kostial@gmail.com>
The image may be of another architecture than the builder VM the agent
runs on, so the request names it.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: karo <karolin.kostial@gmail.com>
TARGETARCH lets one Imagefile install the kernel of either architecture.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: karo <karolin.kostial@gmail.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: karo <karolin.kostial@gmail.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: karo <karolin.kostial@gmail.com>
…mu-user package

The builder VM runs the programs of an image of another architecture
through it.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: karo <karolin.kostial@gmail.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: karo <karolin.kostial@gmail.com>
…tramfs

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: karo <karolin.kostial@gmail.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: karo <karolin.kostial@gmail.com>
They are registered as Debian registers its qemu-user, through a name
that keeps a program's argv[0], and opened right away, so a run in its
own root has them too.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: karo <karolin.kostial@gmail.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: karo <karolin.kostial@gmail.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: karo <karolin.kostial@gmail.com>
…s for

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: karo <karolin.kostial@gmail.com>
The builder VM keeps running on the host's architecture, on KVM. The
steps of the image run through QEMU in user mode and its checks boot on
TCG.

Closes #31

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: karo <karolin.kostial@gmail.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: karo <karolin.kostial@gmail.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: karo <karolin.kostial@gmail.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: karo <karolin.kostial@gmail.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: karo <karolin.kostial@gmail.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: karo <karolin.kostial@gmail.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: karo <karolin.kostial@gmail.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: karo <karolin.kostial@gmail.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: karo <karolin.kostial@gmail.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: karo <karolin.kostial@gmail.com>
@codecov

codecov Bot commented Oct 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.10%. Comparing base (0f52bd5) to head (6acab10).

Files with missing lines Patch % Lines
internal/boot/emulators.go 44.00% 14 Missing ⚠️
internal/boot/boot.go 0.00% 3 Missing ⚠️
internal/emulator/ready.go 83.33% 3 Missing ⚠️
internal/agent/parts.go 33.33% 2 Missing ⚠️
internal/boot/root.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #48      +/-   ##
==========================================
+ Coverage   55.35%   56.10%   +0.74%     
==========================================
  Files         286      288       +2     
  Lines        4702     4761      +59     
==========================================
+ Hits         2603     2671      +68     
+ Misses       2099     2090       -9     
Flag Coverage Δ
unit 56.10% <66.66%> (+0.74%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@The127
The127 merged commit 56ff891 into main Oct 11, 2026
9 checks passed
@The127
The127 deleted the cross-arch branch October 11, 2026 10:11
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

Successfully merging this pull request may close these issues.

miso cannot build an image for another CPU architecture

1 participant