The HardenedBSD project, known for enhancing FreeBSD’s security mechanisms and producing secure FreeBSD builds, has recently revealed the initial outcomes of incorporating components of user space FreeBSD written in Rust. This development is progressing in a separate branch called hardened/current/rust-in-base.
To enable this functionality, a new assembly file named SHARE/MK/bsd.rust.mk was crafted in RUST, allowing for the compilation of rust applications when building the base system (Make BuildWorld). The user space components in Rust are optional and housed in a distinct working space within the FreeBSD source code. The Cargo package manager is utilized during the compilation of RUST applications and their dependencies, with all necessary dependencies for assembling these components stored in a separate sub-catalog SRC/Vendor/Rust.
As of now, the current focus is solely on assembling and installing RUST applications that operate in the user space. Plans are underway to extend support to library Crate packages in the future. However, integrating Rust into the kernel is a more complex task that requires substantial effort and surpasses the scope of the current prototype.
Future enhancements to support RUST are expected to be proposed for inclusion in FreeBSD’s main distribution after thorough testing of the developed set of patches and implementation of the core functionalities outlined. Initial plans include supporting Crate packages containing Rust libraries, enabling the compilation of multiple RUST applications using a single MakeFile, creating instructions for importing Crate packages, and facilitating the installation of associated files and man-pages.