Rockcraft parts `permissions` field follows symlinks when changing ownership.
Metadata
Current evaluation
No evaluation has been recorded for this issue yet.
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
No evaluation history available.