@alan_g I managed to get the snap running properly: on Ubuntu 18.04 LTS desktop both with miral-kiosk
or mir-kiosk
with edge core; on Ubuntu Core using mir-kiosk
with stable core. I’ll outline the main steps below, for fellow snap crafters that may run into similar issues (or have the same lack of experience with graphic stacks as I had). So bear with me – or skip to “Questions”
The main problem were missing/wrong XDG
environment variables inside the snap env. After I adapted them from the mir-kiosk-apps
example you linked, WPE could connect to the Wayland socket and the EGL display. Then some iterative “libxyz is missing”, and it worked on Ubuntu Desktop. I added plugs and the snapcraft-preload
plugin recommended by snappy-debug
, and proceeded to test the ARM build on Core.
I was confused at first why the WebKit process was stuck in a crash loop after I installed the snap on Core running on a RasPi 3B. When I removed snapcraft-preload
from the startup command, it stopped crashing – but loading any trivial website had weird issues that indicated that the browser can’t find libraries despite LD_LIBRARY_PATH
being set. Issues like no images, no SSL/TLS despite libglib-networking
being present etc. Also, this was in devmode
, where WPE Webkit may access /dev/shm
(which I gathered snapcraft-preload
provides a workaround for in strict mode).
The WPE WebKit backend libwpebackend-fdo
relies on the FreeDesktop.org stack, so I added the gtk3-desktop
helper. Now everything works fine, I added two basic configuration options (URL and a toggle for the Remote Web Inspector) as well.
Some links to WPE WebKit in general: https://wpewebkit.org → main site https://github.com/WebPlatformForEmbedded → GitHub org https://github.com/Igalia/cog → Fullscreen browser launcher used in this snap
Questions
I added TODO / FIXME to snapcraft.yaml to indicate the work-in-progress parts. Most concern dependencies for building/running WPE Webkit, but I’d be stoked if someone can answer me these questions which I think are more related to snapcraft/Core/mir:
- From experience with other snaps, would a slimmer desktop-helper than gtk3 suffice to provide the “normal” FDO stack required by
libwpebackend-fdo
? Including this helper brings the snap from ~75 to ~114MB. (Also asked this the WPE maintainers:libwayland-client
andlibwayland-server
may suffice) - The browser fails to resolve zeroconf/Bonjour hostnames, though it works fine when building and running
cog
+ WPE WebKit natively works fine. I included some avahi-related libs and connected theavahi-observe
interface, but I guess I’m missing something fundamental here.
Meta
I’d like to suggest amending the docs for Debugging building snaps with a workflow that sped up my debugging on-device (ARM snap on a RasPi 3) tremendously:
- Let the ARM build run on Launchpad – takes ~ 3h for the WPE snap instead of forever (or probably failing due to limited CPU/RAM) when building on a RasPi
- Load the snap file from LP to your device, either via
scp
from your main machine or using @ondra 's greattoolbox
snap - Run
unsquashfs -d my-dir-name the-snap-file_0.1.0_somearch.snap
- You can now
snap try my-dir-name
(optionally with--devmode
) and edit all files inmy-dir-name
to your heart’s content, all instantly reflected inside the snap. Only when editingmy-dir-name/meta/snap.yaml
to change app commands/services or add interfaces, you need to remove and re-mount the snap (viasnap try
).
Step 4 (snap try
) is already documented there, but I think fleshing out an extra sentence how that works if you only have a .snap file (LP build or snapcraft 3 with bases) can help expediting dev workflows.