Window providers in strict mode

Hello,

I have a pre-built app that works correctly on Ubuntu 18.04. When packaging it with snapcraft in “classic” mode I can install it and execute it. However, when doing it in “strict” or “devel” I can install it but I cannot execute it correctly. It reaches a segmentation point error.

The information that I get through the console at that specific point is:

In strict mode:

[INFO ] [Factory ] 184 symbols loaded
/snap/focusedon/x1/scripts/bin/FocusedON: Relink /tmp/_MEIRMTS2O/./liblzma-6cd627ed.so.5.2.4' with /lib/x86_64-linux-gnu/librt.so.1’ for IFUNC symbol `clock_gettime’
Segmentation fault (core dumped)

In classic mode:

[INFO ] [Factory ] 184 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
(goes on and work)

Is it related with the Window provider? if so, is anyway to solve it so It can be package in “strict” mode?

Thanks!

Check if this is similar to this, since i don’t know how you are deploying your applications i cannot help you more on this.

Also provide snapcraft yaml file to let us know what exactly you are doing.

Thank you very much for the help.

The error message was the same one but not the error itself. It was my mistake. Basically my app uses graphics and I need to include plugs, extensions and stage-packages so it can ran in strict mode. Its running fine now. Just in case anyone else has a similar problem I add my .yaml next (which is really simple). I am also adding the snapcraft doc pages where I found the information since it was very useful for me.

Right now I have just found a tricky thing that would like to solve. What I am doing is packaging an executable file with snapcraft. If I execute the executable file, it opens a browser that by default points to the user home directory. However, if I execute the one installed using snap, it points to “/home/$USER/snap/$APP_NAME/x1”. Is there anyway to prevent this behavior without modifying the executable file itself?

Thank you in advance

snapcraft links:


My .yaml:

name: myApp
base: core18
version: ‘2.1’
summary: Single-line elevator pitch for your amazing snap
description: |
This is my-snap’s description. You have a paragraph or two to tell the
most important story about your snap. Keep it under 100 words though,
we live in tweetspace and your description wants to look good in the snap
store.

grade: devel
confinement: devmode #classic #strict

apps:
myApp:
command: bin/myExecutable
plugs:
- opengl
- desktop
- home
extensions:
- gnome-3-28

parts:
myApp:
# See ‘snapcraft plugins’
source: .
plugin: dump
organize:
myExecutable: bin/myExecutable

stage-packages:
  - libglu1-mesa

On Linux systems, the user’s home directory is specified in an environment variable called HOME. Snaps set this variable to a different directory by default. You can use snap run --shell mysnap to see how the environment variables are set when your snap runs.

merlijn@howard:~$ snap run --shell photoscape
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

merlijn@howard:/home/merlijn$ echo $HOME
/home/merlijn/snap/photoscape/16

One of the solutions might be to change the HOME environment variable in a wrapper script before you run your application. However, that has the issue that many applications try to access hidden directories in HOME which will fail because it is not allowed by the home plug.

A better option is to change the default directory of your application using config files, environment variables or command-line parameters. However, this means your application must support such an environment variable or CLI argument.