← Back to issue list

Don't follow symlinks for remote-builds

View original Github issue

Metadata

Project
craft-application
Number
#721
Type
issue
State
open
Author
mr-cal
Labels
Status: Triaged Type: Enhancement
Created
Updated
Closed

Current evaluation

Remote builds copy the project dir via copytree without symlinks=True, so symlinks are followed and failures surface as internal errors. Fix still unimplemented in worktree.py; triaged enhancement, still referenced by open snapcraft#5384.

Suggested action: keep open

Reason: The issue is triaged (Status: Triaged, Type: Enhancement, filed by maintainer mr-cal) and the linked source issue canonical/snapcraft#5384 is still open with its summary stating the fix 'belongs upstream in craft-application#721, which remains open'. I verified the pinned HEAD of craft_application/remote/worktree.py still calls copytree(self._project_dir, self._repo_dir) with no symlinks argument and no try/except, so the problem is unfixed and the issue remains relevant rather than stale.

Impact: 45 Quick Win: 33.75 Staleness: 70 Complexity: 25 Confidence: 85 Support Request: 0

Issue body

### What needs to get done Craft-application should set `symlinks=True` when setting up the [remote-build work dir](https://github.com/canonical/craft-application/blob/ea697712fc92177a3669270e168f638272cc22f6/craft_application/remote/worktree.py#L54). Additionally, there should be a try/except when copying files. Currently, it bubbles up as an internal error. ### Why it needs to get done Craft-application shouldn't follow symlinks when copying the project directory to a temporary working directory. The working directory should be as identical as possible to the project directory. Additionally, following symlinks may fail. Source: https://github.com/canonical/snapcraft/issues/5384

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 45
Quick Win: 33.75
Staleness: 70
Complexity: 25
Confidence: 85
Support Request: 0
keep open Remote builds copy the project dir via copytree without symlinks=True, so symlinks are followed and failures surface as internal errors. Fix still unimplemented in worktree.py; triaged enhancement, still referenced by open snapcraft#5384.
qwen/qwen3.6-35b-a3b
Staleness: 45
Complexity: 30
Confidence: 85
Support Request: 10
keep open Enhancement request to prevent following symlinks during remote-build file copying and add error handling. Triaged, linked to external issue, awaiting implementation.
qwen3.6-35b-a3b-mtp-q6
Staleness: 90
Complexity: 20
Confidence: 85
Support Request: 5
keep open Enhancement to prevent following symlinks during remote-build setup by enabling symlinks=True and adding error handling for file copies. Currently triaged but inactive for over a year.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 20
Confidence: 75
Support Request: 0
keep open Preserve symlinks in remote-build temporary directories and handle file copy errors gracefully. Triaged and linked to internal Jira ticket CRAFT-4464, awaiting implementation.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/snapcraft#5384 (confidence 90%)

    Cited as the source of this issue; that issue is still open and explicitly awaits the upstream fix made here.

Related issues

Issue Project State Summary Similarity
#5384 remote build: snapcraft incorrectly follows symlinks snapcraft open snapcraft remote-build fails on repos with broken symlinks because it follows them during upload. Triaged by maintainer who confirmed the fix belongs upstream in craft-application#721, which remains open. Awaiting upstream implementation.
76%
#1103 Remote build fails on dangling symlinks craft-application closed Closed without resolution. Remote-build crashes during project directory copying when dangling symlinks are present, causing a shutil.Error. No fix or follow-up was provided.
76%