← Back to issue list

oci: handle duplicate directories because of usrmerge

View original Github issue

Metadata

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

Current evaluation

Merged #204 as c3382fc2, fixing OCI failures from usrmerge-aliased duplicate directories with matching attributes; mismatched attributes and file conflicts still error.

Resolution: closed resolved

Reason: PR canonical/rockcraft#204 was merged as commit c3382fc2. It emits one OCI layer entry for equivalent usrmerge-aliased directories, and the reporter confirmed that it solved #203.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Reviewing note: the first commit restructures the code a bit without functional changes; the second commit has the actual bugfix. ================= The situation is this: the primed payload has two distinct directories (e.g. bin/dir1 and usr/bin/dir1) that, because of the usrmerge handling, "point" to the same location (in this case, /usr/bin/dir1). We check that the two directories have the same attributes (ownership and mode) and then add a single entry to the layer (either one, they are all equivalent). All other cases (dirs with different attributes, conflicts between files) raise errors. The reason for this is that we haven't seen this come up "in the wild" yet, and it's hard to choose a behavior when we don't know the circunstances. (CRAFT-1634)

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged #204 as c3382fc2, fixing OCI failures from usrmerge-aliased duplicate directories with matching attributes; mismatched attributes and file conflicts still error.
stealth/space-bunny-alpha — closed resolved Merged PR canonical/rockcraft#204 (commit c3382fc2) by tigarmo fixes #203: usrmerge-aliased duplicate directories (e.g. bin/dir1 and usr/bin/dir1) now collapse to a single OCI layer entry when attributes match; conflicts still error. (CRAFT-1634)
stealth/space-bunny-alpha — closed resolved Merged in canonical/rockcraft#204 (c3382fc2), fixing #203: equivalent usrmerge-aliased directories now share one OCI layer entry; attribute and file conflicts remain errors.
qwen/qwen3.6-35b-a3b — — Merged. Resolves CRAFT-1634 and issue #203 by handling usrmerge duplicate directories in OCI payloads. The fix verifies matching attributes before merging directories into a single layer entry and raises errors for conflicts. Approved, passed CI, and modified six files.
qwen3.6-35b-a3b-mtp-q6 — — Merged to resolve issue #203. The fix handles usrmerge duplicate directories by merging entries with matching attributes into a single layer entry, preserving error handling for conflicts. Verified by reporter.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/rockcraft#203 (confidence 100%)

    Duplicate OCI paths caused by /lib and /usr/lib resolving to the same location; fixed by #204.

Related issues

Issue Project State Summary Similarity
#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.
84%
#211 oci: fix handling of symlink subdirs rockcraft merged Merged PR #211 in commit 1783fa2a, fixing OCI archive creation to include symlinked subdirectories and resolving #208.
73%
#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.
73%