← 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. 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.

Suggested action:

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
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.
qwen3.6-35b-a3b-mtp-q6 Merged a fix for duplicate directories caused by usrmerge in OCI payloads. The code validates attributes and merges equivalent paths into a single layer entry, raising errors for conflicts. Resolves #203 and CRAFT-1634.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#200 oci: fix handling of subdirs in usrmerge rockcraft merged Merged fix for OCI payload handling where subdirectories were incorrectly placed in symlinked parent directories instead of their targets. Resolved plugin failures for directories like lib/. Approved by reviewers and passed CI checks.
87%
#231 oci: support file collisions if the files match rockcraft merged Merged changes handle file collisions in OCI payload layers when files match in attributes and contents, resolving issue #228. Approved by two reviewers and passing CI, enabling Ubuntu packages to serve as both overlay and stage packages.
77%
#55 oci: preserve directories when adding layers rockcraft merged Merged. Resolves #44 by preserving directory permissions and ownership when adding OCI image layers. Replaces manual file walking with a single directory addition using proper arcname. Approved and passed CI checks.
74%
#154 first pass at handling usrmerge rockcraft merged 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.
73%
#211 oci: fix handling of symlink subdirs rockcraft merged Merged fix to correctly include symlinked subdirectories in Rockcraft OCI tar archives. Contributor implemented the change, reviewer added tests, and the pull request was approved and merged, resolving issue #208.
73%
#7 oci: pass filename to oci archive creation method (CRAFT-585) rockcraft merged Merged updates to the OCI module API enabling callers to specify the output filename when exporting an OCI image to an archive. Approved by one reviewer, passed CI, and modified three files.
72%