← Back to issue list

Correct local source pulling

View original Github issue

Metadata

Project
snapcraft
Number
#377
Type
pull request
State
merged
Author
sergiusens
Labels
Created
Updated
Closed

Current evaluation

Merged fix for local source pulling that incorrectly followed symlinks, causing rmdir failures and duplicate pull errors. The change inverts the directory check, adds explicit symlink validation, and improves error handling. Approved by @zyga. Resolves LP: #1558446.

Suggested action:

No scores available.

Issue body

isdir evaluates to true as it follows symlinks by default and later fails when doing an rmdir, so we invert the check and we also specifically check for a link or fail in a controlled way if not for healthier user output. This also fixes the case where you could not pull twice with the "is a symlink error". LP: #1558446 Signed-off-by: Sergio Schvezov sergio.schvezov@ubuntu.com

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged fix for local source pulling that incorrectly followed symlinks, causing rmdir failures and duplicate pull errors. The change inverts the directory check, adds explicit symlink validation, and improves error handling. Approved by @zyga. Resolves LP: #1558446.
qwen3.6-35b-a3b-mtp-q6 Merged fix for local source pulling that resolved symlink handling and isdir check errors. The update inverts the directory check, validates links explicitly, and prevents duplicate pull failures. Approved by @zyga and merged to address LP: #1558446.
qwen3.6-35b-a3b-mtp-q6 Merged fix for local source pulling that incorrectly handled symlinks, causing rmdir failures and duplicate pull errors. The change inverts the directory check, adds explicit symlink validation, and improves error handling. Approved by @zyga.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#1558446 Pulling local sources is rather broken snapcraft (launchpad) closed Fixed a local source pull failure caused by os.path.isdir returning true for symlinks, which made os.rmdir fail. The directory check was inverted to correctly handle symlinks and regular files.
79%
#622 Hard-link local sources instead of symlinking them. snapcraft merged Merged. Fixes LP #1590108 by hard-linking local sources instead of symlinking, with a fallback to copying if hard links are unsupported. Review comments were addressed and CI coverage fluctuations resolved prior to merge.
75%
#1081 local source: preserve symlinks to directories. snapcraft merged Merged to preserve symlinks to directories in local sources instead of creating new directories, fixing Launchpad bug #1659653. Approved and merged after PR #1083 to group similar changes.
71%
#3370 repo: address issue with fix_symlink() when pointed at directory snapcraft merged Merged fix addressing fix_symlink() crashes when targeting directories. Updates behavior to warn about dangling symlinks, includes refactoring and documentation, and was approved by reviewers prior to merge.
71%
#2167 many: detect local source changes snapcraft merged Merged. Resolves LP: #1583718 by comparing local source timestamps to pull state. Snapcraft now automatically triggers re-pulling and subsequent steps on local changes, removing manual cleaning. Approved and merged after test fixes.
70%