Status report on optional Rust in FreeBSD support
Shawn Webb has published a statusreport on work to provide basic support in FreeBSD for userland componentswritten in Rust.
We introduced a new BSD makefile, located at share/mk/bsd.rust.mk,that enables building a Rust application during buildworld. As of thiswriting, we only support building and installing Rustapplications. Supporting library crates is planned (we would like tobe able to build/install library crates that expose an FFI, like forC/C++ compatibility). Normal library crates build and install justfine. Support for cdylib Rust library crates specifically is what'smissing, but is desired and planned.We do NOT currently support Rust in the kernel. Kernel supportrequires more work that we deemed out-of-scope for this initialproof-of-concept/work-in-progress patchset. We also do NOT supportbuilding multiple programs in the same BSD Makefile (like withbsd.progs.mk), though that is also a desired feature.
LWN covered adiscussion about including Rust in the FreeBSD base system in August2024.