summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlaska <simon.wuelker@arcor.de>2023-10-29 00:06:28 +0200
committerEli Schwartz <eschwartz93@gmail.com>2023-10-30 08:25:46 -0400
commitb2000620f42ee730c47fcd7b4e510928b635e724 (patch)
tree5142fe26710684040d62f07cbea02c40c2b4f642
parent01368ffb293da009f3df139ebcdc5f9ac7557809 (diff)
downloadmeson-b2000620f42ee730c47fcd7b4e510928b635e724.tar.gz
cargo subprojects: don't assume each target has dependencies
Previously, creating a meson wrap with "method=cargo" for https://github.com/sunfishcode/is-terminal would fail, because its Cargo.toml contains a [target] section without dependencies. Instead, we now fall back to an empty list in case of no specified dependencies (like everywhere else in "_convert_manifest")
-rw-r--r--mesonbuild/cargo/interpreter.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/cargo/interpreter.py b/mesonbuild/cargo/interpreter.py
index 9e5910c09..a6634ac1b 100644
--- a/mesonbuild/cargo/interpreter.py
+++ b/mesonbuild/cargo/interpreter.py
@@ -292,7 +292,7 @@ def _convert_manifest(raw_manifest: manifest.Manifest, subdir: str, path: str =
[Benchmark(**_fixup_raw_mappings(b)) for b in raw_manifest.get('bench', {})],
[Example(**_fixup_raw_mappings(b)) for b in raw_manifest.get('example', {})],
raw_manifest.get('features', {}),
- {k: {k2: Dependency.from_raw(v2) for k2, v2 in v['dependencies'].items()}
+ {k: {k2: Dependency.from_raw(v2) for k2, v2 in v.get('dependencies', {}).items()}
for k, v in raw_manifest.get('target', {}).items()},
subdir,
path,