← Back to issue list

first pass at handling usrmerge

View original Github issue

Metadata

Project
rockcraft
Number
#154
Type
pull request
State
merged
Author
tigarmo
Labels
—
Created
Updated
Closed

Current evaluation

Merged PR #154 (commit 607d934f, "oci: handle symlinks in base layer (usrmerge)"). add_layer() now takes the extracted base, so files primed under /lib or /bin are written to the usrmerge symlink target (/usr/lib, /usr/bin) instead of breaking Ubuntu-based rocks; lifecycle passes the base forward.

Resolution: closed resolved

Reason: The PR itself was merged into the main branch after approval from 3 reviewers, landing as commit 607d934f. It implemented the described fix: oci.Image.add_layer() gained a base-path parameter and now re-homes primed files beneath symlinked base dirs, with lifecycle updated to forward the extracted base and a jammy CI runner added for umoci-based integration tests.

Evaluated by: mr-cal-bot

No scores available.

Issue body

This commit is a first step in gracefully handling existing layers when packing the parts' contents. Specifically, it fixes the existing breakage where priming a file in "/lib" will break a resulting Ubuntu-based rock because on the base "/lib" is a symlink to "/usr/lib", and if that link is broken everything breaks. The updates to support this are: - Enhance oci.Image.add_layer() to take the existing base into account, via a parameter that points to the extracted base (see below); - Update lifecycle code to pass the extracted base forward when packing; - Add a jammy runner to CI, because the new integrated tests need umoci which is only available on jammy. The update to add_layer() is to look for a file's parent dir in the existing base. If it *does* exist, and is a symlink to another dir, add the file as belonging to the symlink target instead. For example: - The prime dir contains "bin/file.txt"; - The base is ubuntu:22.04, which means that there "/bin/" is a symlink to "/usr/bin"; - Instead of adding the file as "bin/file.txt", add it as "usr/bin/file.txt". Note that the original idea of just adding "bin/file.txt" but *not* adding the "bin/" itself seems to be flaky; it works on *some* configurations of the relevant tools but not others (more investigation necessary).

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged PR #154 (commit 607d934f, "oci: handle symlinks in base layer (usrmerge)"). add_layer() now takes the extracted base, so files primed under /lib or /bin are written to the usrmerge symlink target (/usr/lib, /usr/bin) instead of breaking Ubuntu-based rocks; lifecycle passes the base forward.
stealth/space-bunny-alpha — closed resolved Merged rockcraft PR #154, fixing packing of usrmerged Ubuntu bases by placing primed files in symlink target directories and forwarding the extracted base during packing.
qwen/qwen3.6-35b-a3b — — Merged. Fixes rock packing breakage from usrmerge symlinks by redirecting files to their target directories. Updates oci.Image.add_layer() and lifecycle packing, adds a Jammy CI runner. Approved by three reviewers.
qwen3.6-35b-a3b-mtp-q6 — — Merged a fix for usrmerge handling that prevents /lib symlink breakage during rock packing. Updates oci.Image.add_layer() to redirect files to symlink targets, passes the extracted base forward, and adds a Jammy CI runner.

Update history

No update history recorded yet.

Related work

  • Related To: rockcraft#163 (confidence 70%)

    Follow-up merged PR 501e6eae adding opaque whiteout handling for usrmerge base-layer symlinks.

  • Related To: rockcraft#200 (confidence 70%)

    Follow-up merged PR 3f43e30e fixing subdirectory handling under usrmerge symlinks in OCI.

  • Related To: rockcraft#231 (confidence 45%)

    Later OCI work (5ec8b09f) on file collisions in layers, touching the same packing code paths.

Related issues

Issue Project State Summary Similarity
#187 usrmerge handling is not dealing with subdirectories rockcraft closed Fixed by PR #200 (commit 3f43e30e, "oci: fix handling of subdirs in usrmerge"); files and subdirs under base-layer usrmerge symlinks (e.g. lib) are now archived at the symlink target path. Closed by maintainer tigarmo.
79%
#200 oci: fix handling of subdirs in usrmerge rockcraft merged Merged in PR #200 as commit 3f43e30e, fixing OCI usrmerge so subdirectories beneath base-layer symlinks are written to the symlink target.
78%
#498 fix(lifecycle): remove usrmerge-breaking symlinks rockcraft merged Merged PR #498 (commit 05489c80) fixes Ubuntu 24.04 Python-plugin rocks by removing the primed lib64 -> lib symlink that broke the base usrmerge layout.
71%