* [PATCH] rust: pin_init_internal: fix rust-analyzer `mod quote`
@ 2025-03-20 1:35 Tamir Duberstein
2025-03-20 7:46 ` Alice Ryhl
2025-03-20 12:16 ` Benno Lossin
0 siblings, 2 replies; 9+ messages in thread
From: Tamir Duberstein @ 2025-03-20 1:35 UTC (permalink / raw)
To: Benno Lossin, Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Andreas Hindborg, Alice Ryhl, Trevor Gross,
Danilo Krummrich
Cc: linux-kernel, rust-for-linux, Tamir Duberstein
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@gmail.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,
--
Tamir Duberstein <tamird@gmail.com>
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] rust: pin_init_internal: fix rust-analyzer `mod quote`
2025-03-20 1:35 [PATCH] rust: pin_init_internal: fix rust-analyzer `mod quote` Tamir Duberstein
@ 2025-03-20 7:46 ` Alice Ryhl
2025-03-20 10:16 ` Tamir Duberstein
2025-03-20 12:16 ` Benno Lossin
1 sibling, 1 reply; 9+ messages in thread
From: Alice Ryhl @ 2025-03-20 7:46 UTC (permalink / raw)
To: Tamir Duberstein
Cc: Benno Lossin, Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Andreas Hindborg, Trevor Gross,
Danilo Krummrich, linux-kernel, rust-for-linux
On Wed, Mar 19, 2025 at 09:35:40PM -0400, 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@gmail.com>
Are we allowed to have symlinks?
Alice
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] rust: pin_init_internal: fix rust-analyzer `mod quote`
2025-03-20 7:46 ` Alice Ryhl
@ 2025-03-20 10:16 ` Tamir Duberstein
0 siblings, 0 replies; 9+ messages in thread
From: Tamir Duberstein @ 2025-03-20 10:16 UTC (permalink / raw)
To: Alice Ryhl
Cc: Benno Lossin, Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Andreas Hindborg, Trevor Gross,
Danilo Krummrich, linux-kernel, rust-for-linux
On Thu, Mar 20, 2025 at 3:46 AM Alice Ryhl <aliceryhl@google.com> wrote:
>
> On Wed, Mar 19, 2025 at 09:35:40PM -0400, 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@gmail.com>
>
> Are we allowed to have symlinks?
There are 77 symlinks in the kernel by my count. Perhaps most
interesting are these:
include/dt-bindings/clock/qcom,dispcc-sm8150.h
include/dt-bindings/clock/qcom,dispcc-sm8350.h
include/dt-bindings/clock/qcom,sm8650-dispcc.h
include/dt-bindings/input/linux-event-codes.h
I'm not sure if there are further criteria we need to satisfy.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] rust: pin_init_internal: fix rust-analyzer `mod quote`
2025-03-20 1:35 [PATCH] rust: pin_init_internal: fix rust-analyzer `mod quote` Tamir Duberstein
2025-03-20 7:46 ` Alice Ryhl
@ 2025-03-20 12:16 ` Benno Lossin
2025-03-20 13:31 ` Tamir Duberstein
1 sibling, 1 reply; 9+ messages in thread
From: Benno Lossin @ 2025-03-20 12:16 UTC (permalink / raw)
To: Tamir Duberstein, Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Andreas Hindborg, Alice Ryhl, Trevor Gross,
Danilo Krummrich
Cc: linux-kernel, rust-for-linux
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@gmail.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
---
Cheers,
Benno
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] rust: pin_init_internal: fix rust-analyzer `mod quote`
2025-03-20 12:16 ` Benno Lossin
@ 2025-03-20 13:31 ` Tamir Duberstein
2025-03-20 14:10 ` Benno Lossin
0 siblings, 1 reply; 9+ messages in thread
From: Tamir Duberstein @ 2025-03-20 13:31 UTC (permalink / raw)
To: Benno Lossin
Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Andreas Hindborg, Alice Ryhl, Trevor Gross,
Danilo Krummrich, linux-kernel, rust-for-linux
On Thu, Mar 20, 2025 at 8:16 AM Benno Lossin <benno.lossin@proton.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@gmail.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.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] rust: pin_init_internal: fix rust-analyzer `mod quote`
2025-03-20 13:31 ` Tamir Duberstein
@ 2025-03-20 14:10 ` Benno Lossin
2025-03-20 14:15 ` Tamir Duberstein
0 siblings, 1 reply; 9+ messages in thread
From: Benno Lossin @ 2025-03-20 14:10 UTC (permalink / raw)
To: Tamir Duberstein
Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Andreas Hindborg, Alice Ryhl, Trevor Gross,
Danilo Krummrich, linux-kernel, rust-for-linux
On Thu Mar 20, 2025 at 2:31 PM CET, Tamir Duberstein wrote:
> On Thu, Mar 20, 2025 at 8:16 AM Benno Lossin <benno.lossin@proton.me> wrote:
>> 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.
I don't think it's too bad, and this code is going away soon-ish
anyways.
---
Cheers,
Benno
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] rust: pin_init_internal: fix rust-analyzer `mod quote`
2025-03-20 14:10 ` Benno Lossin
@ 2025-03-20 14:15 ` Tamir Duberstein
2025-12-22 12:43 ` Tamir Duberstein
0 siblings, 1 reply; 9+ messages in thread
From: Tamir Duberstein @ 2025-03-20 14:15 UTC (permalink / raw)
To: Benno Lossin
Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Andreas Hindborg, Alice Ryhl, Trevor Gross,
Danilo Krummrich, linux-kernel, rust-for-linux
On Thu, Mar 20, 2025 at 10:10 AM Benno Lossin <benno.lossin@proton.me> wrote:
>
> On Thu Mar 20, 2025 at 2:31 PM CET, Tamir Duberstein wrote:
> > On Thu, Mar 20, 2025 at 8:16 AM Benno Lossin <benno.lossin@proton.me> wrote:
> >> 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.
>
> I don't think it's too bad, and this code is going away soon-ish
> anyways.
What would Andreas say? :)
I don't think the going away soon argument is relevant in this case -
the same applies to the dangling symlink.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] rust: pin_init_internal: fix rust-analyzer `mod quote`
2025-03-20 14:15 ` Tamir Duberstein
@ 2025-12-22 12:43 ` Tamir Duberstein
2025-12-23 1:32 ` Benno Lossin
0 siblings, 1 reply; 9+ messages in thread
From: Tamir Duberstein @ 2025-12-22 12:43 UTC (permalink / raw)
To: Benno Lossin
Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Andreas Hindborg, Alice Ryhl, Trevor Gross,
Danilo Krummrich, linux-kernel, rust-for-linux
On Thu, Mar 20, 2025 at 3:15 PM Tamir Duberstein <tamird@gmail.com> wrote:
>
> On Thu, Mar 20, 2025 at 10:10 AM Benno Lossin <benno.lossin@proton.me> wrote:
> >
> > On Thu Mar 20, 2025 at 2:31 PM CET, Tamir Duberstein wrote:
> > > On Thu, Mar 20, 2025 at 8:16 AM Benno Lossin <benno.lossin@proton.me> wrote:
> > >> 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.
> >
> > I don't think it's too bad, and this code is going away soon-ish
> > anyways.
>
> What would Andreas say? :)
>
> I don't think the going away soon argument is relevant in this case -
> the same applies to the dangling symlink.
9 months later, this code is still here. What would make it go away?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] rust: pin_init_internal: fix rust-analyzer `mod quote`
2025-12-22 12:43 ` Tamir Duberstein
@ 2025-12-23 1:32 ` Benno Lossin
0 siblings, 0 replies; 9+ messages in thread
From: Benno Lossin @ 2025-12-23 1:32 UTC (permalink / raw)
To: Tamir Duberstein, Benno Lossin
Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Andreas Hindborg, Alice Ryhl, Trevor Gross,
Danilo Krummrich, linux-kernel, rust-for-linux
On Mon Dec 22, 2025 at 1:43 PM CET, Tamir Duberstein wrote:
> On Thu, Mar 20, 2025 at 3:15 PM Tamir Duberstein <tamird@gmail.com> wrote:
>>
>> On Thu, Mar 20, 2025 at 10:10 AM Benno Lossin <benno.lossin@proton.me> wrote:
>> >
>> > On Thu Mar 20, 2025 at 2:31 PM CET, Tamir Duberstein wrote:
>> > > On Thu, Mar 20, 2025 at 8:16 AM Benno Lossin <benno.lossin@proton.me> wrote:
>> > >> 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.
>> >
>> > I don't think it's too bad, and this code is going away soon-ish
>> > anyways.
>>
>> What would Andreas say? :)
>>
>> I don't think the going away soon argument is relevant in this case -
>> the same applies to the dangling symlink.
>
> 9 months later, this code is still here. What would make it go away?
The pin-init `syn` changes will land this cycle, which removes this
code.
Cheers,
Benno
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-12-23 1:32 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-20 1:35 [PATCH] rust: pin_init_internal: fix rust-analyzer `mod quote` Tamir Duberstein
2025-03-20 7:46 ` Alice Ryhl
2025-03-20 10:16 ` Tamir Duberstein
2025-03-20 12:16 ` Benno Lossin
2025-03-20 13:31 ` Tamir Duberstein
2025-03-20 14:10 ` Benno Lossin
2025-03-20 14:15 ` Tamir Duberstein
2025-12-22 12:43 ` Tamir Duberstein
2025-12-23 1:32 ` Benno Lossin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox