mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
scripts: generate_rust_analyzer: Handle sub-modules with no Makefile
[ Upstream commit 5c7548d5a2 ]
More complex drivers might want to use modules to organize their Rust
code, but those module folders do not need a Makefile.
generate_rust_analyzer.py currently crashes on those. Fix it so that a
missing Makefile is silently ignored.
Link: https://github.com/Rust-for-Linux/linux/pull/883
Signed-off-by: Asahi Lina <lina@asahilina.net>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Stable-dep-of: 2e0f91aba507 ("scripts: generate_rust_analyzer: add missing macros deps")
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
99ddc1491b
commit
d266fc89bc
@@ -98,7 +98,10 @@ def generate_crates(srctree, objtree, sysroot_src):
|
||||
name = path.name.replace(".rs", "")
|
||||
|
||||
# Skip those that are not crate roots.
|
||||
if f"{name}.o" not in open(path.parent / "Makefile").read():
|
||||
try:
|
||||
if f"{name}.o" not in open(path.parent / "Makefile").read():
|
||||
continue
|
||||
except FileNotFoundError:
|
||||
continue
|
||||
|
||||
logging.info("Adding %s", name)
|
||||
|
||||
Reference in New Issue
Block a user