bootc: Test ostree against the Rust libcomposefs - #408
Open
cgwalters-bot wants to merge 3 commits into
Open
cgwalters-bot wants to merge 3 commits into
cgwalters-bot wants to merge 3 commits into
Conversation
ostree gives each file a libcomposefs payload of `xx/<checksum>.file` and sets the fsverity digest separately. The capi turned the payload into an ObjectID (dropping `.file`) or ignored it when a digest was set, so the redirect pointed at a file that doesn't exist and an ostree deployment on the Rust libcomposefs couldn't boot. ExternalPath carries an optional redirect as given plus an optional verity digest, which is how libcomposefs models it. RegularFile::external() builds it from the pair and keeps the usual composefs layout (redirect is the digest's object path) as External, so the capi, the EROFS reader and the dumpfile parser all normalize the same way. A digest without a payload now stays that way everywhere, as in C: no redirect is made up for it, and the dumpfile parser accepts it. composefs-info lists the redirect as the object path, like C's, so ostree images don't lose their objects there. In V2 images ExternalPath gets the same single null chunk index as External. Note Item::Regular's path in dumpfile_parse is now an Option, and a redirect with an interior NUL fails the capi conversion instead of being dropped. The new test builds an image like ostree does via the C API and pins its digest; `just test-capi` compares the same image against the C library. Generated-by: AI Signed-off-by: Colin Walters <walters@verbum.org>
pack.sh needs cargo-vendor-filterer, which isn't packaged anywhere and gets installed unpinned with `cargo install`. `PACK_VENDOR=cargo` uses `cargo vendor` instead, for builds that only need a working RPM and would rather not fetch and build another tool; the vendor tarball is bigger since it keeps every platform's crates. Prep for building RPMs in the bootc revdep test. Generated-by: AI Signed-off-by: Colin Walters <walters@verbum.org>
ostree is the main C consumer of libcomposefs, and nothing tests it against our implementation yet: the capi job only runs the C library's own test suite. For composefs-rs to replace the C composefs package, ostree's composefs support (writing images at deploy time, mounting them from ostree-prepare-root) has to work on the Rust library. The new `just bootc/test-ostree` builds the composefs RPMs from this checkout with pack.sh and composefs.spec (vendoring with plain cargo) in a CentOS Stream 10 buildroot, and adds them to the packages bootc installs into its test image. bootc installs those from a local repository that takes priority over the distribution's, so they replace the C composefs. It checks that libostree loads our libcomposefs, and that the initramfs has the same library, then runs bootc's readonly and upgrade-with-reboot tests with the ostree backend. The revdep workflow runs it as a second matrix entry (still behind the workflow's temporary `if: never()`). Generated-by: AI Signed-off-by: Colin Walters <walters@verbum.org>
cgwalters
requested changes
Oct 2, 2026
cgwalters
left a comment
Collaborator
There was a problem hiding this comment.
This now stacks on #409 rihgt?
One thing I'd love to do is to start tryingout https://docs.github.com/en/pull-requests/how-tos/stacked-pull-requests for this stuff, give it a shot on this PR?
| git archive --format=tar --prefix="${PREFIX}" -o "${TAR}" HEAD | ||
|
|
||
| # Vendor tarball via cargo-vendor-filterer | ||
| VENDOR_CONFIG=$(cargo vendor-filterer --prefix=vendor --format=tar.zstd "${VENDORTAR}") |
Collaborator
There was a problem hiding this comment.
Nah let's keep this a requirement, if we're hitting inefficiency here well...yeah we should just ship it in Fedora derivatives.
But for now how about installing it as part of our github.com/bootc-dev/bootc-host-setup action ?
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on cgwalters-forge#7 (
ExternalPath, which keeps ostree'sxx/<checksum>.fileredirects), whose commit is the first one here; review only the last two. #401 (the mount fixes it was stacked on before) is merged, so its commits are gone from this branch.Adds
just bootc/test-ostree, a second matrix entry in the bootc revdep workflow. It builds the composefs RPMs from the tree (pack.sh + composefs.spec) in a CentOS Stream 10 buildroot and puts them into the packages bootc installs into its test image, so they replace the C composefs. It checks that libostree loads our libcomposefs and that the initramfs has the identical file, then runs bootc'sreadonlyandimage-upgrade-rebootplans on the ostree backend (BOOTC_variant=ostree, set explicitly).A prep commit adds
PACK_VENDOR=cargoto pack.sh, so the test vendors with the distribution'scargo vendorinstead of installing rustup and an unpinned cargo-vendor-filterer. pack.sh now also fails if vendoring printed no source replacement config. The RPM build runs withCARGO_NET_OFFLINE=true, so it has to use the vendored crates.The workflow keeps upstream's temporary
if: never()(waiting onbootc-dev/bootc#2490), so neither matrix entry runs until that's lifted. The ostree entry is no longercontinue-on-error, since it passes with #7.Tested on a 16-core RHEL 10 devspace (kernel 6.12),
just bootc/test-ostreeat3d53788(the same tree as this head708ba90, which only rewords #7's commit message). bootc wasbootc-dev/bootc#2490plus the adaptation frombot/composefs-externalpathon cgwalters-bot/bootc, since bootc doesn't build against #7 without it:PACK_VENDOR=cargo;libostree uses /usr/lib64/libcomposefs.so.1.4.0 from composefs-libs-202609290233.g3d53788b2b-1.el10.x86_64, and the initramfs has the same file;plan-01-readonly,plan-24-image-upgrade-reboot): the ostree deployment boots through ostree-prepare-root on the Rust libcomposefs and survives an upgrade with a reboot.Related: #323
The
Signed-off-by: Colin Walters <walters@verbum.org>on these commits was added on cgwalters's approval of the review draft: cgwalters-forge#4 (review)Generated-by: https://github.com/cgwalters/#llms