VOOZH about

URL: https://www.phoronix.com/news/Linux-6.11-Rust

⇱ Rust Is Ready With Robust Toolchain Handling For Linux 6.11 - Phoronix


👁 Phoronix

Rust Is Ready With Robust Toolchain Handling For Linux 6.11

Written by Michael Larabel in Linux Kernel on 25 July 2024 at 06:13 AM EDT. 4 Comments
Miguel Ojeda has sent out the big Rust pull request for the nearly wrapped up Linux 6.11 merge window. This contains all of the latest Rust programming language infrastructure now ready for the mainline kernel.

Most notable with this Rust pull for Linux 6.11 is maturing to the point of a minimum/base Rust toolchain version for the kernel as opposed to continuing to bump the minimum required Rust version nearly every kernel cycle. Moving forward this will make it easier to build the Rust kernel code on existing Linux distribution releases without seeing the continual need to move to a new Rust compiler version to match upstream Linux kernel requirements.

Miguel Ojeda explained in the Rust pull request for Linux 6.11:
"The highlight is the establishment of a minimum version for the Rust toolchain, including 'rustc' (and bundled tools) and 'bindgen'.

The initial minimum will be the pinned version we currently have, i.e. we are just widening the allowed versions. That covers 3 stable Rust releases: 1.78.0, 1.79.0, 1.80.0 (getting released tomorrow), plus beta, plus nightly.

This should already be enough for kernel developers in distributions that provide recent Rust compiler versions routinely, such as Arch Linux, Debian Unstable (outside the freeze period), Fedora Linux, Gentoo Linux (especially the testing channel), Nix (unstable) and openSUSE Slowroll and Tumbleweed.

In addition, the kernel is now being built-tested by Rust's pre-merge CI. That is, every change that is attempting to land into the Rust compiler is tested against the kernel, and it is merged only if it passes. Similarly, the bindgen tool has agreed to build the kernel in their CI too.

Thus, with the pre-merge CI in place, both projects hope to avoid unintentional changes to Rust that break the kernel. This means that, in general, apart from intentional changes on their side (that we will need to workaround conditionally on our side), the upcoming Rust compiler versions should generally work.

In addition, the Rust project has proposed getting the kernel into stable Rust (at least solving the main blockers) as one of its three flagship goals for 2024H2."

See the Rust pull request for more details. In addition to the support for multiple Rust toolchain and bindgen versions, there are also improvements to the kernel crate, improved documentation, and other changes.

👁 Rust for Linux logo


Separately, Greg Kroah-Hartman overnight sent out the driver core pull request. Notable with the driver core updates for Linux 6.11 are the Rust bindings for basic firmware APIs and initial driver core interactions. This will help in the effort of being able to create more useful Rust kernel drivers.

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.