The HardenedBSD project, which focuses on enhancing the security mechanisms of FreeBSD and releasing secure builds of FreeBSD, has presented the first results of its work to enable the use of FreeBSD userland components written in Rust. This development is being carried out in a separate branch hardened/current/rust-in-base.
To utilize Rust, a new build file share/mk/bsd.rust.mk has been created, allowing applications written in Rust to be compiled during the basic system environment build (make buildworld). Userland components written in Rust are optional and reside in the FreeBSD source tree in a separate workspace. The Cargo package manager is used for building Rust applications and dependencies. All dependencies required for compiling Rust components of the base system are placed in a separate subdirectory src/vendor/rust.
At the time of writing this report, only the building and installation of Rust applications operating in user space is supported. Support for library crate packages is planned for the future. The use of Rust in the kernel is currently not supported, as such an option requires a significant amount of work and is beyond the scope of the initial prototype.
Changes to support Rust are planned for introduction into the main FreeBSD repository after reviewing the developed set of patches and implementing the core functionalities outlined in the plan. Among the initial plans are: support for crate packages containing Rust libraries, the ability to build multiple Rust applications with a single Makefile, the creation of guides for importing crate packages, and support for installing accompanying files and man pages.
Source: opennet.ru
