Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Phase 209 — systemd-on-musl feasibility gate

At a glance

FieldValue
Phase familyPhase 2 — bootable image
Run commandmake phase 209
Underlying make target/scriptvm/phase2/check-systemd-musl.sh
Runs onhost
Main proof/artifactConfirms pinned nixpkgs can represent a musl-targeted systemd build graph.

Phase 209 checks the scary question directly:

can systemd exist in a musl-only ONIX world?

Short answer:

glibc is not a hard requirement
musl is still a risk

So we continue with systemd-on-musl. But we also do not declare victory yet.

Phase 209 does not build systemd. It does not install systemd. It does not mount the image. It does not boot QEMU.

It only checks whether the upstream and pinned-tooling story is plausible enough to keep going.

What upstream says

The current upstream systemd README lists both libc families in its requirements:

glibc >= 2.34
musl >= 1.2.6

It also says musl is used by building systemd with:

-Dlibc=musl

That means systemd-on-musl is an upstream-recognized build mode, not something we invented.

Source:

https://raw.githubusercontent.com/systemd/systemd/main/README

What our pinned nixpkgs says

Our pinned nixpkgs exposes:

pkgsMusl.systemd

The local metadata check currently reports:

name      : systemd-259.3
host libc : musl
broken    : false
flag      : -Dlibc=musl
musl      : musl 1.2.5

That means Nix can describe a musl-targeted systemd derivation for our pinned tooling.

Important nuance: current upstream main says musl >= 1.2.6, while our pinned Nix metadata reports musl 1.2.5 for systemd-259.3. That does not automatically kill the plan because the pinned package is an older systemd version, but it does mean we must treat this as a feasibility gate, not final proof.

What the pinned source says

The pinned systemd source has a Meson option:

option('libc', type : 'combo', choices : ['glibc', 'musl'])

Its Meson logic also has musl-specific handling, and it disables at least one feature that musl does not support:

utmp

That matters because it tells us musl support is not just a string in Nix. The source tree itself contains a musl path.

What the dry-run proves

make phase 209 also asks Nix to plan:

pkgsMusl.systemd

with:

nix build --dry-run

Dry-run does not compile anything. It only proves Nix can construct the build graph.

If dry-run fails, we should not continue with systemd until we understand why.

What Phase 209 proves

make phase 209 proves:

  • this Phase 209 section exists
  • upstream has a musl build mode
  • the pinned Nix package path exists as pkgsMusl.systemd
  • the pinned package is named systemd-259.3
  • the pinned package targets musl
  • the pinned package is not marked broken
  • the pinned package uses -Dlibc=musl
  • Nix can plan the build graph

This is enough to say:

continue systemd-on-musl

What Phase 209 does not prove

Phase 209 does not prove:

systemd compiles successfully in our own boulder recipe
systemd links exactly how ONIX wants
systemd starts as PID 1
udev works
networking works
services work
boot reaches login

Those are still hard problems.

The current decision is:

continue systemd-on-musl