diff options
author | Thibault Saunier <tsaunier@igalia.com> | 2022-09-17 17:33:34 +0300 |
---|---|---|
committer | Sebastian Dröge <slomo@coaxion.net> | 2022-09-19 23:11:40 +0300 |
commit | f19af9f7607d32d96925e6aab55fc8129c14a4a1 (patch) | |
tree | ccd0bcb16806c79cf12ffc53342b7556e2fa5e8a /dependencies.py | |
parent | ced6bcc24647ae07c647a75a166c2d48a9a4d7d7 (diff) |
meson: Use workspace Cargo.toml to find crates path
We were globing recursively during meson run and it was spending 20secs
here in total only to run the dependencies.py script
Diffstat (limited to 'dependencies.py')
-rwxr-xr-x | dependencies.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/dependencies.py b/dependencies.py index 801981d0a..a2cfde152 100755 --- a/dependencies.py +++ b/dependencies.py @@ -6,6 +6,8 @@ from argparse import ArgumentParser from pathlib import Path +import sys + try: # Python11 stdlib @@ -40,14 +42,19 @@ RENAMES = { if __name__ == "__main__": opts = PARSER.parse_args() + with (opts.src_dir / 'Cargo.toml').open('rb') as f: + crates = tomllib.load(f)['workspace']['members'] deps = set() for p in opts.plugins: assert p.startswith('gst') name = p[3:] name = RENAMES.get(name, name) - files = list(opts.src_dir.glob(f'**/{name}/Cargo.toml')) - assert len(files) == 1 - with files[0].open('rb') as f: + crate_path = None + for crate in crates: + if Path(crate).name == name: + crate_path = opts.src_dir / crate / 'Cargo.toml' + assert crate_path + with crate_path.open('rb') as f: data = tomllib.load(f) try: requires = data['package']['metadata']['capi']['pkg_config']['requires_private'] |