Skip to content

Commit 12860de

Browse files
authored
Merge pull request #883 from AsahiLinux/rust/makefile-fix
scripts: generate_rust_analyzer: Handle sub-modules with no Makefile
2 parents 0a04dc4 + ae5cfd7 commit 12860de

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scripts/generate_rust_analyzer.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ def append_crate(display_name, root_module, deps, cfg=[], is_workspace_member=Tr
104104
name = path.name.replace(".rs", "")
105105

106106
# Skip those that are not crate roots.
107-
if f"{name}.o" not in open(path.parent / "Makefile").read():
107+
try:
108+
if f"{name}.o" not in open(path.parent / "Makefile").read():
109+
continue
110+
except FileNotFoundError:
108111
continue
109112

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

0 commit comments

Comments
 (0)