* [PATCH] gpu: nova: fix rust-analyzer generation
@ 2026-07-01 6:40 Alexandre Courbot
2026-07-01 12:36 ` Onur Özkan
2026-07-01 18:39 ` Timur Tabi
0 siblings, 2 replies; 5+ messages in thread
From: Alexandre Courbot @ 2026-07-01 6:40 UTC (permalink / raw)
To: Danilo Krummrich, Alice Ryhl, David Airlie, Simona Vetter,
Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Trevor Gross, Daniel Almeida,
Tamir Duberstein, Onur Özkan, John Hubbard, Alistair Popple,
Timur Tabi, Eliot Courtney, Zhi Wang
Cc: nova-gpu, dri-devel, linux-kernel, rust-for-linux,
Alexandre Courbot
The rust-analyzer generator script recognizes a crate when its
corresponding `.o` appears in the Rust source file's immediate `Makefile`
or `Kbuild` file.
Commit ca524e273c43 ("gpu: build nova-core and nova-drm from
drivers/gpu/Makefile") moves the build rules for `nova-core` and
`nova-drm` into `drivers/gpu/Makefile`, which results in the generator
script ignoring these crates.
Fix this by naming the crates' module as a comment in their respective
`Makefile`; this is enough for the script to pick them up and restore
`rust-analyzer` functionality on them.
Fixes: ca524e273c43 ("gpu: build nova-core and nova-drm from drivers/gpu/Makefile")
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
drivers/gpu/drm/nova/Makefile | 1 +
drivers/gpu/nova-core/Makefile | 1 +
2 files changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/nova/Makefile b/drivers/gpu/drm/nova/Makefile
index b9fad3956358..6355f7502c48 100644
--- a/drivers/gpu/drm/nova/Makefile
+++ b/drivers/gpu/drm/nova/Makefile
@@ -1,2 +1,3 @@
# SPDX-License-Identifier: GPL-2.0
# nova-drm is built from drivers/gpu/Makefile.
+# nova.o (rust-analyzer marker - DO NOT REMOVE).
diff --git a/drivers/gpu/nova-core/Makefile b/drivers/gpu/nova-core/Makefile
index 4c15729704a1..216329760a5b 100644
--- a/drivers/gpu/nova-core/Makefile
+++ b/drivers/gpu/nova-core/Makefile
@@ -1,2 +1,3 @@
# SPDX-License-Identifier: GPL-2.0
# nova-core is built from drivers/gpu/Makefile.
+# nova_core.o (rust-analyzer marker - DO NOT REMOVE).
---
base-commit: 431f10ba13a964c146ae05728e42e4074bf735ab
change-id: 20260701-nova-rust-analyzer-8dd146dc53a3
Best regards,
--
Alexandre Courbot <acourbot@nvidia.com>
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] gpu: nova: fix rust-analyzer generation
2026-07-01 6:40 [PATCH] gpu: nova: fix rust-analyzer generation Alexandre Courbot
@ 2026-07-01 12:36 ` Onur Özkan
2026-07-02 1:09 ` Alexandre Courbot
2026-07-01 18:39 ` Timur Tabi
1 sibling, 1 reply; 5+ messages in thread
From: Onur Özkan @ 2026-07-01 12:36 UTC (permalink / raw)
To: Alexandre Courbot
Cc: Danilo Krummrich, Alice Ryhl, David Airlie, Simona Vetter,
Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Trevor Gross, Daniel Almeida,
Tamir Duberstein, John Hubbard, Alistair Popple, Timur Tabi,
Eliot Courtney, Zhi Wang, nova-gpu, dri-devel, linux-kernel,
rust-for-linux, Onur Özkan
On Wed, 01 Jul 2026 15:40:51 +0900
Alexandre Courbot <acourbot@nvidia.com> wrote:
> The rust-analyzer generator script recognizes a crate when its
> corresponding `.o` appears in the Rust source file's immediate `Makefile`
> or `Kbuild` file.
>
> Commit ca524e273c43 ("gpu: build nova-core and nova-drm from
> drivers/gpu/Makefile") moves the build rules for `nova-core` and
> `nova-drm` into `drivers/gpu/Makefile`, which results in the generator
> script ignoring these crates.
So this regression shows that generate_rust_analyzer.py should probably handle
this case better e.g. by checking and understanding parent build rules too.
>
> Fix this by naming the crates' module as a comment in their respective
> `Makefile`; this is enough for the script to pick them up and restore
> `rust-analyzer` functionality on them.
>
> Fixes: ca524e273c43 ("gpu: build nova-core and nova-drm from drivers/gpu/Makefile")
> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
That said, this is a reasonable quick fix for the current generator as it fixes
the rust-analyzer functionality for nova, so:
Reviewed-by: Onur Özkan <work@onurozkan.dev>
> ---
> drivers/gpu/drm/nova/Makefile | 1 +
> drivers/gpu/nova-core/Makefile | 1 +
> 2 files changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/nova/Makefile b/drivers/gpu/drm/nova/Makefile
> index b9fad3956358..6355f7502c48 100644
> --- a/drivers/gpu/drm/nova/Makefile
> +++ b/drivers/gpu/drm/nova/Makefile
> @@ -1,2 +1,3 @@
> # SPDX-License-Identifier: GPL-2.0
> # nova-drm is built from drivers/gpu/Makefile.
> +# nova.o (rust-analyzer marker - DO NOT REMOVE).
> diff --git a/drivers/gpu/nova-core/Makefile b/drivers/gpu/nova-core/Makefile
> index 4c15729704a1..216329760a5b 100644
> --- a/drivers/gpu/nova-core/Makefile
> +++ b/drivers/gpu/nova-core/Makefile
> @@ -1,2 +1,3 @@
> # SPDX-License-Identifier: GPL-2.0
> # nova-core is built from drivers/gpu/Makefile.
> +# nova_core.o (rust-analyzer marker - DO NOT REMOVE).
>
> ---
> base-commit: 431f10ba13a964c146ae05728e42e4074bf735ab
> change-id: 20260701-nova-rust-analyzer-8dd146dc53a3
>
> Best regards,
> --
> Alexandre Courbot <acourbot@nvidia.com>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gpu: nova: fix rust-analyzer generation
2026-07-01 6:40 [PATCH] gpu: nova: fix rust-analyzer generation Alexandre Courbot
2026-07-01 12:36 ` Onur Özkan
@ 2026-07-01 18:39 ` Timur Tabi
1 sibling, 0 replies; 5+ messages in thread
From: Timur Tabi @ 2026-07-01 18:39 UTC (permalink / raw)
To: Alexandre Courbot, lossin@kernel.org, a.hindborg@kernel.org,
ojeda@kernel.org, Zhi Wang, simona@ffwll.ch, tmgross@umich.edu,
boqun@kernel.org, daniel.almeida@collabora.com, John Hubbard,
work@onurozkan.dev, bjorn3_gh@protonmail.com, tamird@kernel.org,
Eliot Courtney, airlied@gmail.com, aliceryhl@google.com,
gary@garyguo.net, dakr@kernel.org, Alistair Popple
Cc: dri-devel@lists.freedesktop.org, nova-gpu@lists.linux.dev,
linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org
On Wed, 2026-07-01 at 15:40 +0900, Alexandre Courbot wrote:
> The rust-analyzer generator script recognizes a crate when its
> corresponding `.o` appears in the Rust source file's immediate `Makefile`
> or `Kbuild` file.
>
> Commit ca524e273c43 ("gpu: build nova-core and nova-drm from
> drivers/gpu/Makefile") moves the build rules for `nova-core` and
> `nova-drm` into `drivers/gpu/Makefile`, which results in the generator
> script ignoring these crates.
>
> Fix this by naming the crates' module as a comment in their respective
> `Makefile`; this is enough for the script to pick them up and restore
> `rust-analyzer` functionality on them.
>
> Fixes: ca524e273c43 ("gpu: build nova-core and nova-drm from drivers/gpu/Makefile")
> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Tested-by: Timur Tabi <ttabi@nvidia.com>
Thanks for fixing this bug so quickly. It was driving me crazy.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gpu: nova: fix rust-analyzer generation
2026-07-01 12:36 ` Onur Özkan
@ 2026-07-02 1:09 ` Alexandre Courbot
2026-07-02 7:54 ` Miguel Ojeda
0 siblings, 1 reply; 5+ messages in thread
From: Alexandre Courbot @ 2026-07-02 1:09 UTC (permalink / raw)
To: Onur Özkan
Cc: Danilo Krummrich, Alice Ryhl, David Airlie, Simona Vetter,
Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Trevor Gross, Daniel Almeida,
Tamir Duberstein, John Hubbard, Alistair Popple, Timur Tabi,
Eliot Courtney, Zhi Wang, nova-gpu, dri-devel, linux-kernel,
rust-for-linux
On Wed Jul 1, 2026 at 9:36 PM JST, Onur Özkan wrote:
> On Wed, 01 Jul 2026 15:40:51 +0900
> Alexandre Courbot <acourbot@nvidia.com> wrote:
>
>> The rust-analyzer generator script recognizes a crate when its
>> corresponding `.o` appears in the Rust source file's immediate `Makefile`
>> or `Kbuild` file.
>>
>> Commit ca524e273c43 ("gpu: build nova-core and nova-drm from
>> drivers/gpu/Makefile") moves the build rules for `nova-core` and
>> `nova-drm` into `drivers/gpu/Makefile`, which results in the generator
>> script ignoring these crates.
>
> So this regression shows that generate_rust_analyzer.py should probably handle
> this case better e.g. by checking and understanding parent build rules too.
Ideally yes - I expect that this is something the improved build system
will handle correctly. The current Nova build rules are a temporary
workaround, so I wanted to keep this "fix" as small as possible as it
will also be reverted eventually.
>
>>
>> Fix this by naming the crates' module as a comment in their respective
>> `Makefile`; this is enough for the script to pick them up and restore
>> `rust-analyzer` functionality on them.
>>
>> Fixes: ca524e273c43 ("gpu: build nova-core and nova-drm from drivers/gpu/Makefile")
>> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
>
> That said, this is a reasonable quick fix for the current generator as it fixes
> the rust-analyzer functionality for nova, so:
>
> Reviewed-by: Onur Özkan <work@onurozkan.dev>
Thanks!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gpu: nova: fix rust-analyzer generation
2026-07-02 1:09 ` Alexandre Courbot
@ 2026-07-02 7:54 ` Miguel Ojeda
0 siblings, 0 replies; 5+ messages in thread
From: Miguel Ojeda @ 2026-07-02 7:54 UTC (permalink / raw)
To: Alexandre Courbot, Jesung Yang
Cc: Onur Özkan, Danilo Krummrich, Alice Ryhl, David Airlie,
Simona Vetter, Miguel Ojeda, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Trevor Gross, Daniel Almeida, Tamir Duberstein, John Hubbard,
Alistair Popple, Timur Tabi, Eliot Courtney, Zhi Wang, nova-gpu,
dri-devel, linux-kernel, rust-for-linux
On Thu, Jul 2, 2026 at 3:09 AM Alexandre Courbot <acourbot@nvidia.com> wrote:
>
> Ideally yes - I expect that this is something the improved build system
> will handle correctly. The current Nova build rules are a temporary
> workaround, so I wanted to keep this "fix" as small as possible as it
> will also be reverted eventually.
Yeah, the current approach is just a workaround for the missing
information, and we will be able to just do it "properly" instead.
This is fine for now (and it is not the first "magic comment" in Linux anyway).
Cc'ing Jesung too.
Thanks!
Cheers,
Miguel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-07-02 7:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-01 6:40 [PATCH] gpu: nova: fix rust-analyzer generation Alexandre Courbot
2026-07-01 12:36 ` Onur Özkan
2026-07-02 1:09 ` Alexandre Courbot
2026-07-02 7:54 ` Miguel Ojeda
2026-07-01 18:39 ` Timur Tabi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox