← Back to issue list

copy, dump plugin: ignore symlinks to libc.

View original Github issue

Metadata

Project
snapcraft
Number
#1174
Type
pull request
State
merged
Author
kyrofa
Labels
Created
Updated
Closed

Current evaluation

Merged. Updated copy and dump plugins to ignore symlinks to libc instead of removing them, resolving dangling symlink and build bugs from a prior fix. Approved by reviewers and passed CI.

Suggested action:

No scores available.

Issue body

libc is not typically staged, as it's always contained in the core snap. However, Snapcraft leaves symlinks to its libraries from stage-packages alone and intact. This causes issues when it comes to content sharing and building against tarred staging areas, as various plugins work really hard to ensure the snap doesn't include dangling symlinks, and they end up following the libc symlinks in the tarred staging area and pulling in libc. The naive solution to this is to simply remove such symlinks from the stage-packages, and this was indeed the solution introduced in commit 3052b0f459ded440dad2e2362946ee37e09c8606. However, didn't work quite as well as desired and led to odd bugs such as ld linking to static libraries in the part instead of shared libraries on the host, etc. This PR is a second take on fixing LP: [#1658774](https://bugs.launchpad.net/snapcraft/+bug/1658774): instead of removing symlinks to libc, modify the copy and dump plugins to ignore (i.e. not follow) symlinks to libc.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged. Updated copy and dump plugins to ignore symlinks to libc instead of removing them, resolving dangling symlink and build bugs from a prior fix. Approved by reviewers and passed CI.
qwen3.6-35b-a3b-mtp-q6 Merged. Modifies copy and dump plugins to ignore symlinks to libc instead of removing them, resolving LP #1658774. External testing confirmed stability prior to merge.
qwen3.6-35b-a3b-mtp-q6 Merged a fix modifying the copy and dump plugins to ignore symlinks to libc instead of removing them. This resolves content sharing and dangling symlink issues while avoiding previous linking bugs, validated via external tests.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#1658774 Symlinks to libc are followed by the dump and copy plugins snapcraft (launchpad) closed Abandoned without resolution. Proposed updating dump and copy plugins to allow dangling libc symlinks to pass through instead of following or rewriting them.
83%
#3497 repo: fix regression in fix_symlink() snapcraft merged Merged a fix for a regression in fix_symlink() where copied files retained stale symlinks. The update ensures symlinks correctly point to new files and adds spread tests for relative and host copy scenarios. Approved by two reviewers and passed CI.
73%
#1418 nodejs plugin: copy the content of out of tree symlinks snapcraft merged Merged fix for the nodejs plugin to copy out-of-tree symlink contents, resolving LP #1702661 and a heroku build link farm issue. Approved by one reviewer, passed CI, and modified two files with 69 additions and 7 deletions.
71%
#426 Copy plugin: Follow symlinks if outside of snap. snapcraft merged Merged. Updates the copy plugin to follow absolute symlinks and those pointing outside the part's install directory, preserving validity when snapped. Resolves LP #1532515. Modified 2 files with 142 additions and 14 deletions.
71%