Copy plugin: Follow symlinks if outside of snap.
Metadata
Current evaluation
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.
Suggested action: —
No scores available.
Issue body
Currently the copy plugin copies all symlinks (using a hard link to them if possible). It should do its best to ensure symlinks will be valid when snapped, however, and follow the ones that aren't. This PR resolves LP: [#1532515](https://bugs.launchpad.net/snapcraft/+bug/1532515) by updating the copy plugin to do a relatively conservative check for invalid symlinks. The symlink will be followed if any of the following conditions are true:
- The symlink is absolute.
- The symlink is pointing outside of the part's install directory.
It's possible to still get broken symlinks into a snap using this plugin with certain special cases, but this should catch the majority of use-cases and avoids the complexity of trying to catch all edge cases which would involve actually rewriting symlinks.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | 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. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged update to the copy plugin that follows absolute symlinks and those pointing outside the part's install directory, ensuring validity in snapped packages. Resolves Launchpad bug #1532515. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged update to the copy plugin that follows absolute symlinks and those pointing outside the part's install directory. This ensures symlinks remain valid when snapped and resolves Launchpad bug #1532515. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1532515 Copy plugin should follow symlinks that point outside of the snap | snapcraft (launchpad) | closed | Closed without resolution. PR #209 was proposed to copy symlinks with metadata but received no comments. Extended inactivity indicates the request was abandoned or superseded. | |
| #1174 copy, dump plugin: ignore symlinks to libc. | snapcraft | merged | 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. |