Committing to Rust for kernel code
Committing to Rust for kernel code
Posted Nov 23, 2023 0:25 UTC (Thu) by Conan_Kudo (subscriber, #103240)In reply to: Committing to Rust for kernel code by ojeda
Parent article: Committing to Rust for kernel code
>
> What do you mean by "break"?
It fails to compile because something has broken in rustc in some way, or the unstable feature has changed and broken something, or both. It happens without fail.
>> the lack of priority to eliminate usage of nightly/unstable Rust features
>
> This is false. It is, in fact, a priority for us: https://rust-for-linux.com/unstable-features.
You still allow *new* unstable features to be used. That list will keep growing. And in fact, I know it will once the DRM stuff is incorporated into mainline RFL (whenever that happens). It's only a priority once you start saying "no" to adding more of them. That can't happen for a while yet since the various subsystems don't yet have Rust abstractions in mainline.
>> lack of a proper specification
>
> I am not sure what you mean by this (and other points you make in this second paragraph), but if you are talking about a Rust language specification, then that is not really on us. In any case, the Rust project has decided to start working on an official specification for the Rust language. Ferrocene has one too.
I mean that you do not have a specification of how you want to handle Rust *in* Linux itself. This makes it really hard for people to figure out how to grade it and grok it when patches are being submitted to build new abstractions or kernel modules.
>> the lack of interest from kernel developers to review the Rust abstraction patches needed to bring in Rust-based drivers
>
> Different subsystems have different timelines, requirements, bandwidth and so on. You cannot expect every kernel maintainer to be on board or have time to work on Rust this early on. Having said that, as I mentioned in the summit, during this last year we have seen an increased interest from kernel maintainers, and in fact some of them have already been very helpful and supportive.
No, that's true. But I *can* expect the ones that *are* already doing Rust in other places to do more than nothing in the kernel. *My* patch load keeps growing because *nothing* has made it upstream in a year. It's extremely frustrating.
>> I do not think enabling Rust in a distribution kernel would be reasonable to consider for a few years.
>
> A few major distributions told me it should be possible for them to support Rust for Linux in the future. Ubuntu, for instance, provides packages with the Rust toolchain needed for the kernel.
I am shocked. I was also shocked when you said you reached out to all the major distributions, because I have not seen you reach out to Fedora *at all*.
Insofar as Ubuntu shipping it, it's pretty easy when there's nothing to ship.
The Fedora Asahi Remix kernel has one of the most significant Rust-based kernel modules (the Asahi DRM driver), and it can't even build on Rust 1.73 because something is broken in rustc itself (though nobody cares because it's broken somewhere related to a nightly/unstable feature). My next rebase will be the next time I try with Rust 1.74, and I'm dreading it.
I have recommended to upstream Fedora to *not* enable it because it's so risky to enable right now. Since we track upstream Rust on their compilers, Linux Rust code is busted all the time.