Skip to content

Commit a525428

Browse files
committed
Rust version policy: update now that a minimum was established
Signed-off-by: Miguel Ojeda <[email protected]>
1 parent ede7bef commit a525428

File tree

1 file changed

+20
-26
lines changed

1 file changed

+20
-26
lines changed

src/Rust-version-policy.md

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,36 @@
22

33
## Supported versions
44

5-
The kernel documents the [minimal requirements](https://docs.kernel.org/process/changes.html) to compile it. In the case of Rust, currently only a single version is supported (i.e. rather than a minimum):
5+
The kernel documents the [minimal requirements](https://docs.kernel.org/process/changes.html) to compile it. Since v6.11, the kernel supports a minimum version of Rust, starting with Rust 1.78.0.
66

7-
> A particular version of the Rust toolchain is required. Newer versions may or may not work because the kernel depends on some unstable Rust features, for the moment.
7+
For the moment, we cannot guarantee newer Rust versions will always work due to the [unstable features](Unstable-features.md) in use[^rust-is-stable]. Removing the need for them is a priority of the project.
88

9-
The reason is that we cannot guarantee newer Rust versions will work due to the [unstable features](Unstable-features.md) in use[^rust-is-stable]. Removing the need for them is a priority in order to be able to eventually declare a minimum Rust version for the kernel.
9+
To ameliorate that, 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.
1010

11-
Having said that, generally speaking, newer versions should work, as long as one patches any potential compilation errors coming from changes in unstable features.
11+
Thus, with the pre-merge CI in place, those 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
12+
compiler versions should generally work. This applies to beta and nightly versions of Rust as well.
1213

13-
[^rust-is-stable]: Note that the Rust language is stable, i.e. it promises backwards compatibility. See the [Unstable features](Unstable-features.md) page for details.
14+
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](https://rust-lang.github.io/rust-project-goals/2024h2/index.html#flagship-goals).
1415

15-
### Distribution toolchains
16+
[^rust-is-stable]: To clarify, the Rust language is stable, i.e. it promises backwards compatibility, except for those unstable features.
1617

17-
Some Linux distributions provide Rust toolchains (i.e. built by the distribution maintainers, rather than redistributing the ones from [rust-lang.org](https://www.rust-lang.org)). These toolchains should be fine to use, as long as they have not been modified in unexpected ways (and keeping in mind the versioning limitations).
18+
## Supported toolchains
1819

19-
## Update policy
20+
The Rust versions currently supported should already be enough for kernel developers in distributions that provide recent Rust compilers routinely, such as:
2021

21-
### Before a minimum version can be declared
22+
- Arch Linux.
23+
- Debian Testing and Unstable (outside the freeze period).
24+
- Fedora Linux.
25+
- Gentoo Linux.
26+
- Nix (unstable).
27+
- openSUSE Slowroll and Tumbleweed.
2228

23-
It remains to be decided how often the Rust version upgrades will land. Currently, we are tracking the latest Rust release as closely as possible, but it remains to be seen how other kernel developers feel about it.
29+
In addition, we support the toolchains distributed by Rust, installed via [`rustup`](https://rust-lang.github.io/rustup/) or the [standalone installers](https://forge.rust-lang.org/infra/other-installation-methods.html#standalone-installers).
2430

25-
On top of that, if the [`klint`](klint.md) support is merged and starts to be routinely used, then we will also need to be mindful of its schedule.
31+
Finally, slim and fast LLVM+Rust toolchains are provided at [kernel.org](https://kernel.org/pub/tools/llvm/rust/).
2632

27-
### After a minimum version is declared
33+
Please see the [Quick Start guide](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/rust/quick-start.rst?h=v6.11-rc1) for details.
2834

29-
If we follow a similar model to the GCC and LLVM support in the kernel (which is likely), then we will not track the latest Rust release (i.e. as a minimum), though how wide the window will be remains to be seen. It is possible we may start with a small window and then widen it, similar to what was originally decided for the LLVM support in the kernel.
35+
## Minimum upgrade policy
3036

31-
## Submitting upgrades
32-
33-
Please do not submit patches to upgrade the Rust version. If you want to discuss upgrading the Rust version in the kernel, then please [contact us](Contact.md).
34-
35-
## Feedback
36-
37-
We are looking for [feedback](Contact.md) from Linux distributions, companies and other users and maintainers of downstream kernel releases.
38-
39-
In particular, it would be useful to know:
40-
41-
- What versions/policy would work best your distribution/company.
42-
43-
- If the kernel cannot satisfy exactly that (which is likely, given the current constraints), whether you would prefer to maintain a given compiler version for a while or to backport support from a newer version from mainline.
37+
We will start with a small window of supported Rust releases and then widen it progressively. However, we are still determining how often we will move the minimum to newer Rust versions, since we will have to balance different factors. For instance, we are following the evolution of which Rust version the upcoming Debian Stable distribution (i.e. Trixie) will package.

0 commit comments

Comments
 (0)