diff options
| author | Asahi Lina <[email protected]> | 2023-04-06 22:25:22 +0000 |
|---|---|---|
| committer | Miguel Ojeda <[email protected]> | 2023-04-06 22:53:34 +0000 |
| commit | 5c7548d5a25306dcdb97689479be81cacc8ce596 (patch) | |
| tree | 8b84b503bf9cd7af9b4c3c14bbafd4ffd9fefc80 /scripts/generate_rust_analyzer.py | |
| parent | rust: kernel: Mark rust_fmt_argument as extern "C" (diff) | |
| download | kernel-5c7548d5a25306dcdb97689479be81cacc8ce596.tar.gz kernel-5c7548d5a25306dcdb97689479be81cacc8ce596.zip | |
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: Asahi Lina <[email protected]>
Signed-off-by: Miguel Ojeda <[email protected]>
Diffstat (limited to 'scripts/generate_rust_analyzer.py')
| -rwxr-xr-x | scripts/generate_rust_analyzer.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/generate_rust_analyzer.py b/scripts/generate_rust_analyzer.py index ecc7ea9a4dcf..946e250c1b2a 100755 --- a/scripts/generate_rust_analyzer.py +++ b/scripts/generate_rust_analyzer.py @@ -104,7 +104,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) |
