I’ve been trying to update the Google Play Music Desktop Player snap. I’ve managed to get everything building again (yay!), but somehow the MPRIS support fails with AppArmor denials unless I manually specify the name in the slot, like so
This used to work without the manual specification of the slot, and manually specifying the slot means that it needs to go through review. Is there something that has changed in the handling of the mpris interface? Is there something I can do to not need to manually specify the name?
@zyga-snapd and/or @jdstrand could provide some insight on any changes that might have happened since you last published (or installed) the last version of your snap.
I just had a look at the code and the name of the slot will implicitly be the same as snap name. It just happens to be that the snap name has dashes and the attribute name has underscores.
Looking at file history I don’t see any changes related to the name.
Hm. I wonder why they made that change? As far as I can tell, ‘-’ is a valid character in mpris names.
Although, having a poke through to the relevant bit of the DBus spec it says:
Note that the hyphen (’-’) character is allowed in bus names but not in interface names. It is also problematic or not allowed in various specifications and APIs that refer to D-Bus, such as Flatpak application IDs, the DBusActivatable interface in the Desktop Entry Specification, and the convention that an application’s “main” interface and object path resemble its bus name. To avoid situations that require special-case handling, it is recommended that new D-Bus names consistently replace hyphens with underscores.
Perhaps the mpris interface should allow both $SNAP_NAME and $SNAP_NAME with hyphens replaced with underscores?
It is easy enough to issue a snap declaration and I’ll do that now. Thanks to everyone for the investigation. As for changing to allowing ‘’, I’d prefer not at this time because parallel installs use '’ as a delimiter which complicates the reasoning between the foo-player snap that is allowed to use foo_player and the foo snap with parallel install of player that is not (if/when we ever have a clear design for dbus and parallel installs, we could revisit this, but without that design, it feels premature to assume ‘_’ is ok).