I’ve spent a lot of time trying to migrate my snapcraft.yaml from base18
to base22
, and I’m still failing to build a snap.
After updating the base:
the snapcraft
tool started giving me the following error:
Cannot pack snap: 2024/08/19 13:47:50.774916 container.go:360: in snap "indicator-sound-switcher": "bin/launch.sh" should be world-readable and executable, and isn't: -rwxrwx---
2024/08/19 13:47:50.774968 container.go:379: in snap "indicator-sound-switcher": "bin/launch.sh" should be world-readable, and isn't: -rwxrwx---
2024/08/19 13:47:50.775025 container.go:379: in snap "indicator-sound-switcher": "meta/gui/icon.svg" should be world-readable, and isn't: -rwxrwx---
error: snap is unusable due to bad permissions
For two files:
bin/launch.sh
meta/gui/icon.svg
The first one is getting copied by the Dump plugin, so I managed to fix that by adding:
override-prime: |
craftctl default
# Fix resource permissions
chmod +rx $CRAFT_PRIME/bin/launch.sh
chmod +r $CRAFT_PRIME/meta/gui/icon.svg
Now the second command is failing with
chmod: cannot access '/root/prime/meta/gui/icon.svg': No such file or directory
See the full build log here.
I spent a lot of time googling and reading snapcraft docs, but I still fail to figure out where and how I can fix this. There’s no mention of the meta
dir in the docs.
Apart from that, I don’t understand why the permissions on copied files deviate from those in the source.
Please help.