Re-installing from hard disk a snap makes some bindings fail
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
New
|
Undecided
|
Unassigned |
Bug Description
When a snap is re-installed from hard disk, some bindings from the LAYOUT statements aren't binded. Specifically those that point to a file/folder that is inside a binded folder.
I attach a simple example that allows to reproduce this bug. This snap uses the "gnome" extension (gnome-42-2204) and core22, so it requires the latest version of snapcraft. Just create the snap as usual with "snapcraft". Then install it in your system with:
- sudo snap install --dangerous test-core-
The layout is this one:
layout:
/usr/lib/test1:
bind: $SNAP/gnome-
/usr/lib/test2:
bind: $SNAP/usr/
where $SNAP/gnome-
Now run it with
- snap run test-core-snap
It will print the contents of the following folders: "$SNAP/
Now, reinstall the snap without uninstalling it and launch it; this is, run again:
- sudo snap install --dangerous test-core-
- snap run test-core-snap
Now the first, third and fourth folders will show the expected content, but the second and the fifth (the ones binded to a folder that is inside an already binded folder) are empty.
Uninstalling the snap and installing it again "fixes" this, until, of course, you reinstall the snap again without uninstalling it previously; this is: executing this:
- sudo snap remove test-core-snap
- sudo snap install --dangerous test-core-
- snap run test-core-snap
will make it work fine again.
More data: the previous behavior seems to be with the official Gnome-42-2204 snaps. But with a locally-generated Gnome-42-2204 snap, it seems that the bind to a folder inside a bind never works, although symlinks do work fine.