Re: [PATCH v2 1/2] scripts: generate_rust_analyzer.py: add missing include_dirs

Miguel Ojeda
2025-03-11T23:01:20Z

On Tue, Mar 11, 2025 at 11:48 PM Tamir Duberstein <tamird@gmail.com> wrote:
>
> I don't follow this; there's a bindings crate at 8c4555ccc55c
> ("scripts: add `generate_rust_analyzer.py`") - at least as far as RA
> is concerned.

By "before being in mainline" I mean before Rust was in Linus' tree,
i.e. a long time ago in the old `rust` branch.

Back then, there was a period of time when there was no `bindings`
crate. At some point it was split from the `kernel` crate, which did
have the `include_dirs` for that reason, and at that moment the
`include_dirs` should have been moved too, but it wasn't.

So we ended up with `include_dirs` in the `kernel` crate for no reason
(because AFAICS it was not needed until we got
`generated_arch_static_branch_asm.rs`, but I haven't actually tested
that in RA) and missing it in the `bindings` one where it was actually
needed.

(I was trying to understand how we ended up here just to double-check
why we had things split like that)

> Yes, without it `generated_arch_static_branch_asm.rs` is not found by RA.

Thanks for confirming!

Cheers,
Miguel