Re: [GIT PULL] Rust introduction for v6.1-rc1

From: Xi Ruoyao
Date: Tue Oct 04 2022 - 01:51:03 EST

On Sat, 2022-10-01 at 08:58 -0700, Kees Cook wrote:
> Hi Linus,
> Please pull the initial Rust support for v6.1-rc1. The tree has a recent
> base, but has fundamentally been in linux-next for a year and a half[1].
> It's been updated based on feedback from the Kernel Maintainer's Summit,
> and to gain recent Reviewed-by: tags. Miguel is the primary maintainer,
> with me helping where needed/wanted. Our plan is for the tree to switch to
> the standard non-rebasing practice once this initial infrastructure series
> lands. The contents are the absolute minimum to get Rust code building
> in the kernel, with many more interfaces[2] (and drivers[3]) on the way.


As a Linux From Scratch maintainer I have to express some concern.

I think I have the most open attitude to Rust among all Linux From
Scratch members. But this will be just *too* troubling for us.

I'm not against the use of Rust in kernel, but:

1. Current implementation strictly depends on bindgen, which depends on
libclang in turn. It means even if the Rust support land in GCC 13,
we'll still need to build and install the giant LLVM for building the
Rust components in the kernel. Is it possible to use some different
approach (for example, including the binding in the kernel tree)?

2. Squashing all the cmake, LLVM, and Rustc stuff into the Linux From
Scratch book will be extremely painful, but still possible. However, we
currently need "A particular version of the Rust compiler". This is
just annoying. What will happen if a security vulnerability suddenly
shows up in the "particular version" required by a kernel LTS branch?
And from a distro maintainer's point of view this will forces us to
build multiple Rustc versions. I see the reason "the kernel depends on
some unstable Rust features", but then shouldn't we wait for (or urge
the Rustc developers for) the stabilization of these features, instead
of merging Rust into the mainline too quickly? Now they can declare the
victory like "oh, the kernel is now using our language!" but *we* are
paying all costs.