Snap build fails to find required plugin

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.

Multipass VM uses minimal, headless configuration thus GUI is not available.

The Snapcraft Build Service provide builds for armhf/arm64 and other exotic platforms.

In addition there’s the option to run snapcraft remote-build if you follow the instructions detailed at Preview: Snapcraft remote build

This will build on a server in the Canonical datacentre for whichever architectures you specify.

3 Likes

OK … well have a stab at it. Prolly after Fosstalk today though :wink:

1 Like

You also might consider LXD for container builds. @Lin-Buo-Ren 's snapcraft.yaml worked for me using snap versions of lxd and snapcraft. I prefer LXD builds – snapcraft --use-lxd – (similar to docker and support offered in snapcraft as a tech preview – never had an issue, tho) over multipass because it’s lighter weight. LXD is likely what you want if you prefer the docker model for whatever reason. I use LXD extensively in my normal development and especially for apt/ppa/snapcraft packaging testing.

Good to know. Thanks!