lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260123-fix-pin-init-crate-dependecies-v1-1-1c6cfe9aa352@gmail.com>
Date: Fri, 23 Jan 2026 10:02:45 +0000
From: SeungJong Ha via B4 Relay <devnull+engineer.jjhama.gmail.com@...nel.org>
To: Miguel Ojeda <ojeda@...nel.org>, Boqun Feng <boqun.feng@...il.com>, 
 Gary Guo <gary@...yguo.net>, 
 Björn Roy Baron <bjorn3_gh@...tonmail.com>, 
 Benno Lossin <lossin@...nel.org>, Andreas Hindborg <a.hindborg@...nel.org>, 
 Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>, 
 Danilo Krummrich <dakr@...nel.org>
Cc: rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org, 
 SeungJong Ha <engineer.jjhama@...il.com>
Subject: [PATCH] scripts: generate_rust_analyzer.py: better pin-init macro
 resolvea

From: SeungJong Ha <engineer.jjhama@...il.com>

Signed-off-by: SeungJong Ha <engineer.jjhama@...il.com>
---
scripts: generate_rust_analyzer.py: Fix pin-init configuration for
better macro resolve

Hello,

I encountered an issue where rust-analyzer fails to analyze
structs decorated with the #[pin_data] attribute while testing
Rust kernel modules.

It appears that the dependencies for pin-init and drivers were
missing from the analyzer's configuration. This patch adds
those missing dependencies.

I have verified that my rust-analyzer correctly processes
\#[pin_data] structs after applying this fix.

Best regards, SeungJong
---
 scripts/generate_rust_analyzer.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/scripts/generate_rust_analyzer.py b/scripts/generate_rust_analyzer.py
index 147d0cc94068..0c6c0444917f 100755
--- a/scripts/generate_rust_analyzer.py
+++ b/scripts/generate_rust_analyzer.py
@@ -123,10 +123,18 @@ 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,
     )
+    # pin_init_internal uses #[path = "../../../macros/quote.rs"] to include quote.rs
+    crates[-1]["source"] = {
+        "include_dirs": [
+            str(srctree / "rust" / "pin-init" / "internal" / "src"),
+            str(srctree / "rust" / "macros"),
+        ],
+        "exclude_dirs": [],
+    }
 
     append_crate(
         "pin_init",
@@ -190,7 +198,7 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs, core_edit
             append_crate(
                 name,
                 path,
-                ["core", "kernel"],
+                ["core", "kernel", "pin_init"],
                 cfg=cfg,
             )
 

---
base-commit: 2ad6c5cdc89acfefb01b84afa5e55262c40d6fec
change-id: 20260123-fix-pin-init-crate-dependecies-b94ac4247a48

Best regards,
-- 
SeungJong Ha <engineer.jjhama@...il.com>



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ