Skip to contentSkip to conversation

rust: start supporting several compiler versions

PATCH Andreas Hindborg 2 participants 2 messages Jul 3, 2024 – Jul 4, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Miguel Ojeda <[email protected]> writes:

[...]

Quoted 6 lines
scripts/rust_is_available.sh +0 -0
index 117018946b57..67cb900124cc 100755
@@ -117,14 +117,6 @@ if [ "$rust_compiler_cversion" -lt "$rust_compiler_min_cversion" ]; then
 	echo >&2 "***"

scripts/rust_is_available.sh if [ "$rust_compiler_cversion" -lt "$rust_compiler_min_cversion" ]; then · line 127

Quoted 10 lines
scripts/rust_is_available.sh +0 -8
 	exit 1
 fi
-if [ "$rust_compiler_cversion" -gt "$rust_compiler_min_cversion" ]; then
-	echo >&2 "***"
-	echo >&2 "*** Rust compiler '$RUSTC' is too new. This may or may not work."
-	echo >&2 "***   Your version:     $rust_compiler_version"
-	echo >&2 "***   Expected version: $rust_compiler_min_version"
-	echo >&2 "***"
-	warning=1
-fi

This does not set a max version. Will older versions of the kernel always compile with newer releases of rustc?

Best regards,
Andreas

#1 lore raw
Quoted 3 lines · Andreas Hindborg

This does not set a max version. Will older versions of the kernel always compile with newer releases of rustc?

That depends on how many changes Rust introduces around the remaining unstable features (as well as plain bugs in new versions, like for any other tool). With the kernel being tested in the Rust pre-merge CI, hopefully we will reduce those to a minimum.

It is also why we need to keep reducing the unstable features and get into stable Rust as soon as possible. The Rust project is starting to support us more here, and they are setting up a project goal for 2024h2 on their side to resolve the biggest blockers for the kernel:

    https://rust-lang.github.io/rust-project-goals/2024h2/rfl_stable.html

Meanwhile, on our side, we can do our best to backport any workarounds for new versions into supported kernels, i.e. stable and LTSs.

But, at least, this series should already help kernel developers (they will be able to compile the kernel with Rust enabled using their distribution) and Linux distributions (they will have more freedom to pick a Rust toolchain version and avoid having to package another version just for the kernel).

Cheers,
Miguel