← Back to issue list

Rockcraft parts `permissions` field follows symlinks when changing ownership.

View original Github issue

Metadata

Project
rockcraft
Number
#660
Type
issue
State
open
Author
weiiwang01
Labels
Created
2024-08-01 17:52:03+00:00
Updated
2025-04-03 08:52:11+00:00
Closed

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.