Linus Torvalds' Initial Comment On Rust Code Prospects Within The Linux Kernel

In the mailing list thread when discussing Greg Kroah-Hartman's past comments on the Rust prospects for the kernel, it was mentioned that one of the conditions being sought is that it would effectively be disabled by default until there has been sufficient testing.
Linus Torvalds chimed in though with his own opinion on the matter. Linus commented that he would like it to be effectively enabled by default to ensure there is widespread testing and not any isolated usage where developers then may do "crazy" things. He isn't calling for Rust to be a requirement for the kernel but rather if the Rust compiler is detected on the system, Kconfig would enable the Rust support and go ahead in building any hypothetical Rust kernel code in order to see it's properly built at least.
No, please make it a "is rust available" automatic config option. The exact same way we already do the compiler versions and check for various availability of compiler flags at config time.
See init/Kconfig for things like
config LD_IS_LLD
def_bool $(success,$(LD) -v | head -n 1 | grep -q LLD)
and the rust support should be similar. Something like
config RUST_IS_AVAILABLE
def_bool $(success,$(RUST) ..sometest..)
because I _don't_ want us to be in the situation where any new rust support isn't even build-tested by default.
Quite the reverse. I'd want the first rust driver (or whatever) to be introduced in such a simple format that failures will be obvious and simple.
The _worst_ situation to be in is that s (small) group of people start testing their very special situation, and do bad and crazy things because "nobody else cares, it's hidden".
No, thank you.
Linus
At least he didn't shoot down the idea of Rust support within the kernel. We'll see where the direction of Rust language support within the Linux kernel leads after LPC2020.
The virtual Linux Plumbers Conference runs from 24 to 28 August. The annual gathering of key Linux kernel developers was going to take place in Halifax, Canada until they had to scuttle those plans as a result of the coronavirus in now making their first online LPC event.
82 Comments