Rockcraft parts `permissions` field follows symlinks when changing ownership.
Metadata
Current evaluation
Upstream craft-parts#1059 is recorded as merged and fixes symlink-following during permission application; rockcraft#660 remains open but is resolved by that upstream fix.
Suggested action: close resolved
Reason: The issue's 2025-04-03 comment links canonical/craft-parts#1059, and repository issue details record that PR as merged and specifically fixing symlink permission handling for rockcraft#660. The exact YAML reproducer, failure log, and pinpointed code path make the upstream resolution clear despite this issue remaining open.
Evaluated by: mr-cal-bot
Impact:
48
Quick Win:
32
Complexity:
30
Confidence:
91
Actionability:
94
Issue body
### Bug Description
When the permissions field is defined in parts, the chown operation follows the symlink. This causes issues because files are copied and chown-ed one by one. Sometimes, when a symlink is processed before its target, it results in an error.
https://github.com/canonical/craft-parts/blob/a47e795a598eed7b98e1c4e19061677e1379adbc/craft_parts/permissions.py#L89-L90
### To Reproduce
See `rockcraft.yaml` and output below.
### Environment
LXD, Ubuntu 22.04 LTS
### rockcraft.yaml
```shell
name: test
summary: test.
description: test.
version: 1.0.0
license: MPL-2.0
base: ubuntu@24.04
build-base: ubuntu@24.04
platforms:
amd64:
parts:
test:
plugin: nil
override-build: |
touch $CRAFT_PART_INSTALL/bbb
ln -s bbb $CRAFT_PART_INSTALL/aaa
permissions:
- owner: 1000
group: 1000
```
### Relevant log output
```shell
Priming test
/root/prime/aaa: No such file or directory
Failed to execute rockcraft in instance.
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha |
Impact:
48
Quick Win:
32
Complexity:
30
Confidence:
91
Actionability:
94
|
close resolved | Upstream craft-parts#1059 is recorded as merged and fixes symlink-following during permission application; rockcraft#660 remains open but is resolved by that upstream fix. | |
| qwen/qwen3.6-35b-a3b |
Impact:
70
Quick Win:
39
Complexity:
30
Confidence:
90
Actionability:
80
|
close resolved | Rockcraft parts permissions field follows symlinks during chown, causing FileNotFoundError. Fixed in craft-parts#1059 (merged). | |
| qwen/qwen3.8-27b |
Impact:
50
Quick Win:
30
Staleness:
55
Complexity:
40
Confidence:
70
Support Request:
5
|
keep open | Rockcraft parts permissions chown follows symlinks, causing FileNotFoundError when a symlink is processed before its target during prime. A fix PR was opened in craft-parts (#1059) and merged. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
95
Complexity:
40
Confidence:
90
Support Request:
5
|
keep open | Bug in Rockcraft where the permissions field chown operation follows symlinks, causing build failures. An upstream fix PR was opened in craft-parts but remains unmerged after 15 months of inactivity. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
95
Complexity:
20
Confidence:
85
Support Request:
10
|
close stale | Rockcraft permissions field follows symlinks during chown, causing file-not-found errors. Issue is over a year old with no maintainer response, though an upstream fix PR exists in craft-parts. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
90
Complexity:
35
Confidence:
85
Support Request:
5
|
needs triage | Bug report detailing how Rockcraft's permissions field follows symlinks during chown, causing file-not-found errors. Unlabelled, inactive for over a year, with a related fix PR opened in craft-parts. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
canonical/craft-parts#1059
(confidence 95%)
Upstream PR is recorded as merged and addresses the symlink-following permissions failure.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1059 Fix(): Permissions block throws `FileNotFoundError` when setting permissions for a symlink | craft-parts | closed | Merged canonical/craft-parts#1059 fixed symlink handling for permission blocks, resolving canonical/rockcraft#660. | |
| #131 Craft 1415 rockcraft permissions | rockcraft | merged | Merged PR #131 in commit f23d0c31, adding Craft 1415 permission handling to Rockcraft; user-id support was deferred to separate work. |