Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rockcraft parts permissions field follows symlinks when changing ownership. #660

Open
weiiwang01 opened this issue Aug 1, 2024 · 0 comments

Comments

@weiiwang01
Copy link
Contributor

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

name: test
summary: test.
description: test.
version: 1.0.0
license: MPL-2.0

base: [email protected]
build-base: [email protected]
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

Priming test
/root/prime/aaa: No such file or directory
Failed to execute rockcraft in instance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant