Skip to content

builder-manifest: Prevent writing duplicate build groups#713

Merged
bbhtt merged 2 commits intomainfrom
bbhtt/dupe-metadata-2
Mar 12, 2026
Merged

builder-manifest: Prevent writing duplicate build groups#713
bbhtt merged 2 commits intomainfrom
bbhtt/dupe-metadata-2

Conversation

@bbhtt
Copy link
Contributor

@bbhtt bbhtt commented Mar 10, 2026

Previously, builder_manifest_create_platform_base() copied the SDK
metadata to metadata.platform and builder_manifest_finish_platform()
later appended the platform's built-extensions to it. If the SDK
metadata already contained a Build group with built-extensions, this
would resulted in duplicate groups and keys in the final platform
metadata.

Fix this by loading both metadata with GKeyFile and merging the
build-extensions entries and deduplicated string values.

Fixes the second issue in:
#618 (comment)

Fixes #618

@bbhtt bbhtt force-pushed the bbhtt/dupe-metadata-2 branch from d69dcc3 to d22537d Compare March 10, 2026 15:08
@bbhtt
Copy link
Contributor Author

bbhtt commented Mar 11, 2026

Added a test for it but looks like there is a conflict and CI doesn't want to run...

@bbhtt bbhtt force-pushed the bbhtt/dupe-metadata-2 branch from 73e2c3f to 875af0f Compare March 11, 2026 18:38
Previously, builder_manifest_create_platform_base() copied the SDK
metadata to metadata.platform and builder_manifest_finish_platform()
later appended the platform's built-extensions to it. If the SDK
metadata already contained a Build group with built-extensions, this
would resulted in duplicate groups and keys in the final platform
metadata.

Fix this by loading both metadata with GKeyFile and merging the
build-extensions entries and deduplicated string values.

Fixes the second issue in:
#618 (comment)
@bbhtt bbhtt force-pushed the bbhtt/dupe-metadata-2 branch from 875af0f to 5bd2f0f Compare March 11, 2026 18:43
@bbhtt bbhtt force-pushed the bbhtt/dupe-metadata-2 branch from 5bd2f0f to 6b56177 Compare March 11, 2026 18:45
@bbhtt bbhtt merged commit 678e4a0 into main Mar 12, 2026
3 checks passed
@bbhtt bbhtt deleted the bbhtt/dupe-metadata-2 branch March 12, 2026 13:52
@bbhtt bbhtt added this to the 1.5.0 milestone Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flatpak-builder sometimes creates duplicate groups in metadata

2 participants