Re: [PATCH] scripts: generate_rust_analyzer: compile sysroot with correct edition
From: Miguel Ojeda
Date: Fri Jan 16 2026 - 09:43:17 EST
On Fri, Jan 16, 2026 at 3:03 PM Tamir Duberstein <tamird@xxxxxxxxxx> wrote:
>
> On Fri, Jan 16, 2026 at 6:53 AM Gary Guo <gary@xxxxxxxxxxx> wrote:
> >
> > We don't build std nor proc-macro ourselves in rust/Makefile, so I don't think
> > this should got there.
> >
> > I wonder if we should encode the fact about Rust version -> crate edition
> > mapping inside the Rust analyzer script? then we still call the variable
> > core-edition (which is the crate we need to build).
>
> If that's the approach we want to take, that would likely build on
> https://lore.kernel.org/all/20260109-ra-fix-primitive-v2-1-249852a4145a@xxxxxxxxx/.
For fixes, we try to keep them simple as possible in general, i.e.
like this patch. Or, actually, even simpler: we could keep the
variable name but use it as the sysroot edition on the other side,
since it happens to match at the moment.
After all, it is a script call -- the script wants the sysroot
edition, and we happen to have it from our `core` edition, so it all
works fine.
i.e. we can just drop the `rust/Makefile` side change for the fix,
which also means a smaller backport (if we don't use the
prerrequisite).
Another option is dropping these, if there are no practical
consequences (did you notice anything very broken using rust-analyzer?
It would be nice to mention those in the commit message, if you saw
any), but it seems best to fix it, especially since it comes from the
sysroot and thus I imagine it could have an impact later on due to
change in upstream code.
Cheers,
Miguel