systemd merges initial Rust support for leaf binaries, eyes core adoption
systemd now permits Rust in leaf component binaries, with core integration blocked until Rust gains first-class shared library support.
Summary
The systemd project has merged initial support for Rust programs, marking a significant milestone for memory-safe systems programming in Linux's core infrastructure. This first phase restricts Rust to leaf components and individual binaries rather than shared libraries, as the project awaits upstream Rust improvements for shared library interoperability. Systemd lead developers Christian Brauner and Lennart Poettering, now at their new Amutable company, published a detailed blog post outlining the technical constraints and design philosophy behind this incremental adoption.
The current limitation stems from Rust's lack of first-class shared library support, which prevents integration into systemd's root components where C-based shared code remains dominant. The project has established strict design requirements including uniform API access, no-std Rust usage, optional compilation, and consistent build system integration. Brauner and Poettering explicitly called on the Rust community to address fundamental blockers like file-descriptor-centric filesystem APIs to enable deeper adoption across the Linux stack.
Rust integration constraints and design requirements in systemd
- Leaf-only restriction: Rust is currently permitted only in standalone binaries, not in shared libraries or root components, because systemd's shared code must remain C-only until Rust gains mature shared library capabilities.
- no-std requirement: The project mandates no-std Rust to maintain control over system-level interactions and avoid dependencies on Rust's standard library runtime assumptions.
- Build system uniformity: Rust compilation must integrate seamlessly with systemd's existing Meson-based build infrastructure without creating parallel or divergent build paths.
- Optional compilation: Rust components must remain optional, ensuring systemd can still be built and deployed on systems without Rust toolchain availability.
- API and behavioral parity: Rust code must provide uniform access to core systemd APIs and exhibit behavior identical to equivalent C implementations to maintain system consistency.
Why it matters
This development signals growing institutional momentum for Rust in foundational Linux infrastructure beyond the kernel itself, potentially accelerating Rust community prioritization of shared library and low-level systems APIs. For Linux distributions, the optional compilation requirement preserves packaging flexibility while allowing early adopters to begin shipping Rust-based systemd utilities. The explicit roadmap toward core component adoption, contingent on Rust language improvements, establishes a clear benchmark for when deeper integration becomes technically feasible across the broader systems software ecosystem.
Original reference: www.phoronix.com →