Skip to content

Commit

Permalink
cargo subprojects: don't assume each target has dependencies
Browse files Browse the repository at this point in the history
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")
  • Loading branch information
simonwuelker authored and eli-schwartz committed Oct 30, 2023
1 parent 01368ff commit b200062
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mesonbuild/cargo/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b200062

Please sign in to comment.