systemd merges Rust support for leaf binaries, but keeps core shared library C-only
systemd has merged support for Rust, making it possible to write systemd components in Rust in addition to C. The project distinguishes two options: Rust in leaf components (individual binaries), which is accepted, and Rust in the root libsystemd-shared.so shared library, which is currently rejected. Root integration is blocked by Rust's "stable ABI problem" — the lack of first-class shared library support — since without it every shared library and many binaries would be bloated by duplicated Rust code. Static linking is impractical for systemd, which is split into more than 180 binaries.
The approach adopted wraps the C shared code as Rust crates used by Rust binaries, giving uniform access to core APIs. The project adopted key principles: binaries in C and Rust must behave identically in option parsing, help output and error messages; systemd builds Rust with meson rather than cargo, citing security and supply-chain concerns; dependencies are kept strictly loose (currently only libc, everything else loaded via dlopen()); and no external crates are accepted yet. systemd also avoids the Rust standard library (no-std), provides its own allocator crate so all allocations are treated as fallible instead of panicking, forbids gratuitous rewrites of stable C code without good reason, and keeps Rust fully optional for users on architectures it does not support.
The authors note that systemd would like to see Rust in core components and hopes to engage with the Rust community on blockers such as shared library support and fd-based filesystem interaction. They cite the community's quick revert of a change in Rust 1.100 that would have broken the new systemd support as encouraging.
Read the original amutable.comDiscussion
Discussion
Commenters largely react with jokes and mixed feelings rather than technical debate. Some question the no-std decision, pointing out that basics like `Vec` are unavailable without the standard library, while others joke about rewrite announcements and who actually loves systemd.
Sources
-
amutable.com
Systemd Loves Rust
OriginalDiscussion · 111Discussion · 24Discussion · 17Discussion
Terms
- stable ABI problem — Rust's lack of a guaranteed stable application binary interface, which prevents Rust code from being compiled into shared libraries usable across different compiler versions.
- dlopen() — A function that loads a shared library at runtime, letting a program use optional dependencies without linking them at build time.
- no-std — A mode of Rust in which the standard library is not used,typically for constrained environments where its features are unavailable or undesired.


