← Back to issue list

Bad symlink collisions between overlay and build

View original Github issue

Metadata

Project
craft-parts
Number
#1293
Type
issue
State
closed
Author
tigarmo
Labels
Status: Triaged
Created
Updated
Closed

Current evaluation

Fixed by merged PR #1314 (commit bff2fa08): equivalent absolute and relative symlinks no longer trigger false overlay/install collision errors.

Resolution: closed resolved

Reason: PR #1314 was merged, and commit bff2fa08 resolved #1293 by preventing collisions between equivalent absolute and relative symlinks in overlay and install directories.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### Bug Description The new collision handling between overlay and stage is reporting issues on symlinks. In the included example, the path `usr/lib/ssl/cert.pem` is present in both the overlay and the part's install dir, and is a symlink in both cases. However, the overlay symlink points to an absolute path: ``` lrwxrwxrwx 1 root root 34 Feb 5 2025 cert.pem -> /etc/ssl/certs/ca-certificates.crt ``` ... while the file coming from the stage-package is a relative symlink: ``` lrwxrwxrwx 1 root root 42 Sep 10 14:11 cert.pem -> ../../../etc/ssl/certs/ca-certificates.crt ``` It's a relative symlink because of the way craft-parts handles stage-packages, which is correct. However, in this case maybe both files should be considered "the same" since they will ultimately resolve to the same path in the payload (for Rockcraft and Imagecraft at least). As an aside, these absolute symlinks from the overlay are dangerous when they staged, as they now point to the build system (which is wrong) and will give wrong results if a part uses them. That's unrelated to this specific issue, which is only about the bad collision itself. ### To Reproduce Use Rockcraft 1.14 to build the attached part. ### part yaml ```shell parts: my-part: plugin: nil overlay-packages: [openssl] stage-packages: [openssl] ``` ### Relevant log output ```shell Failed to stage: parts list the same file or directory with different contents or permissions. Detailed information: Part 'my-part' and the overlay of part 'my-part' list the following files, but with different contents or permissions: usr/lib/ssl/cert.pem usr/lib/ssl/certs usr/lib/ssl/openssl.cnf usr/lib/ssl/private ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Fixed by merged PR #1314 (commit bff2fa08): equivalent absolute and relative symlinks no longer trigger false overlay/install collision errors.
stealth/space-bunny-alpha — closed resolved Merged PR #1314 (commit bff2fa08), preventing false collisions for equivalent absolute and relative symlinks in overlay and install directories and resolving #1293.
qwen/qwen3.6-35b-a3b — — Closed without a fix. Escalated to internal ticket CRAFT-4758. The issue remains unresolved, as collision detection incorrectly flags equivalent absolute and relative symlinks between overlays and stage packages.
qwen/qwen3.6-35b-a3b — — The issue was closed without explicit resolution details. Tracking was forwarded to internal Jira ticket CRAFT-4758, indicating it remains under investigation or was abandoned.
qwen/qwen3.6-35b-a3b — — Closed without resolution. The overlay and stage-package symlink collision was flagged and synced to internal Jira ticket CRAFT-4758. No fix or merge was implemented in the repository.
qwen3.6-35b-a3b-mtp-q6 — — Closed and triaged to internal ticket CRAFT-4758. No resolution or fix was provided. The report highlights incorrect collision detection for absolute versus relative symlinks pointing to the same target during overlay and stage-package processing.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: craft-parts#1314 (confidence 100%)

    Merged fix for the symlink collision, committed as bff2fa08.

Related issues

Issue Project State Summary Similarity
#1314 fix: do not collide on "similar" symlinks between overlay and install dir craft-parts merged Merged PR #1314 (commit bff2fa08), fixing false collisions between equivalent absolute and relative symlinks in overlay and install directories; resolves #1293.
88%
#1190 fix(overlay): detect conflicts between overlay and install craft-parts merged Merged PR #1190 fixed Stage collision detection by including overlay layer contents and added integration tests for colliding and non-colliding scenarios in commit b7455277.
73%