Build fotoxx snap - need help

I am trying to make a snap package for Fotoxx, a GTK-3 image edit application. It builds successfully but fails to start, apparently something missing in the snap bundle but I cannot figure out what this is. Hope someone can straighten me out.

The output is below. My .yaml file follows afterwards.

fotoxx-17.10
initz. clutter and GTK …
(process:31405): Gtk-WARNING **: Locale not supported by C library.
Using the fallback ‘C’ locale.
Gtk-Message: Failed to load module “unity-gtk-module”

(fotoxx:31405): GdkPixbuf-WARNING **: Cannot open pixbuf loader module file ‘/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache’: No such file or directory

This likely means that your installation is broken.
Try running the command
gdk-pixbuf-query-loaders > /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache
to make things work again for the time being.
Gtk-Message: Failed to load module “canberra-gtk-module”
Gtk-Message: Failed to load module “canberra-gtk-module”

(fotoxx:31405): Clutter-WARNING **: Locale not supported by C library.
Using the fallback ‘C’ locale.

(fotoxx:31405): Clutter-CRITICAL **: Unable to initialize Clutter: Unable to initialize the Clutter backend

=================================================================

name: fotoxx
version: ‘17.10’
summary: photo/image editor and collection manager
description: |
Survey an image collection with a thumbnail browser and navigator.
View and edit image files (RAW, jpeg, png, tiff …).
Fotoxx has a large set of edit functions and arty effects.
Metadata edit and report: tags, captions, geocodes … any metadata.
Search images using any metadata and folder/file names or parts.
Albums: select images and arranged with drag and drop.
Slide Show with animated transitions and pan/zoom.
Zoomable world map with image markers - click to view gallery.
Batch functions: file convert, resize, upright, move, others.

grade: devel
confinement: devmode

confinement: classic # normal access to user-owned files

parts:
fotoxx:
source: /home2/mico/programs/fotoxx/packs/fotoxx-17.10.tar.gz
plugin: make

apps:
fotoxx:
command: fotoxx

Can you provide access, or paste, the complete snapcraft.yaml please? I ask because I don’t see any build-packages: or staged-packages: keywords in what you’ve posted.

Thanks.
I posted the entire yaml, but the forum decided to reformat it so that
it might not have been easy to recognize. I copied it again below. There
were no build-packages or stage-packages, because the ones I tried did
not help the problem. All I did was insert the debian package names that
seemed related to the error messages I was getting, but that did not
change anything. I could find no guidance in the docs at snapcraft.io.
If there is some, can you point me in the right direction?
regards
Mike

here is the yaml again and the error messages when fotoxx is started.
This was done using Ubuntu 16.04.

name: fotoxx
version: '17.10'
summary: photo/image editor and collection manager
description: |
  Survey an image collection with a thumbnail browser and navigator.
  View and edit image files (RAW, jpeg, png, tiff ...). 
  Fotoxx has a large set of edit functions and arty effects.
  Composite functions: HDR, HDF, Stack, Panorama, image/text montage.
  Internal calculations are 24-bits/color, output is 8 or 16 bits/color.
  Metadata edit and report: tags, captions, geocodes ... any metadata.
  Search images using any metadata and folder/file names or parts.
  Albums: select images and arrange sequence with drag and drop.
  Slide Show with animated transitions and pan/zoom.
  Zoomable world map with image markers - click marker to view gallery.
  Batch functions: convert, resize, upright, move, revise metadata.

grade: devel
confinement: devmode    # "classic" for normal access to user-owned files

parts:
   fotoxx:
      source: /home2/mico/programs/fotoxx/packs/fotoxx-17.10.tar.gz
      plugin: make

apps:
   fotoxx:
      command: fotoxx

===========================================================

fotoxx-17.10
initz. clutter and GTK …
(process:4577): Gtk-WARNING **: Locale not supported by C library.
Using the fallback ‘C’ locale.
Gtk-Message: Failed to load module “unity-gtk-module”

(fotoxx:4577): GdkPixbuf-WARNING **: Cannot open pixbuf loader module file ‘/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache’: No such file or directory

This likely means that your installation is broken.
Try running the command
gdk-pixbuf-query-loaders > /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache
to make things work again for the time being.
Gtk-Message: Failed to load module “canberra-gtk-module”
Gtk-Message: Failed to load module “canberra-gtk-module”

(fotoxx:4577): Clutter-WARNING **: Locale not supported by C library.
Using the fallback ‘C’ locale.

(fotoxx:4577): Clutter-CRITICAL **: Unable to initialize Clutter: Unable to initialize the Clutter backend

You don’t have any staged-packages: in your part. See the snap of Simplenote for an example of how staged-packages: are used to make sure the runtime requirements for your application are satisfied.

You’ll also need to use a desktop helper, see the after: keyword in the Simplenote snap. Change the helper to on of desktop-gtk2, desktop-gtk3, desktop-qt4 or desktop-qt5 as is appropriate for fotoxx.

2 Likes

I did this but I am still getting the same error. I added all the dependencies in my debian package as stage-packages. I tried to get past the missing file error by adding filesets: but that had no effect.

latest yaml:

name: fotoxx
version: ‘17.10’
summary: photo/image editor and collection manager
description: |
Survey an image collection with a thumbnail browser and navigator.
blah blah

architectures: [amd64]
grade: devel
confinement: devmode # “classic” for normal access to user-owned files

apps:
fotoxx:
command: fotoxx

parts:
fotoxx:
source: /home2/mico/programs/fotoxx/packs/fotoxx-17.10.tar.gz
plugin: make
after:
- desktop-gtk3
stage-packages:
- libc6
- libgtk-3-0
- libchamplain-gtk-0.12-0
- libclutter-gtk-1.0-0
filesets:
pixbuf-loaders-cache: [ /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/* ] ### has no effect

errors at fotoxx.snap startup:

fotoxx-17.10
initz. clutter and GTK …
(process:32764): Gtk-WARNING **: Locale not supported by C library.
Using the fallback ‘C’ locale.
Gtk-Message: Failed to load module “unity-gtk-module”

(fotoxx:32764): GdkPixbuf-WARNING **: Cannot open pixbuf loader module file ‘/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache’: No such file or directory

This likely means that your installation is broken.
Try running the command
gdk-pixbuf-query-loaders > /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache
to make things work again for the time being.
Gtk-Message: Failed to load module “canberra-gtk-module”
Gtk-Message: Failed to load module “canberra-gtk-module”

(fotoxx:32764): Clutter-WARNING **: Locale not supported by C library.
Using the fallback ‘C’ locale.
libGL error: unable to load driver: i965_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i965
libGL error: unable to load driver: i965_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i965
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
libGL error: unable to load driver: i965_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i965
libGL error: unable to load driver: i965_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i965
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast

(fotoxx:32764): Gdk-ERROR **: The program ‘fotoxx’ received an X Window System error.
This probably reflects a bug in the program.
The error was ‘GLXBadContext’.
(Details: serial 215 error_code 169 request_code 155 (GLX) minor_code 6)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the GDK_SYNCHRONIZE environment
variable to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)
Trace/breakpoint trap (core dumped)

Does the silence mean there is no fix for this, or that no one is interested, or that I should figure it out by myself, or what?

Let me see if someone in the desktop team has any clues here. Most of the people who might know are travelling at the moment, but someone will get back to you soon.

That’s your issue, you are still not using the desktop launcher, you
need to change the line to be

“command: desktop-launch fotoxx”

I tried with that change and it starts, though it displays an error
about libimage-exiftool-perl missing then and exit, but that’s another issue

@seb128 is right, updating the command to use desktop-launch fixes that startup issue. To build it I had to add some build-packages, you can see my snapcraft.yaml that built at http://paste.ubuntu.com/25179096/

The binary works after including exiftool from libimage-exiftool-perl
(with tweaked PERL5LIB and PATH variables

It works with that command definition

" fotoxx:
command: desktop-launch fotoxx
environment:
PERL5LIB: $PERL5LIB:/snap/fotoxx/current/usr/share/perl5/
PATH: $PATH:/snap/fotoxx/current/usr/bin"

and adding libimage-exiftool-perl to the stage-packages

Thanks for your help.
I implemented your fixes in the YAML below.
I could find no docs about “environment” so maybe my YAML is wrong.

The build fails with following diagnostics:
/home/mico/snapcraft/fotoxx/stage/usr/lib/x86_64-linux-gnu/mesa-egl/libEGL.so.1: undefined reference to wl_proxy_create_wrapper' /home/mico/snapcraft/fotoxx/stage/usr/lib/x86_64-linux-gnu/mesa-egl/libEGL.so.1: undefined reference to wl_proxy_get_version’
/home/mico/snapcraft/fotoxx/stage/usr/lib/x86_64-linux-gnu/mesa-egl/libEGL.so.1: undefined reference to wl_proxy_wrapper_destroy' /home/mico/snapcraft/fotoxx/stage/usr/lib/x86_64-linux-gnu/mesa-egl/libEGL.so.1: undefined reference to wl_proxy_marshal_constructor_versioned’
collect2: error: ld returned 1 exit status

I added ‘libwayland-client0’ to stage-packages but that did nothing.

I wanted to attach my source and makefile tarball but I cannot see how to do this.
You can fetch this at http://kornelix.net/downloads/tarballs/fotoxx-17.08.tar.gz

YAML follows ---------------------------------------

fotoxx
version: '17.08'
summary: photo/image editor and collection manager
description: |
  Survey an image collection with a thumbnail browser and navigator.
  View and edit image files (RAW, jpeg, png, tiff ...). 
  Fotoxx has a large set of edit functions and arty effects.
  Composite functions: HDR, HDF, Stack, Panorama, image/text montage.
  Internal calculations are 24-bits/color, output is 8 or 16 bits/color.
  Metadata edit and report: tags, captions, geocodes ... any metadata.
  Search images using any metadata and folder/file names or parts.
  Albums: select images and arrange their sequence with drag and drop.
  Slide Show with animated transitions and pan/zoom.
  Scalable world map with image markers, click marker to view gallery.
  Batch functions: convert, resize, upright, move, revise metadata.

architectures: [amd64]
grade: devel
confinement: classic       ### devmode

apps:
   fotoxx:
      command: desktop-launch fotoxx

environment:
   PERL5LIB: $PERL5LIB:/snap/fotoxx/current/usr/share/perl5/
   PATH: $PATH:/snap/fotoxx/current/usr/bin"

parts:
   fotoxx:
      source: /home2/mico/programs/fotoxx/packs/fotoxx-17.08.tar.gz
      plugin: make
      after:
         - desktop-gtk3
      build-packages:
         - libchamplain-0.12-dev
         - libtiff5-dev
         - liblcms2-dev
         - libraw-dev
      stage-packages:
         - libc6
         - libgtk-3-0
         - libchamplain-gtk-0.12-0
         - libclutter-gtk-1.0-0
         - libimage-exiftool-perl
         - libwayland-client0                 ### makes no difference

The build is now working. I deleted all the subdirectories under $HOME/snapcraft/fotoxx and started from nothing. That worked. Smells like a bug. The application runs confined even though I specified devmode confinement and --devmode install. Now back to the docs to figure that out.

Fotoxx-snap needs to access user-owned files outside the playpen with classic r/w permissions.

confinement classic + install --classic --> “cannot find signatures”
confinement classic + install --devmode --> “requires classic”
confinemane classic + install --classic --devmode --> “cannot use classic and devmode flags together”
confinement devmode + install --devmode installs OK but command fotoxx-snap --> “no such file”

Errrr did you mean to use --dangerous there too?

You’ll want to use snap run fotoxx.

Maybe. I never saw any documentation mentioning --dangerous. Is there
any?

‘When you install a snap from the store, it includes an “assertion” that the snap was published by a trusted third party. However, in this case you’re installing a snap straight from your hard drive; that assertion hasn’t been generated. We use the --dangerous option to tell snapd to trust it anyway.’

Here