When running in unity8 desktop snap, snap application icons aren't found in app scope

Bug #1639952 reported by Michael Terry
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Fix Committed
High
Pat McGowan
Snapcraft
Confirmed
Undecided
Unassigned
snapd
Fix Released
Undecided
Unassigned
ubuntu-app-launch (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

I'm testing the unity8 desktop snap (with silo 2129's fixes) and any installed snap does show up in the Apps scope. BUT the icons all use the default fallback icon.

I'm guessing somewhere along the way the "${SNAP}" in the snap's desktop files gets incorrectly resolved with the unity8 environment's value of $SNAP (instead of the snap's install path)? Not sure though.

Tags: personal

Related branches

Michael Terry (mterry)
description: updated
Revision history for this message
dobey (dobey) wrote :

I suspect it's probably not an issue with $SNAP being resolved. The "URL" for the icon of installed apps comes from ubuntu-app-launch. There's also the case where things in the store have icons, but they don't necessarily have an icon defined in the .desktop files, or it's pointing to the wrong thing. This issue is not in unity-scope-snappy though, but I am not yet sure where to move the bug.

Revision history for this message
Albert Astals Cid (aacid) wrote :

There's no icon because there's no "art" field coming in from the scope (at least in the telegram-latest snap case), you can check by doing

scopes-client clickscope ""

and looking at the results ( http://paste.ubuntu.com/23447173/ ), for example both system-settings and terminal have art but not telegram.

Will investigate more tomorrow why the art is missing.

Revision history for this message
Albert Astals Cid (aacid) wrote :

So the main problem with the telegram snap is that it has

Icon=${SNAP}/meta/gui/icon.png

and ubuntu-app-launch is not doing any special treatment for ${SNAP}

So either the snap is wrong or ubuntu-app-launch needs to add special casing for ${SNAP}

Revision history for this message
Albert Astals Cid (aacid) wrote :

There's two desktop files
/var/lib/snapd/desktop/applications/telegram-latest_telegram.desktop
and
/snap/telegram-latest/current/meta/gui/telegram.desktop

the first has the valid path ( i.e. Icon=/snap/telegram-latest/2/meta/gui/icon.png )
the second the "invalid" paath ( i.e. Icon=${SNAP}/meta/gui/icon.png )

i am thinking that ubuntu-app-launch should be reading /var/lib/snapd/desktop/applications/telegram-latest_telegram.desktop instead of /snap/telegram-latest/current/meta/gui/telegram.desktop

Changed in unity-scope-snappy (Ubuntu):
status: New → Invalid
Revision history for this message
Ted Gould (ted) wrote :

So there are a few interesting things going on here. Some things to keep in mind. The FD.o spec doesn't allow for expansion of variables in the Icon entry. We can't let snaps reference items outside of their own snap directory or it is a security issue (someone can mimic another app, which they could do, but it's worse if they do it locally)

To that end UAL resolves absolute paths in the Icon field as being relative to the snap directory. In essence that means "/foo/bar.png" resolves to (effectively, not literally) "${SNAP}/foo/bar.png". It also means that we resolve "foo/bar.png" to (effectively) "${SNAP}/foo/bar.png". Which is a form that makes more sense.

The problem is that snapd was broken on Unity7 so everyone encoded their Icon paths like they were running on a Ubuntu based Deb system, they put in paths that would only work there (for instance, snapd on other Linux distros uses different paths) because Unity7 didn't do this substitution. Now snapd is making illegal desktop files to compensate and work around that.

The plan to solve this problem is that snapcraft will be setting the icons and the paths for applications so that they are properly relative to the snap directory. This will allow application developers to have predictable results on a variety of distros and icons to work properly on Unity8. Unfortunately we have a set of apps that are broken today.

Revision history for this message
Michael Terry (mterry) wrote :

Retargetting to snapcraft, based on Ted's comment. Sounds like we need them to fix up the desktop file?

Is there a way for an app author to get their icon to appear today? (by using a relative path themselves maybe?)

no longer affects: unity-scope-snappy (Ubuntu)
affects: ubuntu-app-launch (Ubuntu) → snapcraft (Ubuntu)
summary: - When running in unity8 desktop snap, icons aren't found
+ When running in unity8 desktop snap, snap application icons aren't found
+ in app scope
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in snapcraft (Ubuntu):
status: New → Confirmed
Revision history for this message
Michael Terry (mterry) wrote :

Adding a task for ubuntu-app-launch, since we have worked around poorly formatted desktop files there in the linked MP.

Still an open question for snapcraft to encourage upstreams to be correct there, so I'll leave that task open.

affects: snapcraft (Ubuntu) → snapcraft
Changed in canonical-devices-system-image:
milestone: none → p1
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

snapd is the player that expands $SNAP, this is the recommendation from the snapd team, so adding that project as well.

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

re @Albert

/var/lib/snapd/desktop/applications/telegram-latest_telegram.desktop
/snap/telegram-latest/current/meta/gui/telegram.desktop )

The former is snapd expanding the desktop file from /snap/telegram-latest/current/meta/gui/telegram.desktop

Also, I don't think the latter was ever meant to be consumable but the snapd team can confirm.

Changed in canonical-devices-system-image:
assignee: nobody → Pat McGowan (pat-mcgowan)
importance: Undecided → High
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu-app-launch (Ubuntu):
status: New → Confirmed
tags: added: personal
Changed in canonical-devices-system-image:
milestone: p1 → p2
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-app-launch - 0.9+17.04.20170113.1-0ubuntu1

---------------
ubuntu-app-launch (0.9+17.04.20170113.1-0ubuntu1) zesty; urgency=medium

  [ Pete Woods ]
  * Compatibility with unversioned cmake-extras modules (LP: #1563573)

  [ Rodney Dawes ]
  * Handle more common Icon entries in .desktop files for snaps. (LP:
    #1639952)

  [ Ted Gould ]
  * Fixes to the exec-util test to ensure it is more reliable
  * Reenable OnlyShowIn checking for Desktop files (LP: #1580092,
    #1606593, #1608546)

 -- Ted Gould <email address hidden> Fri, 13 Jan 2017 22:16:18 +0000

Changed in ubuntu-app-launch (Ubuntu):
status: Confirmed → Fix Released
Michael Terry (mterry)
Changed in canonical-devices-system-image:
status: In Progress → Fix Committed
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

The icon handling has been fixed long ago, marking as fix released although I don't think anyone is developing unity 8 with relation to snaps anymore.

affects: snappy → snapd
Changed in snapd:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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