The Linux Kernel Preparing For An Upgrade To Its Rust Toolchain

Written by Michael Larabel in Linux Kernel on 19 April 2023 at 08:38 AM EDT. 9 Comments
LINUX KERNEL
Linux kernel developers are preparing for the first upgrade to its Rust toolchain since the Rust code initially merged in Linux 6.1.

The code initially merged back in Linux 6.1 and continuing to this day is targeting Rust 1.62 while the plan is to upgrade to the current latest stable release, Rust 1.68.2.

As for this big upgrade to the Rust code in the mainline Linux kernel, the patch message by Miguel Ojeda explains:
"The kernel currently supports only a single Rust version (rather than a minimum) given our usage of some "unstable" Rust features which do not promise backwards compatibility.

The goal is to reach a point where we can declare a minimum version for the toolchain. For instance, by waiting for some of the features to be stabilized. Therefore, the first minimum Rust version that the kernel will support is "in the future".

# Upgrade policy

Given we will eventually need to reach that minimum version, it would be ideal to upgrade the compiler from time to time to be as close as possible to that goal and find any issues sooner. In the extreme, we could upgrade as soon as a new Rust release is out. Of course, upgrading so often is in stark contrast to what one normally would need for GCC and LLVM, especially given the release schedule: 6 weeks for Rust vs. half a year for LLVM and a year for GCC.

Having said that, there is no particular advantage to updating slowly either: kernel developers in "stable" distributions are unlikely to be able to use their distribution-provided Rust toolchain for the kernel anyway. Instead, by routinely upgrading to the latest instead, kernel developers using Linux distributions that track the latest Rust release may be able to use those rather than Rust-provided ones, especially if their package manager allows to pin / hold back / downgrade the version for some days during windows where the version may not match. For instance, Arch, Fedora, Gentoo and openSUSE all provide and track the latest version of Rust as they get released every 6 weeks.

Then, when the minimum version is reached, we will stop upgrading and decide how wide the window of support will be. For instance, a year of Rust versions. We will probably want to start small, and then widen it over time, just like the kernel did originally for LLVM."

More details on this formulated upgrade policy in the third patch.


Thus with this patch series is the kernel upgrade to Rust 1.68.2.
Related News
About The Author
Michael Larabel

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.

Popular News This Week