Snap build fails to find required plugin

Ok second punt at this. So my yaml is this.

name: rolisteam
version: "1.9.0"
summary: RPG Tabletop Manager
description: |
  Rolisteam is a virtual tabletop software. It helps you to manage 
  tabletop role playing games with remote friends/players. 
  It provides many features to share maps, pictures and it also 
  includes tool to communicate with your friends/players. 
  The goal is to make Rolisteam-managed RPG games as good as 
  RPG games around your table. 
  To achieve it, we are working hard to provide you more and more features. 


confinement: strict
base: core18

parts:
  rolisteam:
    plugin: qmake
    source-type: git
    source: https://github.com/Rolisteam/rolisteam.git
    build-packages:
      - qt5-default
      - qtbase5-dev-tools
      - qt5-qmake 
      - libqt5network5
      - zlib1g-dev 
      - build-essential
      - ca-certificates
      - qtmultimedia5-dev
      - libqt5core5a
      - libqt5gui5
      - qttools5-dev-tools
      - qtdeclarative5-dev
      - qtwebengine5-dev
      - libqt5svg5-dev         
    stage-packages:
      - libqt5network5
      - zlib1g
      - libqt5multimedia5
      - libqt5multimedia5-plugins
      - libqt5multimediaquick-p5
      - libqt5multimediawidgets5
      - libqt5core5a
      - libqt5gui5
      - libqt5webengine5
      - libqt5webenginewidgets5
      - libqt5svg5
      - libqt5xml5
      - libpulse0
      - qt5dxcb-plugin
apps:

  rolisteam:
    command: usr/local/bin/rolisteam
    environment: 
      "LD_LIBRARY_PATH": "$LD_LIBRARY_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio"
      "QT_PLUGIN_PATH": $"QT_PLUGIN_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins/"


    plugs: 
      - home
      - network
      - pulseaudio
      - desktop
      - desktop-legacy
      - wayland
      - x11

This build ok (as far as I know)

Staging rolisteam 
Priming rolisteam 
The execstacks are going to be cleared for the following files:
- /root/rolisteam/prime/usr/lib/x86_64-linux-gnu/libQt5WebEngineCore.so.5.9.5
To disable this behavior set `build-attributes: [keep-execstack]` for the part.
'grade' property not specified: defaulting to 'stable'
Snapping 'rolisteam' /                                                                                                                                     
Snapped rolisteam_1.9.0_amd64.snap

But when running the snap it barfs.

snap run rolisteam
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".


Reinstalling the application may fix this problem.
Aborted

I tried everything from my previous post and tried adding the plugin path by hand but still no joy.

What am I missing here?

Thanks.

You have to incorporate the desktop-qt5 part and use the desktop-launch launcher to launch the application, refer snapcraft-desktop-helpers/snapcraft.yaml at master · ubuntu/snapcraft-desktop-helpers for more info.

1 Like

I see, and this will bring in the QT Plugin framework? So I essentially just need to add

  after: desktop-qt5 

To the apps: section?

and

  desktop-launch $SNAP/usr/local/bin/rolisteam

to command ?

EDIT:

OK someone will have to be a little more specific please. That desktop-helpers seem to be a separate snap and is not in the default docker container so how am I supposed to use it ?

Refer the following reply for more info:

Hmm I see. I have to make a separate section to pull in the helpers into the confinement and then use them to pull in the desktop + plugins.

Ok … I will have a stab at that and let you know how I get on.

Thanks.

1 Like

Ok well that fixed one error but now I have another

snap run rolisteam
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Unrecognized OpenGL version
Unrecognized OpenGL version
Could not find QtWebEngineProcess
Aborted

I added opengl to the snap yaml.

This is what is looks like now.

name: rolisteam
version: "1.9.0"
summary: RPG Tabletop Manager
description: |
  Rolisteam is a virtual tabletop software. It helps you to manage 
  tabletop role playing games with remote friends/players. 
  It provides many features to share maps, pictures and it also 
  includes tool to communicate with your friends/players. 
  The goal is to make Rolisteam-managed RPG games as good as 
  RPG games around your table. 
  To achieve it, we are working hard to provide you more and more features. 


confinement: strict
base: core18
parts:
  rolisteam:
    plugin: qmake
    source-type: git
    source: https://github.com/Rolisteam/rolisteam.git
    build-attributes: [keep-execstack]
    build-packages:
      - qt5-default
      - qtbase5-dev-tools
      - qt5-qmake 
      - libqt5network5
      - zlib1g-dev 
      - build-essential
      - ca-certificates
      - qtmultimedia5-dev
      - libqt5core5a
      - libqt5gui5
      - qttools5-dev-tools
      - qtdeclarative5-dev
      - qtwebengine5-dev
      - libqt5svg5-dev         
    stage-packages:
      - libqt5network5
      - zlib1g
      - libqt5multimedia5
      - libqt5multimedia5-plugins
      - libqt5multimediaquick-p5
      - libqt5multimediawidgets5
      - libqt5core5a
      - libqt5gui5
      - libqt5webengine5
      - libqt5webenginewidgets5
      - libqt5svg5
      - libqt5xml5
      - libpulse0
      - qt5dxcb-plugin

  desktop-qt5:
    source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
    source-depth: 1
    source-subdir: qt

    plugin: make
    make-parameters: ["FLAVOR=qt5"]
    build-packages:
    - build-essential
    - qtbase5-dev
    - dpkg-dev
    stage-packages:
    - libxkbcommon0
    - ttf-ubuntu-font-family
    - dmz-cursor-theme
    - light-themes
    - adwaita-icon-theme
    - gnome-themes-standard
    - shared-mime-info
    - libqt5gui5
    - libgdk-pixbuf2.0-0
    - libqt5svg5 # for loading icon themes which are svg
    - try: [appmenu-qt5] # not available on core18
    - locales-all
    - xdg-user-dirs
    - fcitx-frontend-qt5
apps:

  rolisteam:
    command: desktop-launch $SNAP/usr/local/bin/rolisteam
    environment: 
      "LD_LIBRARY_PATH": "$LD_LIBRARY_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio"
      "QT_PLUGIN_PATH": $"QT_PLUGIN_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins/"


    plugs: 
      - home
      - network
      - pulseaudio
      - desktop
      - desktop-legacy
      - wayland
      - x11
      - opengl

so any more suggestions… I hate to say it but the flatpak wasn’t this hard to get working.

Check out https://doc.qt.io/qt-5/qtwebengine-deploying.html#deploying-qt-webengine-processes

Good for them :slight_smile:

Check out https://doc.qt.io/qt-5/qtwebengine-deploying.html#deploying-qt-webengine-processes

Huh… that is talking about the build process? There is nothing wrong with the build process. There is something wrong with the runtime environment snap is emulating.

The irony is I used to get a warning about it not being included so I added the part

     build-attributes: [keep-execstack]

As that is what it recommended.

Was that wrong?

Maybe the QTWEBENGINEPROCESS_PATH environment variable will work?

Maybe the QTWEBENGINEPROCESS_PATH environment variable will work?

That does not really make much sense. The libs are already there in the path.

ls -la stage/usr/lib/x86_64-linux-gnu/*Engine*
lrwxrwxrwx 3 root root        24 Apr 15  2018 stage/usr/lib/x86_64-linux-gnu/libQt5WebEngine.so.5 -> libQt5WebEngine.so.5.9.5
lrwxrwxrwx 3 root root        24 Apr 15  2018 stage/usr/lib/x86_64-linux-gnu/libQt5WebEngine.so.5.9 -> libQt5WebEngine.so.5.9.5
-rw-r--r-- 3 root root    415816 Apr 15  2018 stage/usr/lib/x86_64-linux-gnu/libQt5WebEngine.so.5.9.5
lrwxrwxrwx 3 root root        28 Apr 15  2018 stage/usr/lib/x86_64-linux-gnu/libQt5WebEngineCore.so.5 -> libQt5WebEngineCore.so.5.9.5
lrwxrwxrwx 3 root root        28 Apr 15  2018 stage/usr/lib/x86_64-linux-gnu/libQt5WebEngineCore.so.5.9 -> libQt5WebEngineCore.so.5.9.5
-rw-r--r-- 3 root root 103245776 Apr 15  2018 stage/usr/lib/x86_64-linux-gnu/libQt5WebEngineCore.so.5.9.5
lrwxrwxrwx 3 root root        31 Apr 15  2018 stage/usr/lib/x86_64-linux-gnu/libQt5WebEngineWidgets.so.5 -> libQt5WebEngineWidgets.so.5.9.5
lrwxrwxrwx 3 root root        31 Apr 15  2018 stage/usr/lib/x86_64-linux-gnu/libQt5WebEngineWidgets.so.5.9 -> libQt5WebEngineWidgets.so.5.9.5
-rw-r--r-- 3 root root    264264 Apr 15  2018 stage/usr/lib/x86_64-linux-gnu/libQt5WebEngineWidgets.so.5.9.5

Unless you build QtWebengine from source it will always find the libraries in the libdir that is set during the configuration phase of the build, which is usually /usr/lib/*, not $SNAP/usr/lib/*

Also QtWebProcess is not a library, but an executable installed in the configured libexec dir.

QtWebProcess is not a library, but an executable installed in the configured libexec dir.

Yup that is there too.

find stage -name "*Process*"
stage/usr/lib/x86_64-linux-gnu/qt5/libexec/QtWebEngineProcess

So I should export the path to that?

OK well I tried that and still no joy. Same error.

this is the snapcraft.yaml now.

name: rolisteam
version: "1.9.0"
summary: RPG Tabletop Manager
description: |
  Rolisteam is a virtual tabletop software. It helps you to manage 
  tabletop role playing games with remote friends/players. 
  It provides many features to share maps, pictures and it also 
  includes tool to communicate with your friends/players. 
  The goal is to make Rolisteam-managed RPG games as good as 
  RPG games around your table. 
  To achieve it, we are working hard to provide you more and more features. 


confinement: strict
base: core18
parts:
  rolisteam:
    plugin: qmake
    source-type: git
    source: https://github.com/Rolisteam/rolisteam.git
    build-attributes: [keep-execstack]
    build-packages:
      - qt5-default
      - qtbase5-dev-tools
      - qt5-qmake 
      - libqt5network5
      - zlib1g-dev 
      - build-essential
      - ca-certificates
      - qtmultimedia5-dev
      - libqt5core5a
      - libqt5gui5
      - qttools5-dev-tools
      - qtdeclarative5-dev
      - qtwebengine5-dev
      - libqt5svg5-dev         
    stage-packages:
      - libqt5network5
      - zlib1g
      - libqt5multimedia5
      - libqt5multimedia5-plugins
      - libqt5multimediaquick-p5
      - libqt5multimediawidgets5
      - libqt5core5a
      - libqt5gui5
      - libqt5webengine5
      - libqt5webenginewidgets5
      - libqt5svg5
      - libqt5xml5
      - libpulse0
      - qt5dxcb-plugin

  desktop-qt5:
    source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
    source-depth: 1
    source-subdir: qt

    plugin: make
    make-parameters: ["FLAVOR=qt5"]
    build-packages:
    - build-essential
    - qtbase5-dev
    - dpkg-dev
    stage-packages:
    - libxkbcommon0
    - ttf-ubuntu-font-family
    - dmz-cursor-theme
    - light-themes
    - adwaita-icon-theme
    - gnome-themes-standard
    - shared-mime-info
    - libqt5gui5
    - libgdk-pixbuf2.0-0
    - libqt5svg5 # for loading icon themes which are svg
    - try: [appmenu-qt5] # not available on core18
    - locales-all
    - xdg-user-dirs
    - fcitx-frontend-qt5
apps:

  rolisteam:
    command: desktop-launch $SNAP/usr/local/bin/rolisteam
    environment: 
      "LD_LIBRARY_PATH": "$LD_LIBRARY_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio"
      "QT_PLUGIN_PATH": $"QT_PLUGIN_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins/"
      "QTWEBENGINEPROCESS_PATH": $"QTWEBENGINEPROCESS_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/libexec/"

    plugs: 
      - home
      - network
      - pulseaudio
      - desktop
      - desktop-legacy
      - wayland
      - x11
      - opengl

If this is still an issue then you likely are missing a stage package.

Add libglu1-mesa (and you already added the opengl plug. That should be enough.

This thread covers it. Adding OpenGL/GPU support to a snap

1 Like

I will try and let you know.

EDIT:

Nope the same.

Again here is the snapcraft.yaml.

name: rolisteam
version: "1.9.0"
summary: RPG Tabletop Manager
description: |
  Rolisteam is a virtual tabletop software. It helps you to manage 
  tabletop role playing games with remote friends/players. 
  It provides many features to share maps, pictures and it also 
  includes tool to communicate with your friends/players. 
  The goal is to make Rolisteam-managed RPG games as good as 
  RPG games around your table. 
  To achieve it, we are working hard to provide you more and more features. 


confinement: strict
base: core18
parts:
  rolisteam:
    plugin: qmake
    source-type: git
    source: https://github.com/Rolisteam/rolisteam.git
    build-attributes: [keep-execstack]
    build-packages:
      - qt5-default
      - qtbase5-dev-tools
      - qt5-qmake 
      - libqt5network5
      - zlib1g-dev 
      - build-essential
      - ca-certificates
      - qtmultimedia5-dev
      - libqt5core5a
      - libqt5gui5
      - qttools5-dev-tools
      - qtdeclarative5-dev
      - qtwebengine5-dev
      - libqt5svg5-dev         
    stage-packages:
      - libqt5network5
      - zlib1g
      - libqt5multimedia5
      - libqt5multimedia5-plugins
      - libqt5multimediaquick-p5
      - libqt5multimediawidgets5
      - libqt5core5a
      - libqt5gui5
      - libqt5webengine5
      - libqt5webenginewidgets5
      - libqt5svg5
      - libqt5xml5
      - libpulse0
      - qt5dxcb-plugin
      - libglu1-mesa
  desktop-qt5:
    source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
    source-depth: 1
    source-subdir: qt

    plugin: make
    make-parameters: ["FLAVOR=qt5"]
    build-packages:
    - build-essential
    - qtbase5-dev
    - dpkg-dev
    stage-packages:
    - libxkbcommon0
    - ttf-ubuntu-font-family
    - dmz-cursor-theme
    - light-themes
    - adwaita-icon-theme
    - gnome-themes-standard
    - shared-mime-info
    - libqt5gui5
    - libgdk-pixbuf2.0-0
    - libqt5svg5 # for loading icon themes which are svg
    - try: [appmenu-qt5] # not available on core18
    - locales-all
    - xdg-user-dirs
    - fcitx-frontend-qt5
apps:

  rolisteam:
    command: desktop-launch $SNAP/usr/local/bin/rolisteam
    environment: 
      "LD_LIBRARY_PATH": "$LD_LIBRARY_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio"
      "QT_PLUGIN_PATH": $"QT_PLUGIN_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins/"
      "QTWEBENGINEPROCESS_PATH": $"QTWEBENGINEPROCESS_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/libexec/"

    plugs: 
      - home
      - network
      - pulseaudio
      - desktop
      - desktop-legacy
      - wayland
      - x11
      - opengl

If someone else wants to build it and test it please do so I can at least be sure it is not the docker container that is as fault.

1 Like

Please don’t assume that every *_PATH environment variable supports multiple paths separated by colon

Hello, I’ve build the snap from your Snapcraft recipe and it launched properly, can you elaborate how to trigger the issue?

Can you post the yaml file you used? How did you build it, because I built it via docker (as recommended)

My build would never start it would just error with the above error about not being able to find x component.

Thanks.

Docker build is not a recommended practice at least for now, currently the recommended way to build snaps is via Multipass VM (which is the default).

name: rolisteam
version: 1.8.2
summary: RPG Tabletop Manager
description: |
  Rolisteam is a virtual tabletop software. It helps you to manage 
  tabletop role playing games with remote friends/players. 
  It provides many features to share maps, pictures and it also 
  includes tool to communicate with your friends/players. 
  The goal is to make Rolisteam-managed RPG games as good as 
  RPG games around your table. 
  To achieve it, we are working hard to provide you more and more features. 


confinement: strict
base: core18
parts:
  rolisteam:
    plugin: qmake
    source-type: git
    source: https://github.com/Rolisteam/rolisteam.git
    source-tag: v1.8.2
    build-attributes: [keep-execstack]
    build-packages:
      - qt5-default
      - qtbase5-dev-tools
      - qt5-qmake 
      - libqt5network5
      - zlib1g-dev 
      - build-essential
      - ca-certificates
      - qtmultimedia5-dev
      - libqt5core5a
      - libqt5gui5
      - qttools5-dev-tools
      - qtdeclarative5-dev
      - qtwebengine5-dev
      - libqt5svg5-dev         
    stage-packages:
      - libqt5network5
      - zlib1g
      - libqt5multimedia5
      - libqt5multimedia5-plugins
      - libqt5multimediaquick-p5
      - libqt5multimediawidgets5
      - libqt5core5a
      - libqt5gui5
      - libqt5webengine5
      - libqt5webenginewidgets5
      - libqt5svg5
      - libqt5xml5
      - libpulse0
      - qt5dxcb-plugin
      - libglu1-mesa
  desktop-qt5:
    source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
    source-depth: 1
    source-subdir: qt

    plugin: make
    make-parameters: ["FLAVOR=qt5"]
    build-packages:
    - build-essential
    - qtbase5-dev
    - dpkg-dev
    stage-packages:
    - libxkbcommon0
    - ttf-ubuntu-font-family
    - dmz-cursor-theme
    - light-themes
    - adwaita-icon-theme
    - gnome-themes-standard
    - shared-mime-info
    - libqt5gui5
    - libgdk-pixbuf2.0-0
    - libqt5svg5 # for loading icon themes which are svg
    - try: [appmenu-qt5] # not available on core18
    - locales-all
    - xdg-user-dirs
    - fcitx-frontend-qt5
apps:

  rolisteam:
    command: desktop-launch $SNAP/usr/local/bin/rolisteam
    environment: 
      "LD_LIBRARY_PATH": "$LD_LIBRARY_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio"
      "QT_PLUGIN_PATH": $"QT_PLUGIN_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins/"
      "QTWEBENGINEPROCESS_PATH": $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/libexec

    plugs: 
      - home
      - network
      - pulseaudio
      - desktop
      - desktop-legacy
      - wayland
      - x11
      - opengl

You can download the built snap here: https://transfer.sh/eLtxk/rolisteam_1.9.0_amd64.snap

Hmmm Multipass VM? Prefer a docker as at least I don’t have to faff around with a gui and extra cruft for a full Ubuntu. But if that is how it is supposed to be done I’ll try it that way.

So just out of curiosity how to you do the same to build for an arm platform ? I am not aware of any Ubuntu arm desktop images save the UBports stuff which is not really official Ubuntu.