Skip to content

Commit fc7b6e1

Browse files
zecakehhfiguiere
authored andcommitted
cargo: Merge workspace features with crate features
Those features are additive so the workspace should not overwrite the ones declared on the crate
1 parent bb7d86b commit fc7b6e1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cargo/flatpak-cargo-generator.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,13 @@ def update_workspace_keys(pkg, workspace):
136136
if 'workspace' in item:
137137
if isinstance(workspace_item, dict):
138138
del item['workspace']
139-
item.update(workspace_item)
139+
140+
for dep_key, workspace_value in workspace_item.items():
141+
# features are additive
142+
if dep_key == 'features' and 'features' in item:
143+
item['features'] += workspace_value
144+
else:
145+
item[dep_key] = workspace_value
140146
elif len(item) > 1:
141147
del item['workspace']
142148
item.update({ 'version': workspace_item })

0 commit comments

Comments
 (0)