Skip to content

tools: add a manifest reconciliation tool to refresh the manifest after hook changes#444

Merged
Meulengracht merged 9 commits into
canonical:mainfrom
Meulengracht:main
May 15, 2026
Merged

tools: add a manifest reconciliation tool to refresh the manifest after hook changes#444
Meulengracht merged 9 commits into
canonical:mainfrom
Meulengracht:main

Conversation

@Meulengracht
Copy link
Copy Markdown
Member

@Meulengracht Meulengracht commented May 12, 2026

Snapcraft uses the chisel manifest to detect packages installed, and due to the hooks trimming packages, including the python hiding, the manifest unfortunately defines packages/libraries that are simply not available. This breaks snap builds against core26.

Overall the script does two things;

  • Automatically prunes entries that do not have a physical file present
  • Introduces a --exclude-python which prunes python entries as we are effectively hiding python. When we reach core28 we can remove this again, thus the reason as to why it's a separate switch
  • Refreshes the manifest header with an updated count

SNAPDENG-36930

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a post-hook reconciliation step to ensure Chisel’s manifest.wall matches the final rootfs contents after hooks remove files (notably around hidden Python), preventing Snapcraft from seeing packages/libraries that are no longer present.

Changes:

  • Add tools/refresh-manifest.py to prune stale manifest.wall entries based on actual rootfs contents, with an option to exclude Python-related entries.
  • Invoke the reconciliation tool from the hooks Makefile target after hook execution.
  • Add zstd as a build dependency (currently in the chisel-libs part).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
tools/refresh-manifest.py New reconciliation tool that filters manifest.wall based on rootfs existence and optional Python exclusion.
Makefile Runs the reconciliation tool after hooks to keep the manifest aligned with the shipped rootfs.
snapcraft.yaml Adds zstd build dependency (needed for zstdcat/zstd used by the reconciliation tool).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread snapcraft.yaml Outdated
Comment thread tools/refresh-manifest.py
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Comment thread tools/refresh-manifest.py Outdated
Comment thread tools/refresh-manifest.py Outdated
Comment thread tools/refresh-manifest.py Outdated
@Meulengracht Meulengracht marked this pull request as ready for review May 14, 2026 07:51
Comment thread tools/refresh-manifest.py Outdated
Comment thread tools/refresh-manifest.py Outdated
Comment thread tools/refresh-manifest.py Outdated
Comment thread tools/refresh-manifest.py Outdated
…ry, couple of styling changes, additionally we must update the entry count in the manifest header, this was missing
@Meulengracht Meulengracht merged commit 4dad436 into canonical:main May 15, 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.

3 participants