Skip to contentSkip to conversation

scripts: generate_rust_analyzer: match rust/Makefile

PATCH Applied Tamir Duberstein 4 participants 19 messages Jul 23, 2025 – Jan 15

Subsystems (2)
lore
Share & tools
lore

Tamir Duberstein

author maintainer
#0 lore raw

cover scripts: generate_rust_analyzer: match rust/Makefile

Minor fixes in this series. The main one is fixing navigation in pin_init_internal.

This is my first series using [email protected]; please excude any hiccups.

---
Tamir Duberstein (3):

      scripts: generate_rust_analyzer: Add compiler_builtins -> core dep
      scripts: generate_rust_analyzer: Add pin_init -> compiler_builtins dep
      scripts: generate_rust_analyzer: Add pin_init_internal deps
 scripts/generate_rust_analyzer.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

---
base-commit: dff64b072708ffef23c117fa1ee1ea59eb417807
change-id: 20250723-rust-analyzer-pin-init-925467269001

Best regards,

Signature · 1 line
Tamir Duberstein <[email protected]>
author maintainer
#1 lore raw

PATCH 1/3 scripts: generate_rust_analyzer: Add compiler_builtins -> core dep

Add a dependency edge from compiler_builtins to core to scripts/generate_rust_analyzer.py to match rust/Makefile. This has been incorrect since commit 8c4555ccc55c ("scripts: add generate_rust_analyzer.py")

---
 scripts/generate_rust_analyzer.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/generate_rust_analyzer.py +1 -1
index 7c3ea2b55041..4639a756a932 100755
@@ -83,7 +83,7 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs, core_edit
     append_crate(
         "compiler_builtins",
         srctree / "rust" / "compiler_builtins.rs",
-        [],
+        ["core"],
     )
 
     append_crate(
Signature · 1 line
2.50.1
reviewer Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] scripts: generate_rust_analyzer: Add compiler_builtins -> core dep

Quoted 15 lines · Tamir Duberstein

Add a dependency edge from compiler_builtins to core to scripts/generate_rust_analyzer.py to match rust/Makefile. This has been incorrect since commit 8c4555ccc55c ("scripts: add generate_rust_analyzer.py")

---
 scripts/generate_rust_analyzer.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/generate_rust_analyzer.py +0 -0
index 7c3ea2b55041..4639a756a932 100755

scripts/generate_rust_analyzer.py def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs, core_edit · line 89

Quoted 8 lines
scripts/generate_rust_analyzer.py +1 -1
@@ -83,7 +83,7 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs, core_edit
     append_crate(
         "compiler_builtins",
         srctree / "rust" / "compiler_builtins.rs",
-        [],
+        ["core"],
     )
 
     append_crate(

This looks good, but I think
Fixes: 8c4555ccc55c ("scripts: add generate_rust_analyzer.py") and Cc: stable tags should be specified.

For the change itself,

Best regards,
Jesung

author maintainer
#3 lore raw

PATCH 2/3 scripts: generate_rust_analyzer: Add pin_init -> compiler_builtins dep

In reply to Tamir Duberstein

Add a dependency edge from pin_init to compiler_builtins to scripts/generate_rust_analyzer.py to match rust/Makefile. This has been incorrect since commit d7659acca7a3 ("rust: add pin-init crate build infrastructure").

---
 scripts/generate_rust_analyzer.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/generate_rust_analyzer.py +1 -1
index 4639a756a932..451d00dfc08d 100755
@@ -110,7 +110,7 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs, core_edit
     append_crate(
         "pin_init",
         srctree / "rust" / "pin-init" / "src" / "lib.rs",
-        ["core", "pin_init_internal", "macros"],
+        ["core", "compiler_builtins", "pin_init_internal", "macros"],
         cfg=["kernel"],
     )
 
Signature · 1 line
2.50.1
reviewer Reviewed-by on v1 2/3
#4 lore raw

Re: [PATCH 2/3] scripts: generate_rust_analyzer: Add pin_init -> compiler_builtins dep

Quoted 15 lines · Tamir Duberstein

Add a dependency edge from pin_init to compiler_builtins to scripts/generate_rust_analyzer.py to match rust/Makefile. This has been incorrect since commit d7659acca7a3 ("rust: add pin-init crate build infrastructure").

---
 scripts/generate_rust_analyzer.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/generate_rust_analyzer.py +0 -0
index 4639a756a932..451d00dfc08d 100755

scripts/generate_rust_analyzer.py def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs, core_edit · line 116

Quoted 8 lines
scripts/generate_rust_analyzer.py +1 -1
@@ -110,7 +110,7 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs, core_edit
     append_crate(
         "pin_init",
         srctree / "rust" / "pin-init" / "src" / "lib.rs",
-        ["core", "pin_init_internal", "macros"],
+        ["core", "compiler_builtins", "pin_init_internal", "macros"],
         cfg=["kernel"],
     )
 

Similar to above, these tags are needed:

+Fixes: d7659acca7a3 ("rust: add pin-init crate build infrastructure") +Cc: <stable@...>

For the change itself,

Best regards,
Jesung

author maintainer
#5 lore raw

PATCH 3/3 scripts: generate_rust_analyzer: Add pin_init_internal deps

In reply to Tamir Duberstein

Commit d7659acca7a3 ("rust: add pin-init crate build infrastructure") did not add dependencies to pin_init_internal, resulting in broken navigation. Thus add them now.

---
 scripts/generate_rust_analyzer.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/generate_rust_analyzer.py +1 -1
index 451d00dfc08d..229acd4cf1fb 100755
@@ -102,7 +102,7 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs, core_edit
     append_crate(
         "pin_init_internal",
         srctree / "rust" / "pin-init" / "internal" / "src" / "lib.rs",
-        [],
+        ["std", "proc_macro"],
         cfg=["kernel"],
         is_proc_macro=True,
     )
Signature · 1 line
2.50.1
reviewer
#6 lore raw

Re: [PATCH 3/3] scripts: generate_rust_analyzer: Add pin_init_internal deps

Quoted 14 lines · Tamir Duberstein

Commit d7659acca7a3 ("rust: add pin-init crate build infrastructure") did not add dependencies to pin_init_internal, resulting in broken navigation. Thus add them now.

---
 scripts/generate_rust_analyzer.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/generate_rust_analyzer.py +0 -0
index 451d00dfc08d..229acd4cf1fb 100755

scripts/generate_rust_analyzer.py def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs, core_edit · line 108

Quoted 8 lines
scripts/generate_rust_analyzer.py +1 -1
@@ -102,7 +102,7 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs, core_edit
     append_crate(
         "pin_init_internal",
         srctree / "rust" / "pin-init" / "internal" / "src" / "lib.rs",
-        [],
+        ["std", "proc_macro"],
         cfg=["kernel"],
         is_proc_macro=True,
     )

The recent syn rewrite of pin-init [1] covers this as well. How do we usually handle this kind of overlap?

[1] https://lore.kernel.org/rust-for-linux/[email protected]/

Best regards,
Jesung

#7 lore raw

Re: [PATCH 3/3] scripts: generate_rust_analyzer: Add pin_init_internal deps

Quoted 5 lines · Jesung Yang

The recent syn rewrite of pin-init [1] covers this as well. How do we usually handle this kind of overlap?

[1] https://lore.kernel.org/rust-for-linux/[email protected]/

It should be fine, when applying that other series later on we will get a conflict to be resolved, but that's it.

I wonder, though -- should these be applied as fixes? After all, even the commit hash is provided there, so we could add a Fixes too. They could also be backported if needed.

Thanks!

Cheers,
Miguel

#8 lore raw

Re: [PATCH 3/3] scripts: generate_rust_analyzer: Add pin_init_internal deps

Quoted 4 lines · Miguel Ojeda

I wonder, though -- should these be applied as fixes? After all, even the commit hash is provided there, so we could add a Fixes too. They could also be backported if needed.

Ah, yeah, you already said that in the other two.

In that case, we can take the three of them into rust-fixes directly.

Cheers,
Miguel

author maintainer
#9 lore raw

Re: [PATCH 3/3] scripts: generate_rust_analyzer: Add pin_init_internal deps

Quoted 8 lines · Miguel Ojeda
Quoted 4 lines · Miguel Ojeda

I wonder, though -- should these be applied as fixes? After all, even the commit hash is provided there, so we could add a Fixes too. They could also be backported if needed.

Quoted 6 lines

Ah, yeah, you already said that in the other two.

In that case, we can take the three of them into rust-fixes directly.

Cheers,
Miguel

Sounds good to me. Miguel: do you need me to send a new version with the Fixes tags, or can they be added in a reply or at apply time?

#10 lore raw

Re: [PATCH 3/3] scripts: generate_rust_analyzer: Add pin_init_internal deps

Quoted 3 lines · Tamir Duberstein

Sounds good to me. Miguel: do you need me to send a new version with the Fixes tags, or can they be added in a reply or at apply time?

Yeah, they can be added in replies in general -- I will add them, no worries, thanks!

Fixes d7659acca7a3 ("rust: add pin-init crate build infrastructure")

Cheers,
Miguel

reviewer Reviewed-by on v1 3/3
#11 lore raw

Re: [PATCH 3/3] scripts: generate_rust_analyzer: Add pin_init_internal deps

In reply to Tamir Duberstein
Quoted 14 lines · Tamir Duberstein

Commit d7659acca7a3 ("rust: add pin-init crate build infrastructure") did not add dependencies to pin_init_internal, resulting in broken navigation. Thus add them now.

---
 scripts/generate_rust_analyzer.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/generate_rust_analyzer.py +0 -0
index 451d00dfc08d..229acd4cf1fb 100755

scripts/generate_rust_analyzer.py def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs, core_edit · line 108

Quoted 8 lines
scripts/generate_rust_analyzer.py +1 -1
@@ -102,7 +102,7 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs, core_edit
     append_crate(
         "pin_init_internal",
         srctree / "rust" / "pin-init" / "internal" / "src" / "lib.rs",
-        [],
+        ["std", "proc_macro"],
         cfg=["kernel"],
         is_proc_macro=True,
     )

Best regards,
Jesung

author maintainer
#12 lore raw
In reply to Tamir Duberstein

@Benno would you mind having a look at this series?

Quoted 24 lines · Tamir Duberstein

Minor fixes in this series. The main one is fixing navigation in pin_init_internal.

This is my first series using [email protected]; please excude any hiccups.

---
Tamir Duberstein (3):

      scripts: generate_rust_analyzer: Add compiler_builtins -> core dep
      scripts: generate_rust_analyzer: Add pin_init -> compiler_builtins dep
      scripts: generate_rust_analyzer: Add pin_init_internal deps
 scripts/generate_rust_analyzer.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

---
base-commit: dff64b072708ffef23c117fa1ee1ea59eb417807
change-id: 20250723-rust-analyzer-pin-init-925467269001

Best regards,
--
Tamir Duberstein <[email protected]>

reviewer Acked-by
#13 lore raw
Quoted 1 line · Tamir Duberstein

@Benno would you mind having a look at this series?

Oh wow this is an old series! Sorry for missing it.

I'm not maintaining the build system for pin-init, but from my side the changes look okay. The commit messages are missing some context though:
why do we need these dependency edges? etc. If you fix that you can add

Also note that this might be different in the new build system.

Cheers,
Benno

Quoted 25 lines · Tamir Duberstein
Quoted 24 lines

Minor fixes in this series. The main one is fixing navigation in pin_init_internal.

This is my first series using [email protected]; please excude any hiccups.

---
Tamir Duberstein (3):

      scripts: generate_rust_analyzer: Add compiler_builtins -> core dep
      scripts: generate_rust_analyzer: Add pin_init -> compiler_builtins dep
      scripts: generate_rust_analyzer: Add pin_init_internal deps
 scripts/generate_rust_analyzer.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

---
base-commit: dff64b072708ffef23c117fa1ee1ea59eb417807
change-id: 20250723-rust-analyzer-pin-init-925467269001

Best regards,
--
Tamir Duberstein <[email protected]>

author maintainer
#14 lore raw
Quoted 6 lines · Benno Lossin
Quoted 1 line · Tamir Duberstein

@Benno would you mind having a look at this series?

Oh wow this is an old series! Sorry for missing it.

Quoted 7 lines

I'm not maintaining the build system for pin-init, but from my side the changes look okay. The commit messages are missing some context though:
why do we need these dependency edges? etc. If you fix that you can add

Also note that this might be different in the new build system.

Thanks for the review! I think the commits all include answers to "why": the first two make RA match the actual build and the final one does the same and also fixes navigation in pin_init_internal; before this series, go-to-symbol from pin_init_internal to e.g. proc_macro::TokenStream doesn't work.

reviewer
#15 lore raw
Quoted 13 lines · Tamir Duberstein
Quoted 12 lines · Benno Lossin
Quoted 1 line · Tamir Duberstein

@Benno would you mind having a look at this series?

Oh wow this is an old series! Sorry for missing it.

I'm not maintaining the build system for pin-init, but from my side the changes look okay. The commit messages are missing some context though:
why do we need these dependency edges? etc. If you fix that you can add

Quoted 7 lines
Quoted 1 line

Also note that this might be different in the new build system.

Thanks for the review! I think the commits all include answers to "why": the first two make RA match the actual build and the final one does the same and also fixes navigation in pin_init_internal; before this series, go-to-symbol from pin_init_internal to e.g. proc_macro::TokenStream doesn't work.

Ah I missed the explanation since its so few words.

Cheers,
Benno

author maintainer
#16 lore raw
Quoted 23 lines · Benno Lossin
Quoted 13 lines · Tamir Duberstein
Quoted 12 lines · Benno Lossin
Quoted 1 line · Tamir Duberstein

@Benno would you mind having a look at this series?

Oh wow this is an old series! Sorry for missing it.

I'm not maintaining the build system for pin-init, but from my side the changes look okay. The commit messages are missing some context though:
why do we need these dependency edges? etc. If you fix that you can add

Quoted 7 lines
Quoted 1 line

Also note that this might be different in the new build system.

Thanks for the review! I think the commits all include answers to "why": the first two make RA match the actual build and the final one does the same and also fixes navigation in pin_init_internal; before this series, go-to-symbol from pin_init_internal to e.g. proc_macro::TokenStream doesn't work.

Quoted 4 lines

Ah I missed the explanation since its so few words.

Cheers,
Benno

Ack, thanks.

@Miguel could you please take this through rust-next? Assuming that is OK with Benno, which is my interpretation of his earlier replies.

#17 lore raw
Quoted 5 lines · Tamir Duberstein

Ack, thanks.

@Miguel could you please take this through rust-next? Assuming that is OK with Benno, which is my interpretation of his earlier replies.

Sounds good to me, of course.

Cc'ing Jesung, in case he didn't see this one and wants to give it a look/test.

Cheers,
Miguel

Applied
#18 lore raw
In reply to Tamir Duberstein
Quoted 8 lines · Tamir Duberstein

Minor fixes in this series. The main one is fixing navigation in pin_init_internal.

This is my first series using [email protected]; please excude any hiccups.

Applied to rust-fixes (with Fixes and Cc stable) -- thanks everyone!

[ Tamir elaborates:

"before this series, go-to-symbol from pin_init_internal to e.g.
proc_macro::TokenStream doesn't work."

- Miguel ]

Cheers,
Miguel