← Back to issue list

Follow symlinks while hard-linking migrated files.

View original Github issue

Metadata

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

Current evaluation

Merged fix for broken symlinks during Snapcraft file migration. Replaced os.link() with os.path.realpath() to properly follow symlinks, resolving Launchpad bug 1572664. Two files changed, +51/-3 lines.

Suggested action:

No scores available.

Issue body

Currently Snapcraft does its best to migrate files efficiently by utilizing hard links. However, `os.link()` doesn't seem to respect its `follow_symlinks` parameter, which results in broken symlinks in the final snap. This PR fixes LP: [#1572664](https://bugs.launchpad.net/snapcraft/+bug/1572664), working around that issue by utilizing `os.path.realpath()`.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged fix for broken symlinks during Snapcraft file migration. Replaced os.link() with os.path.realpath() to properly follow symlinks, resolving Launchpad bug 1572664. Two files changed, +51/-3 lines.
qwen3.6-35b-a3b-mtp-q6 Merged a fix for broken symlinks during file migration in Snapcraft. The change uses os.path.realpath() to properly follow symlinks before hard-linking, resolving Launchpad bug #1572664.
qwen3.6-35b-a3b-mtp-q6 Merged a fix for broken symlinks during file migration. The change uses os.path.realpath() to properly follow symlinks before hard-linking, resolving Launchpad bug 1572664.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#1572664 Migrated files don't follow symlinks if they're hard linked snapcraft (launchpad) closed Closed without resolution. Snapcraft's hard link migration creates broken symlinks due to Python's os.link() behavior, but no workaround was implemented.
81%
#3174 link_or_copy: do not try to create hardlinks to symlinks. snapcraft merged Merged a fix to prevent creating hardlinks to symlinks in link_or_copy. This resolves an Errno 17 failure during snapcraft builds on Docker with mounted Mac volumes by falling back to copying symlinks instead.
71%