← Back to issue list

Conflicting files when packing a ROCK with overlay-packages on an ubuntu base

View original Github issue

Metadata

Project
rockcraft
Number
#228
Type
issue
State
closed
Author
tigarmo
Labels
—
Created
Updated
Closed

Current evaluation

Usrmerge file collisions between overlay-packages and stage-packages on an Ubuntu base broke `rockcraft pack`. Fixed by merged PR #231 (commit 5ec8b09f), which allows identical files at colliding OCI paths.

Resolution: closed resolved

Reason: PR #231 "oci: support file collisions if the files match" was merged as commit 5ec8b09f and fixes #228; the maintainer closed the issue with the comment "Fixed by #231" (2023-04-20). The change makes OCI layer creation tolerate conflicting files when attributes and contents match, covering the usrmerged overlay/stage case.

Evaluated by: mr-cal-bot

No scores available.

Issue body

[This commit](https://github.com/canonical/rockcraft/commit/c3382fc2408e3e2bae964e0622e50798c46a2e2f) added handling for multiple paths ending up as the same, "final" one when the usrmerge is taken into account. Currently we accept conflicting _directories_, but not _files_ because we didn't know a "live" use-case for conflicting files. The following is a reduced example of a real rockcraft.yaml: ``` parts: overlay-pkgs: plugin: nil overlay-packages: [libexpat1] regular-pkgs: plugin: nil stage-packages: [libexpat1] ``` Error message: ``` Creating new layer Conflicting paths pointing to 'usr/lib/x86_64-linux-gnu/libexpat.so.1': /root/prime/lib/x86_64-linux-gnu/libexpat.so.1, /root/prime/usr/lib/x86_64-linux-gnu/libexpat.so.1 craft-providers error: Failed to execute pack in instance ``` The `libexpat1` package provides `lib/x86_64-linux-gnu/libexpat.so.1`. My initial reasoning for the root cause of the bug is that, because the overlay is on top of an ubuntu base, `lib/x86_64-linux-gnu/libexpat.so.1` becomes `usr/lib/x86_64-linux-gnu/libexpat.so.1` (because of the usrmerge), which then conflicts with the `lib/x86_64-linux-gnu/libexpat.so.1` file provided by the `regular-pkgs` part. The files are identical (as indicated by `md5sum`), so in this case it seems reasonable to accept conflicts _if_ all paths are identical files. (cc @jnsgruk)

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Usrmerge file collisions between overlay-packages and stage-packages on an Ubuntu base broke `rockcraft pack`. Fixed by merged PR #231 (commit 5ec8b09f), which allows identical files at colliding OCI paths.
stealth/space-bunny-alpha — closed resolved Usrmerge caused overlay and stage package files (e.g. libexpat.so.1) to collide on Ubuntu bases; fixed by rockcraft PR #231 (commit 5ec8b09f), merged, which accepts OCI file collisions when attributes and contents match.
stealth/space-bunny-alpha — closed resolved Resolved in canonical/rockcraft#231 by accepting OCI file collisions when attributes and contents match, including usrmerged overlay and stage paths.
qwen/qwen3.6-35b-a3b — — Fixed conflicting file paths during ROCK packing caused by usrmerge handling overlay and stage packages. Resolved in PR #231 by permitting identical file conflicts.
qwen/qwen3.6-35b-a3b — — Fixed by PR #231. Resolved a conflict error during ROCK packing when overlay and stage packages placed identical files in different paths due to usrmerge. The update now permits identical files to coexist without triggering path conflicts.
qwen/qwen3.6-35b-a3b — — Fixed by PR #231. Resolves a conflict error during ROCK packing when usrmerge causes identical files from overlay and stage packages to report conflicting paths. The update now accepts identical files at overlapping paths.
qwen3.6-35b-a3b-mtp-q6 — — Fixed conflicting file errors during ROCK packing caused by usrmerge path discrepancies. Identical files are now permitted when paths differ, merged via PR #231.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/rockcraft#231 (confidence 98%)

    Merged PR implementing file-collision support in the OCI payload layer; the only commit in rockcraft history matching 'collision' for this fix is 5ec8b09f "oci: support file collisions if the files match (#231)".

Related issues

Issue Project State Summary Similarity
#363 when packing, the resulting OCI layer from the parts may have content that is already in the Ubuntu base rockcraft closed Redundant primed files are now pruned when identical to files in the Ubuntu base. Merged in canonical/rockcraft#417 (623551b5) and released in Rockcraft 1.1.0.
74%
#194 Unable to import rock into the docker daemon when packing with python plugin and staging python3-dev rockcraft closed Fixed by PR #200 (commit 3f43e30e), which corrected OCI handling of subdirectories under usrmerge and prevented conflicting Python symlinks from corrupting the rock.
72%
#1217 Overlay packages fail to copy properly. rockcraft closed Overlay-package priming failure (CopyFileNotFound on symlinked libs) fixed by bumping craft-parts in merged PR #1249 (55ade214); shipped in rockcraft 1.19.1 via release merge #1268.
71%