Desktop extension symlinks aren't updated on snap revert

Bug #2009970 reported by Lauren Brock
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
New
Undecided
Unassigned

Bug Description

The desktop extensions check whether or not to symlink libraries based on the contents of $SNAP_USER_DATA/.last_revision. Because $SNAP_USER_DATA is versioned, after a snap is reverted, the desktop-launch script will check .last_revision, but it will always match the (now) current revision. This leads to broken symlinks that point to a revision more recent than the current revision (since they are not updated after a revert).

This issue also affects the ubuntu/snapcraft-desktop-helpers repository.

Callahan Kovacs (mr-cal)
affects: snapcraft → snapd
Revision history for this message
Lauren Brock (lauren-brock) wrote :

I'm pretty certain that this is an issue that affects Snapcraft, rather than Snapd. The issue is the with the `desktop-launch` script that's generated from `extensions/desktop` in the Snapcraft repository. My naive solution with customers has been to replace `$SNAP_USER_DATA/.last_revision` with `$SNAP_USER_COMMON/.last_revision`, in `init` and `mark-and-exec`:

https://github.com/snapcore/snapcraft/blob/main/extensions/desktop/common/init#L31

https://github.com/snapcore/snapcraft/blob/main/extensions/desktop/common/mark-and-exec#L7

It's the `desktop-launch` script that's managing the symlinks that I'm talking about, and upon reverting a snap that uses `desktop-launch` in its command-chain (that also depends on one of the libraries that the script symlinks), the snap will fail to launch because those symlinks haven't been updated, since the $SNAP_DESKTOP_LAST_REVISION variable is set incorrectly.

Though my solution works, I don't want to prescribe a specific solution, since there may well be a better solution.

affects: snapd → snapcraft
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.