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

From: Boqun Feng
Date: Tue Oct 04 2022 - 02:40:47 EST

On Tue, Oct 04, 2022 at 01:32:49PM +0800, Xi Ruoyao wrote:
> 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.
> Hi,
> 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.

Just my 2 cents.

IIUC the Rust support is still in the *experiment* stage, in other
words, the whole thing may get removed if things don't go well. So I
wouldn't recommend any distro to enable it for the LTS kernel or any
kernel used for production.

That said, it may be a good time to start thinking of the list of
prerequisites for distros to enable it. I believe you just mentioned a
few above, so thank you!

As for the "victory of them but cost of us" thing, TBH, we do use the
compiler and other tool from them (and for free), so that's fair ;-)
Besides if the victory make them care more about kernel needs, it's
better ;-)


Attachment: signature.asc
Description: PGP signature