NewsCrawler.org

systemd merges optional support for Rust programs

systemd has merged PR #44324 by Christian Brauner, which adds optional support for programs written in Rust. The libraries libsystemd-shared and libsystemd and the NSS and PAM modules stay in C, and Rust programs link libsystemd-shared dynamically just like the C programs do; the Rust code is built against the core library only, without the standard library, the alloc crate or any external crates. Building the Rust parts requires rustc 1.85 or newer and bindgen[1] 0.71.1 or newer — exactly the versions Debian 13 ships — plus meson 1.4.0; the option defaults to auto and is used only when the toolchain is found, and cross-compilation is not supported yet. A crate generated by bindgen at build time gives Rust code raw FFI[2] bindings to everything libsystemd-shared exports, using the same headers and compiler flags as the library itself. The lint set is taken from the Linux kernel: every unsafe block[3] needs a SAFETY comment, public items need documentation, overflow checks are enabled in every build type, and everything is built with panic=abort[4].

Read the original github.comDiscussion

Sources

Published: First seen: Читать по-русски

Open as a page