Skip to content

pipeline: install the right qemu package for the x86_64 leg - #66

Open
greatbridf wants to merge 2 commits into
masterfrom
fix/x86-pipeline
Open

greatbridf wants to merge 2 commits into
masterfrom
fix/x86-pipeline

Conversation

@greatbridf

@greatbridf greatbridf commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Summary

The x86_64 CI leg never got past setup: first Setup QEMU failed with
E: Unable to locate package qemu-system-x86_64, and once that is fixed the
build fails in build/mbr.bin with error: no such command: objcopy. Both
are missing CI dependencies, not kernel problems. The loongarch64 leg is
left exactly as it is on master (still failing its build).

Root cause

  1. Wrong QEMU package name. The workflow derives the package from the
    matrix arch, qemu-system-${{ matrix.arch }}. That only works for
    riscv64 by accident: there is no qemu-system-riscv64 package, but
    qemu-system-misc Provides: that name, so apt resolves it. For x86_64
    the generated name qemu-system-x86_64 is provided by nothing —
    qemu-system-x86 only Provides: qemu-system-amd64,
    qemu-system-x86-64 and qemu-kvm (hyphen, not underscore). apt aborts,
    and Configure, build, artifact upload and the test run are all skipped.
  2. Missing cargo objcopy. With QEMU available, the image build reaches
    make build/mbr.bin, which runs cargo objcopy. That subcommand comes
    from cargo-binutils, which CI never installs. The riscv64 leg never needed
    it because it boots the ELF kernel with -kernel.

Fix

  • Add an explicit qemu_pkg to each matrix entry (qemu-system-riscv64 for
    riscv64, qemu-system-x86 for x86_64) and install
    ${{ matrix.qemu_pkg || 'qemu-system-misc' }}. The || default keeps the
    loongarch64 leg installing a QEMU capable of running loongarch64 (as on
    master, where the alias resolved to qemu-system-misc) without touching
    that entry.
  • Install cargo-binutils before the build; llvm-tools (needed by
    cargo-objcopy) is already installed by the preceding step.
  • qemu-kvm is dropped from the install line: it only resolved as a
    Provides alias of qemu-system-x86, and the test step already forces
    QEMU_ACCEL: '', so KVM is never used.

The arch: [riscv64, loongarch64] matrix list is unchanged.

Verification

  • Ubuntu 24.04 noble main/binary-amd64 package metadata:
    • qemu-system-x86: Provides: qemu-kvm, qemu-system-amd64, qemu-system-any, qemu-system-i386, qemu-system-x86-64 — no
      qemu-system-x86_64.
    • qemu-system-misc: Provides: ... qemu-system-loongarch64, qemu-system-riscv64 ....
  • Run 40545656339 (master): riscv64 passed Setup QEMU, x86_64 failed at
    Setup QEMU.
  • Run for this branch at c2c1db0 (QEMU fix only): x86_64 Setup QEMU
    succeeded, and the build failed at build/mbr.bin with
    error: no such command: objcopy — this PR's second commit.
  • Run 40549445351 at b543cae (this branch, both commits):
    • build-and-run-test (riscv64) — success
    • build-and-run-test (x86_64, qemu-system-x86, x86_64-unknown-none, acpi_compat) — success: Setup QEMU, build, artifact upload and
      Test 7185 with ARCH=x86_64 passed all green
    • build-and-run-test (loongarch64) — still fails, at the same build step as
      on master, on eonix_hal errors (unresolved imports eonix_mm::paging::{NoAlloc, Page}, E0437/E0050/E0046 on
      RawTrapContext/TrapReturn). That is the pre-existing leg state and is
      untouched by this PR.
  • fdisk (/usr/sbin/fdisk), mkfs.fat and killall are present on the
    runner, as the successful riscv64 run shows.
  • No local build was run for this change (CI-configuration only); the runs on
    this PR are the verification.

Fixes: 731798d ("pipeline: remove loongarch64 and add x86 build and test")

The x86_64 matrix entry installs `qemu-system-x86_64`, but Ubuntu 24.04 has
no package with that name. QEMU's x86_64 emulator is shipped by
`qemu-system-x86`, which only Provides `qemu-system-amd64` and
`qemu-system-x86-64`. apt therefore aborts the setup step with
"E: Unable to locate package qemu-system-x86_64", so Configure, build,
artifact upload and the test run are all skipped.

The riscv64 leg kept working by accident: `qemu-system-riscv64` is a
Provides name of `qemu-system-misc`, so `qemu-system-$arch` happened to
resolve there.

Install the package through an explicit per-entry `qemu_pkg` field, so the
package name no longer depends on QEMU's Provides aliases. The loongarch64
leg, which is still in the matrix but has no `target`/`platform` set and
fails to build, falls back to `qemu-system-misc`.

Drop `qemu-kvm` from the install line: it only resolved as a Provides alias
of `qemu-system-x86`, and the test step already forces `QEMU_ACCEL: ''`, so
KVM is never used.

Fixes: 731798d ("pipeline: remove loongarch64 and add x86 build and test")
Signed-off-by: greatbridf <greatbridf@icloud.com>
With the QEMU step fixed, the x86_64 leg gets past Configure and fails one
step later while building the boot image:

    CARGO_TARGET_DIR=build cargo objcopy -q ... -- -O binary -j .mbr \
        build/mbr.bin
    error: no such command: `objcopy`
    make: *** [Makefile:182: build/mbr.bin] Error 101

`build/mbr.bin`, `build/stage1.bin` and `build/kernel.bin` are produced with
`cargo objcopy`, which comes from cargo-binutils. The riscv64 leg never
needed it because it boots the ELF kernel directly with `-kernel`.

Install cargo-binutils in CI. `llvm-tools` (needed by cargo-objcopy) is
already installed by the preceding step.

Fixes: 731798d ("pipeline: remove loongarch64 and add x86 build and test")
Signed-off-by: greatbridf <greatbridf@icloud.com>
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.

1 participant