Skip to content

build: Error out when rootfs contains unpruned ostree sysroot#99

Merged
jlebon merged 1 commit intocoreos:mainfrom
cgwalters:error-if-ostree
Apr 1, 2026
Merged

build: Error out when rootfs contains unpruned ostree sysroot#99
jlebon merged 1 commit intocoreos:mainfrom
cgwalters:error-if-ostree

Conversation

@cgwalters
Copy link
Copy Markdown
Member

Chunking an ostree object store produces poor results and is almost certainly a user error (the objects directory contains many small content-addressed files that defeat component-based grouping). Detect this early and point the user to the README section on bootc compatibility.

The check passes if --prune /sysroot/ is specified, which is the documented approach for rechunking bootc images.

Refs: #97
Assisted-by: OpenCode (Claude Opus 4)

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a validation step to ensure that OSTree object stores within a rootfs are explicitly pruned during the build process, preventing suboptimal chunking results. The implementation includes a new check_ostree_sysroot function and corresponding unit tests. Feedback suggests improving the robustness of the prune path check by using path-based prefix matching instead of exact string comparisons to correctly identify when a sub-path covers the target directory.

Comment thread src/cmd_build.rs Outdated
Comment thread src/cmd_build.rs Outdated
Comment thread src/cmd_build.rs Outdated
@cgwalters cgwalters force-pushed the error-if-ostree branch 2 times, most recently from 4d83e2d to f181549 Compare March 31, 2026 22:11
Chunking an ostree object store produces poor results and is almost
certainly a user error. Detect this by checking the scanned file map
for /sysroot/ostree paths (which naturally respects --prune) and warn
with a 7-second sleep so the message is visible in scrolling output.

This is a soft warning rather than a hard error since chunkah should
not strictly enforce this -- no data loss is involved, just suboptimal
layer splitting.

Refs: coreos#97
Assisted-by: OpenCode (Claude Opus 4)
@jlebon jlebon force-pushed the error-if-ostree branch from f181549 to 7af92d5 Compare April 1, 2026 13:16
Copy link
Copy Markdown
Member

@jlebon jlebon left a comment

Choose a reason for hiding this comment

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

Thanks! (Force-pushed to drop some duplicate comments.)

@jlebon jlebon enabled auto-merge (rebase) April 1, 2026 13:17
@jlebon jlebon merged commit 0c2323c into coreos:main Apr 1, 2026
10 checks passed
@cgwalters
Copy link
Copy Markdown
Member Author

(Force-pushed to drop some duplicate comments.)

Thanks and sorry I missed that!

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.

2 participants