News: 0001481198

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

Rust Is Ready With Robust Toolchain Handling For Linux 6.11

([Linux Kernel] 6 Hours Ago Linux 6.11 Rust)


Miguel Ojeda has sent out the big Rust pull request for the nearly wrapped up [1]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 [2]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 [3]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.

Separately, Greg Kroah-Hartman overnight sent out the [4]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.



[1] https://www.phoronix.com/search/Linux+6.11

[2] https://www.phoronix.com/news/Linux-Patches-Multiple-Rust-Ver

[3] https://lore.kernel.org/lkml/20240725013244.69532-1-ojeda@kernel.org/

[4] https://lore.kernel.org/lkml/ZqIAf1uDky0nvwiC@kroah.com/



phoronix

Non-Reciprocal Laws of Expectations:
Negative expectations yield negative results.
Positive expectations yield negative results.