Migrated files don't follow symlinks if they're hard linked
Metadata
Current evaluation
Broken symlinks from hard-linking migrated files fixed by ubuntu-core/snapcraft PR #478, merged as commit 313023188 which resolves sources with os.path.realpath() before os.link(); LP bug closed.
Resolution: closed resolved
Reason: The reporter closed the Launchpad bug pointing at PR #478 ("Follow symlinks while hard-linking migrated files"), which was merged into snapcraft as commit 313023188 and resolved the source path with os.path.realpath() before hard-linking.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Much of Snapcraft's responsibilities involve chauffeuring files around. It does this as efficiently as possible by using hard links. However, Python's os.link() doesn't actually follow symlinks even if follow_symlinks=True, which means it's possible to get broken symlinks into snaps as a result. Snapcraft should work around this.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Broken symlinks from hard-linking migrated files fixed by ubuntu-core/snapcraft PR #478, merged as commit 313023188 which resolves sources with os.path.realpath() before os.link(); LP bug closed. | |
| stealth/space-bunny-alpha | — | closed resolved | Broken symlinks in snaps from hard-linking migrated files were fixed in PR #478, merged as commit 313023188 (LP #1572664): sources are now resolved with os.path.realpath() before os.link(). | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed by merged PR #478 (commit 313023188), resolving symlink sources before hard-linking migrated files so broken symlinks are not included in snaps. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. Snapcraft's hard link migration creates broken symlinks due to Python's os.link() behavior, but no workaround was implemented. | |
| qwen/qwen3.6-35b-a3b | — | — | Abandoned and closed without resolution. The reported bug where Snapcraft hard links fail to follow symlinks remains unfixed. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. The reported hard link and symlink handling bug in Snapcraft was abandoned due to inactivity. No fix or workaround was implemented. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Abandoned. Snapcraft's hard link migration fails to follow symlinks, risking broken symlinks in generated snaps. The issue was closed without resolution or workaround due to prolonged inactivity. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
canonical/snapcraft#478
(confidence 97%)
Merged PR referenced in the closing comment; commit 313023188 resolves symlinks with os.path.realpath() before os.link()
-
Related To:
canonical/snapcraft#3174
(confidence 40%)
Later commit 221a4380 'file utils: do not try to create hardlinks to symlinks' addresses the same class of hardlink-to-symlink problem
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #478 Follow symlinks while hard-linking migrated files. | snapcraft | merged | Merged PR #478 as commit 313023188, resolving symlinks with os.path.realpath() before hard-linking migrated files and preventing broken links in generated snaps. | |
| #622 Hard-link local sources instead of symlinking them. | snapcraft | merged | Merged in canonical/snapcraft#622 (a07fa0faa), replacing local-source symlinks with hard links and falling back to copies, fixing LP #1590108. |