Charmcraft 3.x not including symlinked directories in resulting charm
Metadata
Current evaluation
Charmcraft 3.x dropped symlinked directories (e.g. hooks/charmhelpers) from charm ZIPs due to Path.rglob() not following dir symlinks. Fixed by PR #1745, commit ac08e98e, which restored 2.x os.walk(followlinks=True) behaviour; shipped in Charmcraft 3.1.0.
Resolution: closed resolved
Reason: Merged PR #1745 (commit ac08e98e, 'fix(zip): include linked directories in created zips') replaced rglob with os.walk(followlinks=True) when collecting prime-dir files, restoring symlinked directory inclusion, and the fix is listed in the 3.1.0 changelog. Maintainer @lengau confirmed the root cause as the rglob vs os.walk symlink difference.
Evaluated by: mr-cal-bot
Issue body
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Charmcraft 3.x dropped symlinked directories (e.g. hooks/charmhelpers) from charm ZIPs due to Path.rglob() not following dir symlinks. Fixed by PR #1745, commit ac08e98e, which restored 2.x os.walk(followlinks=True) behaviour; shipped in Charmcraft 3.1.0. | |
| stealth/space-bunny-alpha | — | closed resolved | Charmcraft 3.x omitted symlinked directories from classic charm zips. Commit ac08e98e, merged in #1745, fixed linked-directory inclusion. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed by merged PR #1745 (ac08e98e), restoring build_zip directory-symlink traversal so linked directories such as hooks/charmhelpers are included; the PR fixes #1719. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed without a fix. The root cause was identified as a behavioral difference between Path.rglob() and os.walk() regarding directory symlinks. The report was tracked internally as CRAFT-3135. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed and tracked internally as CRAFT-3135. Root cause identified as a Path.rglob() versus os.walk() symlink handling difference. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed after identifying the root cause as a behavioral difference between Path.rglob() and os.walk() regarding directory symlinks. The issue was resolved without a code fix, documenting the symlink traversal limitation. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed after root cause analysis revealed Path.rglob() and os.walk() handle directory symlinks differently. Tracked via Jira CRAFT-3135 for resolution. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
canonical/charmcraft#1745
(confidence 97%)
Merged PR 'fix(zip): include linked directories in created zips' — commit ac08e98e; directly resolves the reported rglob/os.walk symlink regression.
-
Related To:
canonical/charmcraft#1968
(confidence 25%)
Later charmcraft fix for duplicate files in built charms touching the same zip/prime collection code path, not directly this issue.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1745 fix(zip): include linked directories in created zips | charmcraft | merged | Merged #1745 (commit ac08e98e) restored Charmcraft 2.x symlink-following behavior, including linked directories in generated charm and bundle ZIPs; documented in the 3.1.0 changelog. | |
| #260 Can't include symlinked file into built charm | charmcraft | closed | Resolved by Charmcraft’s craft-parts build flow in PR #458 (implementation 437dab55, merge 9dc20872), enabling build-time handling of linked project files. |