Failed to launch apps with classic confinement

I build a classic confined snap for my new application wonderwall after snap builds i install it with following command , it turns out that classic confined snap are not able to find location of desktop-launch command wrapper inside snap’s directory structure. please help me to solve the issue. thanks.

sudo snap install --classic wonderwall_1_amd64.snap --dangerous 
wonderwall 1 installed
bulld@bulld-Inspiron-3521:~/code/A-snap/wonderwall$ wonderwall 
**/snap/wonderwall/x1/command-wonderwall.wrapper: 2: exec: desktop-launch: not found**

Can you show us the yaml?

name: wonderwall # you probably want to 'snapcraft register <name>'
version: '1' # just for humans, typically '1.2+git' or '1.3.2'
summary: Powerful Desktop Wallpaper manager for Gnome Desktop # 79 char long summary
description: |
  Wonderwall is a desktop wallpaper manager. That allows you to browse download and apply
  Wallpaper's from our huge collection of wallpapers. The user interface is so neat and 
  powerful that makes manage your collection of images very simple and straight forward.
  Feature included are: 
* Search wallpaper using Colors, Tags, Categories, Resolution, Popularity, Views, 
  Rating etc with the powerful filter tools.
* Crop/Scale Downloaded wallpaper to make it fit into your Screen Resolution.
* Browse through the world's largest collection of online 4k and Ultra HD Wallpapers
* Categories Downloaded wallpapers.
* Buy from the hand picked collection of Images with clicks.
* Search images using color search tool.

grade: stable # must be 'stable' to release into candidate/stable channels
confinement: classic # use 'strict' once you have the right plugs and slots

apps:
  wonderwall:
command: desktop-launch wonderwall

parts:
  qt:
plugin: qmake
qt-version: qt5
source-type: local
source: ../../wonderwall/
build-packages:
        - build-essential
        - qtbase5-dev
        - libqt5webkit5-dev
        - libudev-dev
stage:
      - -usr/share/pkgconfig
stage-packages:
        - libqt5webkit5
        - libqt5x11extras5

after: [desktop-qt5]

  udev:
 plugin: nil
 stage-packages:
        - udev
  gsettings:
 plugin: nil
 stage-packages:
        - libglib2.0-bin

Try:-

command: desktop-launch $SNAP/bin/wonderwall

(or whatever the path to the wonderwall binary is inside the snap)

1 Like

i need classic confinement because i to get harddisk serial using libudev(my app uses to get unique id -ex, hard-disk serial etc). i also think there should be an interface to use libudev for this purpose. so that developers can use strict confinement. i talked abut this with @zyga-snapd before on twitter :stuck_out_tongue:

okay @popey am building now i will try and get back soon.
Also desktop-helpers are taking too much time in build step, any idea why this is happening since 2 or 3 last releases of snapcraft ?

am still getting same error :

/snap/wonderwall/x1/command-wonderwall.wrapper: 2: exec: desktop-launch: not found

Hard to debug if I can’t see the snap. I expect you need to just make sure the binary really is in $SNAP/bin, or wherever it is located.

as i can see the error is saying can not find desktop-launch script .

Also , do i need to carry qt libs along with my snap package since its classic and can use libs installed on system ??? Just concerned about the size of my app :smiley:

wonderwall binary is in $SNAP/usr/bin/ i changed the path trying with new path.

still no luck same error

/snap/wonderwall/x1/command-wonderwall.wrapper: 2: exec: desktop-launch: not found

Looks like we’ve hit the same problem. We’ve built a snap for ZAP using devmode and that works fine: https://github.com/zaproxy/zaproxy/tree/develop/snap I’ve opened a PR to use classic mode: https://github.com/zaproxy/zaproxy/pull/4965 - this builds ok but when I try to run ‘zaproxy’ I get the error message: ‘desktop-launch: not found’ This is blocking us from releasing our ZAP snap :frowning: Any help appreciated.

In contrast to devmode/strict confinment snaps, the shipped command wrapper/adapter of a classic confined snap doesn’t set in-snap command search PATHs

For classic confined snaps’ apps._app_name_.command key the relative path of the executable from $SNAP has to be used, so use bin/desktop-launch $SNAP/path/to/another/executable instead of desktop-launch executable, refer Subtle differences between devmode and classic confinement snaps and the apps.app_name.command key in the Snapcraft.yaml reference

1 Like

Also, I wrote a launcher to somewhat simplify the command:

https://github.com/Lin-Buo-Ren/snapcrafters-template-plus/blob/master/snap/local/launchers/classic-launch

Example recipe that uses it:


apps:
  wimlib-imagex:
    command: bin/classic-launch wimlib-launch wimlib-imagex
  wimappend:
    command: bin/classic-launch wimlib-launch wimappend
  wimapply:
    command: bin/classic-launch wimlib-launch wimapply

That did the trick - many thanks!