public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scripts: generate_rust_analyzer: Add ffi crate
@ 2025-04-04 12:51 Lukas Fischer
  2025-04-04 13:23 ` Tamir Duberstein
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Lukas Fischer @ 2025-04-04 12:51 UTC (permalink / raw)
  To: Miguel Ojeda, Alex Gaynor
  Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich,
	Tamir Duberstein, rust-for-linux, Lukas Fischer

Commit d072acda4862 ("rust: use custom FFI integer types") did not
update rust-analyzer to include the new crate.

To enable rust-analyzer support for these custom ffi types, add the
`ffi` crate as a dependency to the `bindings`, `uapi` and `kernel`
crates, which all directly depend on it.

Fixes: d072acda4862 ("rust: use custom FFI integer types")
Signed-off-by: Lukas Fischer <kernel@o1oo11oo.de>
---
 scripts/generate_rust_analyzer.py | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/scripts/generate_rust_analyzer.py b/scripts/generate_rust_analyzer.py
index cd41bc906fbd..fe663dd0c43b 100755
--- a/scripts/generate_rust_analyzer.py
+++ b/scripts/generate_rust_analyzer.py
@@ -112,6 +112,12 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs):
         cfg=["kernel"],
     )
 
+    append_crate(
+        "ffi",
+        srctree / "rust" / "ffi.rs",
+        ["core", "compiler_builtins"],
+    )
+
     def append_crate_with_generated(
         display_name,
         deps,
@@ -131,9 +137,9 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs):
             "exclude_dirs": [],
         }
 
-    append_crate_with_generated("bindings", ["core"])
-    append_crate_with_generated("uapi", ["core"])
-    append_crate_with_generated("kernel", ["core", "macros", "build_error", "pin_init", "bindings", "uapi"])
+    append_crate_with_generated("bindings", ["core", "ffi"])
+    append_crate_with_generated("uapi", ["core", "ffi"])
+    append_crate_with_generated("kernel", ["core", "macros", "build_error", "pin_init", "ffi", "bindings", "uapi"])
 
     def is_root_crate(build_file, target):
         try:

base-commit: a2cc6ff5ec8f91bc463fd3b0c26b61166a07eb11
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] scripts: generate_rust_analyzer: Add ffi crate
  2025-04-04 12:51 [PATCH] scripts: generate_rust_analyzer: Add ffi crate Lukas Fischer
@ 2025-04-04 13:23 ` Tamir Duberstein
  2025-04-05  7:41 ` Greg KH
  2025-04-08 17:50 ` Miguel Ojeda
  2 siblings, 0 replies; 4+ messages in thread
From: Tamir Duberstein @ 2025-04-04 13:23 UTC (permalink / raw)
  To: Lukas Fischer
  Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Danilo Krummrich, rust-for-linux

On Fri, Apr 4, 2025 at 8:53 AM Lukas Fischer <kernel@o1oo11oo.de> wrote:
>
> Commit d072acda4862 ("rust: use custom FFI integer types") did not
> update rust-analyzer to include the new crate.
>
> To enable rust-analyzer support for these custom ffi types, add the
> `ffi` crate as a dependency to the `bindings`, `uapi` and `kernel`
> crates, which all directly depend on it.
>
> Fixes: d072acda4862 ("rust: use custom FFI integer types")
> Signed-off-by: Lukas Fischer <kernel@o1oo11oo.de>

Reviewed-by: Tamir Duberstein <tamird@gmail.com>

> ---
>  scripts/generate_rust_analyzer.py | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/generate_rust_analyzer.py b/scripts/generate_rust_analyzer.py
> index cd41bc906fbd..fe663dd0c43b 100755
> --- a/scripts/generate_rust_analyzer.py
> +++ b/scripts/generate_rust_analyzer.py
> @@ -112,6 +112,12 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs):
>          cfg=["kernel"],
>      )
>
> +    append_crate(
> +        "ffi",
> +        srctree / "rust" / "ffi.rs",
> +        ["core", "compiler_builtins"],
> +    )

The dependency on compiler_builtins looks weird to me, but it is that
way in the Makefile. We might want to revisit that, though.

> +
>      def append_crate_with_generated(
>          display_name,
>          deps,
> @@ -131,9 +137,9 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs):
>              "exclude_dirs": [],
>          }
>
> -    append_crate_with_generated("bindings", ["core"])
> -    append_crate_with_generated("uapi", ["core"])
> -    append_crate_with_generated("kernel", ["core", "macros", "build_error", "pin_init", "bindings", "uapi"])
> +    append_crate_with_generated("bindings", ["core", "ffi"])
> +    append_crate_with_generated("uapi", ["core", "ffi"])
> +    append_crate_with_generated("kernel", ["core", "macros", "build_error", "pin_init", "ffi", "bindings", "uapi"])
>
>      def is_root_crate(build_file, target):
>          try:
>
> base-commit: a2cc6ff5ec8f91bc463fd3b0c26b61166a07eb11
> --
> 2.49.0
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] scripts: generate_rust_analyzer: Add ffi crate
  2025-04-04 12:51 [PATCH] scripts: generate_rust_analyzer: Add ffi crate Lukas Fischer
  2025-04-04 13:23 ` Tamir Duberstein
@ 2025-04-05  7:41 ` Greg KH
  2025-04-08 17:50 ` Miguel Ojeda
  2 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2025-04-05  7:41 UTC (permalink / raw)
  To: Lukas Fischer
  Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Danilo Krummrich, Tamir Duberstein, rust-for-linux

On Fri, Apr 04, 2025 at 02:51:51PM +0200, Lukas Fischer wrote:
> Commit d072acda4862 ("rust: use custom FFI integer types") did not
> update rust-analyzer to include the new crate.
> 
> To enable rust-analyzer support for these custom ffi types, add the
> `ffi` crate as a dependency to the `bindings`, `uapi` and `kernel`
> crates, which all directly depend on it.
> 
> Fixes: d072acda4862 ("rust: use custom FFI integer types")
> Signed-off-by: Lukas Fischer <kernel@o1oo11oo.de>
> ---
>  scripts/generate_rust_analyzer.py | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/scripts/generate_rust_analyzer.py b/scripts/generate_rust_analyzer.py
> index cd41bc906fbd..fe663dd0c43b 100755
> --- a/scripts/generate_rust_analyzer.py
> +++ b/scripts/generate_rust_analyzer.py
> @@ -112,6 +112,12 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs):
>          cfg=["kernel"],
>      )
>  
> +    append_crate(
> +        "ffi",
> +        srctree / "rust" / "ffi.rs",
> +        ["core", "compiler_builtins"],
> +    )
> +
>      def append_crate_with_generated(
>          display_name,
>          deps,
> @@ -131,9 +137,9 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs):
>              "exclude_dirs": [],
>          }
>  
> -    append_crate_with_generated("bindings", ["core"])
> -    append_crate_with_generated("uapi", ["core"])
> -    append_crate_with_generated("kernel", ["core", "macros", "build_error", "pin_init", "bindings", "uapi"])
> +    append_crate_with_generated("bindings", ["core", "ffi"])
> +    append_crate_with_generated("uapi", ["core", "ffi"])
> +    append_crate_with_generated("kernel", ["core", "macros", "build_error", "pin_init", "ffi", "bindings", "uapi"])
>  
>      def is_root_crate(build_file, target):
>          try:
> 
> base-commit: a2cc6ff5ec8f91bc463fd3b0c26b61166a07eb11
> -- 
> 2.49.0
> 
> 

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- You have marked a patch with a "Fixes:" tag for a commit that is in an
  older released kernel, yet you do not have a cc: stable line in the
  signed-off-by area at all, which means that the patch will not be
  applied to any older kernel releases.  To properly fix this, please
  follow the documented rules in the
  Documentation/process/stable-kernel-rules.rst file for how to resolve
  this.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] scripts: generate_rust_analyzer: Add ffi crate
  2025-04-04 12:51 [PATCH] scripts: generate_rust_analyzer: Add ffi crate Lukas Fischer
  2025-04-04 13:23 ` Tamir Duberstein
  2025-04-05  7:41 ` Greg KH
@ 2025-04-08 17:50 ` Miguel Ojeda
  2 siblings, 0 replies; 4+ messages in thread
From: Miguel Ojeda @ 2025-04-08 17:50 UTC (permalink / raw)
  To: Lukas Fischer
  Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Danilo Krummrich, Tamir Duberstein, rust-for-linux

On Fri, Apr 4, 2025 at 2:53 PM Lukas Fischer <kernel@o1oo11oo.de> wrote:
>
> Commit d072acda4862 ("rust: use custom FFI integer types") did not
> update rust-analyzer to include the new crate.
>
> To enable rust-analyzer support for these custom ffi types, add the
> `ffi` crate as a dependency to the `bindings`, `uapi` and `kernel`
> crates, which all directly depend on it.
>
> Fixes: d072acda4862 ("rust: use custom FFI integer types")
> Signed-off-by: Lukas Fischer <kernel@o1oo11oo.de>

Applied to `rust-fixes` -- thanks everyone!

I added `Cc: stable@`, though it is not critical if it gets backported or not.

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-04-08 17:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-04 12:51 [PATCH] scripts: generate_rust_analyzer: Add ffi crate Lukas Fischer
2025-04-04 13:23 ` Tamir Duberstein
2025-04-05  7:41 ` Greg KH
2025-04-08 17:50 ` Miguel Ojeda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox