Apparently a repository I made at the start of my tests, 2 years ago, using snapcraft.yaml and pyqt, with qt5 and python3, is what people find when searching for information on the topic.
Is there something wrong on the way I am snapping this hello-world repo?
That should be enough, and you might be able to drop some stage-packages that is already depended by the remote part, refer the output of snapcraft define desktop-qt5 for more info.
The hello world app doesn’t seem to work when using Wayland (but does for X11):
$ pyqthelloworld
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
qt.qpa.plugin: Could not load the Qt platform plugin "wayland-egl" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl.
Aborted
That issue generally happens when you have missing dependencies, could you please run the below command and see if any line says “not found”, if that is the case, you’d have to add more stage-packages to fulfill those deps.
Note: this above command needs to be run after snap run --shell <your_name_name>, its quite likely the path would be $SNAP/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqwayland-egl.so
@Lin-Buo-Ren thanks adding DISABLE_WAYLAND: 1 fixed the issue.
Should this be updated in the hello world application/desktop helpers repo so that they work with Wayland by default or is it best to wait for wider Snapcraft Wayland support? I could make a pull request.