Commit 5c7548d5 authored by Asahi Lina's avatar Asahi Lina Committed by Miguel Ojeda
Browse files

scripts: generate_rust_analyzer: Handle sub-modules with no Makefile

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: default avatarAsahi Lina <lina@asahilina.net>
Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
parent c682e4c3
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -104,8 +104,11 @@ def generate_crates(srctree, objtree, sysroot_src):
            name = path.name.replace(".rs", "")

            # Skip those that are not crate roots.
            try:
                if f"{name}.o" not in open(path.parent / "Makefile").read():
                    continue
            except FileNotFoundError:
                continue

            logging.info("Adding %s", name)
            append_crate(