[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJ-ks9nTmno12ZC4DnLxV_b0NLUK5Kn5K+cRi4BEvKtveQzJjg@mail.gmail.com>
Date: Thu, 20 Mar 2025 09:31:00 -0400
From: Tamir Duberstein <tamird@...il.com>
To: Benno Lossin <benno.lossin@...ton.me>
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>,
Andreas Hindborg <a.hindborg@...nel.org>, Alice Ryhl <aliceryhl@...gle.com>,
Trevor Gross <tmgross@...ch.edu>, Danilo Krummrich <dakr@...nel.org>, linux-kernel@...r.kernel.org,
rust-for-linux@...r.kernel.org
Subject: Re: [PATCH] rust: pin_init_internal: fix rust-analyzer `mod quote`
On Thu, Mar 20, 2025 at 8:16 AM Benno Lossin <benno.lossin@...ton.me> wrote:
>
> On Thu Mar 20, 2025 at 2:35 AM CET, Tamir Duberstein wrote:
> > Replace the `#[path]` attribute with a symlink to work around a
> > limitation in rust-analyzer that requires all modules to belong to the
> > same "source root". This allows code navigation from `pin_init_internal`
> > to `quote` to work properly.
> >
> > Link: https://github.com/rust-lang/rust-analyzer/issues/3898
> > Signed-off-by: Tamir Duberstein <tamird@...il.com>
> > ---
> > rust/pin-init/internal/src/lib.rs | 1 -
> > rust/pin-init/internal/src/quote.rs | 1 +
> > 2 files changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/rust/pin-init/internal/src/lib.rs b/rust/pin-init/internal/src/lib.rs
> > index babe5e878550..fdd95afe3864 100644
> > --- a/rust/pin-init/internal/src/lib.rs
> > +++ b/rust/pin-init/internal/src/lib.rs
> > @@ -20,7 +20,6 @@
> > use proc_macro::TokenStream;
> >
> > #[cfg(kernel)]
> > -#[path = "../../../macros/quote.rs"]
> > #[macro_use]
> > mod quote;
> > #[cfg(not(kernel))]
> > diff --git a/rust/pin-init/internal/src/quote.rs b/rust/pin-init/internal/src/quote.rs
> > new file mode 120000
> > index 000000000000..27a213d1a6ba
> > --- /dev/null
> > +++ b/rust/pin-init/internal/src/quote.rs
> > @@ -0,0 +1 @@
> > +../../../macros/quote.rs
> > \ No newline at end of file
> >
> > ---
> > base-commit: ff7f9b199e3f4cc7d61df5a9a26a7cbb5c1492e6
> > change-id: 20250319-pin-init-internal-quote-b7e15e9e8233
> >
> > Best regards,
>
> I'd rather not have this change, since this will introduce a dangling
> symlink upstream [1].
>
> [1]: https://github.com/rust-for-Linux/pin-init
I agree it's aesthetically displeasing. I'm not aware of any
alternative that fixes the development workflow of this crate in the
kernel.
Powered by blists - more mailing lists