[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJ-ks9mSqxzV8F=SwGeHpXbRZ1814Cxk+AiyMnyjS5h94JqxFw@mail.gmail.com>
Date: Tue, 11 Mar 2025 18:47:55 -0400
From: Tamir Duberstein <tamird@...il.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
Cc: Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>, Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>, Kees Cook <kees@...nel.org>,
Fiona Behrens <me@...enk.dev>, Martin Rodriguez Reboredo <yakoyoku@...il.com>, Asahi Lina <lina@...hilina.net>,
Boris-Chengbiao Zhou <bobo1239@....de>, rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/2] scripts: generate_rust_analyzer.py: add missing include_dirs
On Tue, Mar 11, 2025 at 6:00 PM Miguel Ojeda
<miguel.ojeda.sandonis@...il.com> wrote:
>
> On Mon, Feb 10, 2025 at 7:04 PM Tamir Duberstein <tamird@...il.com> wrote:
> >
> > Commit 8c4555ccc55c ("scripts: add `generate_rust_analyzer.py`")
> > specified OBJTREE for the bindings crate, and `source.include_dirs` for
> > the kernel crate, likely in an attempt to support out-of-source builds
> > for those crates where the generated files reside in `objtree` rather
> > than `srctree`. This was insufficient because both bits of configuration
> > are required for each crate; the result is that rust-analyzer is unable
> > to resolve generated files for either crate in an out-of-source build.
>
> Originally we were not using `OBJTREE` in the `kernel` crate, but we
> did pass it anyway, so conceptually it could have been there. So I am
> not sure if it counts as a fix for that commit, but it shouldn't hurt
> even if backported.
Ah, I see. The reference to `OBJTREE` in the `kernel` crate was
introduced in commit 169484ab6677 ("rust: add arch_static_branch").
I'm not able to build at commit 8c4555ccc55c ("scripts: add
`generate_rust_analyzer.py`") but I would expect that rust-analyzer
didn't work properly there for the bindings crate for out of tree
builds because of the missing `include_dirs`.
>
> Regarding `include_dirs`, it started in `kernel` before being in
> mainline because we included the bindings there (i.e. there was not
> `bindings` crate),
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.
but it should have been probably moved when it was
> split. Nowadays, I guess we still need it for
> `generated_arch_static_branch_asm.rs`, or is it something else that
> needs it? I assume it shouldn't hurt, in any case, so it looks OK.
Yes, without it `generated_arch_static_branch_asm.rs` is not found by RA.
Powered by blists - more mailing lists