Re: [PATCH] scripts: generate_rust_analyzer: compile sysroot with correct edition

From: Tamir Duberstein

Date: Thu Jan 15 2026 - 16:36:28 EST


On Thu, Jan 15, 2026 at 4:23 PM Miguel Ojeda
<miguel.ojeda.sandonis@xxxxxxxxx> wrote:
>
> On Thu, Jan 15, 2026 at 5:35 PM Tamir Duberstein <tamird@xxxxxxxxxx> wrote:
> >
> > Rename `core-edition` to `sysroot-edition` to align with the naming used
> > to refer to standard library crates in `generate_rust_analyzer.py` and
> > apply it to all standard library crates rather than just core.
>
> I think, in principle, even the sysroot crates may have different
> editions, which I think I used that variable name.
>
> For instance, in the move to 2024, it seems all happened at once in
> 1.87.0 in these upstream commits, so that seems OK:
>
> 0e071c2c6a58 ("Migrate core to Rust 2024")
> f505d4e8e380 ("Migrate alloc to Rust 2024")
> 0b2489c226c3 ("Migrate proc_macro to Rust 2024")
> 993359e70112 ("Migrate std to Rust 2024")
>
> But in the previous move to 2021, `std` moved in 1.59.0, while the
> others in 1.60.0:
>
> b656384d8398 ("Update stdlib to the 2021 edition")
> 06a1c14d52a8 ("Switch all libraries to the 2021 edition")

Good point, I hadn't considered that (nor did I do that archaeology).

> Hmm... I guess the new name is fine, but we may need to go back to
> separate naming eventually if they get updated at different times next
> time.

👍

> By the way, it says `sysroot-edition` in the message -- I guess you
> then later used underscore because it is now not attached to a
> particular crate? In that case, I can update the message.

Ah, I think I wrote that when I was under the impression that
`--sysroot-edition` was a named argument to the script but it turned
out to be positional. So: you are right that the message should be
updated.

>
> > Note that backporting this will conflict unless commit 46e58a9637ec ("rust:
> > kbuild: introduce `core-flags` and `core-skip_flags`") is also backported.
>
> This normally is solved on backporting time providing a resolved patch
> or, if you think it is worth backporting the other one too, as a
> prerequisite in the Cc: stable lines (see
> Documentation/process/stable-kernel-rules.rst).

Ah, thanks. If the prerequisite isn't backported, who provides the
resolved patch?

>
> > Fixes: f4daa80d6be7 ("rust: compile libcore with edition 2024 for 1.87+")
>
> Since this commit is previous to existing kernel branches and you
> mention it above, please consider adding Cc: stable.

Ack, I guess that will have to happen at apply time for this one?

> > Signed-off-by: Tamir Duberstein <tamird@xxxxxxxxx>
>
> Cc'ing Jesung who is becoming a reviewer for rust-analyzer.
>
> Thanks!
>
> Cheers,
> Miguel

Thanks Miguel.