Skip to content

Commit b200062

Browse files
simonwuelkereli-schwartz
authored andcommitted
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")
1 parent 01368ff commit b200062

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mesonbuild/cargo/interpreter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def _convert_manifest(raw_manifest: manifest.Manifest, subdir: str, path: str =
292292
[Benchmark(**_fixup_raw_mappings(b)) for b in raw_manifest.get('bench', {})],
293293
[Example(**_fixup_raw_mappings(b)) for b in raw_manifest.get('example', {})],
294294
raw_manifest.get('features', {}),
295-
{k: {k2: Dependency.from_raw(v2) for k2, v2 in v['dependencies'].items()}
295+
{k: {k2: Dependency.from_raw(v2) for k2, v2 in v.get('dependencies', {}).items()}
296296
for k, v in raw_manifest.get('target', {}).items()},
297297
subdir,
298298
path,

0 commit comments

Comments
 (0)