systemd has added the ability to develop components in the Rust language

The codebase of the system manager systemd is updated to add the capability to create components in the Rust language. Rust will only be used for the development of new components, and there are no plans to rewrite existing code in C to Rust. The package manager cargo is not used in the build process, with only the Meson build system remaining in use. Rust code is utilized in 'no_std' mode (without the standard library), allowing only the libraries core, alloc, and libc.

Systemd components in Rust are dynamically linked with the C library libsystemd-shared. Rust bindings over libsystemd-shared are generated automatically at build time from header files using the bindgen utility, and become available for Rust programs in the form of the systemd_shared package. At least rustc 1.85 and bindgen 0.71.1, corresponding to the versions in Debian 13, are required to work.

A test executable in Rust built with LTO optimizations occupies 32 KB, while the equivalent in C takes up 20 KB. By default, support for Rust is enabled only if the corresponding Rust toolchain is available in the system (-Drust=auto). The first component being developed in Rust is systemd-keyring-setup, which has not yet been accepted into the main systemd codebase. Systemd-keyring-setup is intended for configuring and managing X.509 certificates for the Linux kernel mechanisms dm-verity, fs-verity, and bpf.

Source: opennet.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster