Systemd today finally merged support for building against and using the musl libc library. This is a win for Linux distributions like postmarketOS, Alpine Linux, and others that use musl by default as their standard C library or offer it as an option.
Since September has been a pull request for experimental support for building systemd with musl libc. This requires a new version of musl with a recent patch, which has been backported to some distributions like Alpine Linux and postmarketOS, in order to use musl as an alternative to glibc.
Red Hat engineer Zbigniew Jędrzejewski-Szmek commented today when merging the code:
“I’ll go ahead and merge this. It all does seem fairly fragile, so I’m a bit worried that maintenance will be a problem. But the only way to verify this is to merge this and let people play with it.
I spent some time repeating the build with musl locally on Fedora, and that part works well enough. But I couldn’t get the tests to run without a container. That part is a bit annoying — we really need to have a simple local workflow for development. But at least compilation works, so maybe it won’t be so bad.
Compilation and unit tests pass in the CI, which is good enough for now.”
Developers with postmarketOS have offered to help maintain the musl libc support to address some of the concerns around the fragility of the code.
This initial musl libc support is merged and will be found in the release next year with systemd 259.
