Home RSS icon Posts RSS icon Microblog

Snippet Pixie snap fresh install fixed

The other day I was using an Ubuntu VM and noticed that for some reason Snippet Pixie failed to run with some weird error related to its settings schema not being available. As I was mucking about with configuring an i3wm desktop I didn't really think much of it, thinking I'd likely broken something along the way.

However, this evening I thought I'd just double check what was up with that VM and give the Snippet Pixie snap a proper test on a stock Ubuntu VM I have hanging around for just that use-case. At first all looked fine, but then I decided to fully purge the existing Snippet Pixie install and clean install it. And of course it then had the same problem.

After much experimentation I found that some time between when Snippet Pixie 1.5.1 revision 138 was released on 2021-03-26 and the next rebuild as revision 141 was released on 2021-04-14, fresh installs no longer copied the settings schema file into place on first run.

I suspect there was a release of snapcraft (the tool for building snap packages) that changed something, likely security related.

I searched for anyone else having the same issue in the snapcraft forums but couldn't see anything that looked related, which made me think that it was likely then to be a problem with how I was building the Snippet Pixie snap package.

I ran a few tests, building the snap locally and installing it in the VM, sure enough it failed to install the settings schema at runtime. The only way I could get the settings schema to install at runtime was by explicitly installing a revision before 141 from the snap store.

I tried a few different things, looking to see if I could upgrade anything related to how snaps are built, but what with Snippet Pixie needing to be a "classic" confined (e.g. not confined) snap, I couldn't take advantage of some of the newer niceties such as the gnome-3-38 extension.

One thing stood out when I checked the details of that gnome-3-38 extension:

ian@ians-apollo:~ $ snapcraft extension gnome-3-38
This extension eases creation of snaps that integrate with GNOME 3.38.

At build time it ensures the right build dependencies are setup and for the
runtime it ensures the application is run in an environment catered for GNOME

It configures each application with the following plugs:

- GTK3 Themes.
- Common Icon Themes.
- Common Sound Themes.
- The GNOME runtime libraries and utilities corresponding to 3.38.

For easier desktop integration, it also configures each application entry with
these additional plugs:

- desktop (https://snapcraft.io/docs/desktop-interface)
- desktop-legacy (https://snapcraft.io/docs/desktop-legacy-interface)
- gsettings (https://snapcraft.io/docs/gsettings-interface)
- opengl (https://snapcraft.io/docs/opengl-interface)
- wayland (https://snapcraft.io/docs/wayland-interface)
- x11 (https://snapcraft.io/docs/x11-interface)

It mentions enabling the "gsettings" plug, which is exactly the same area that I was having problems with. This got me thinking about which libraries the snap used at build and runtime, which lead me to notice a peculiarity with the snapcraft.yaml. While the "libglib2.0-dev" library was being used during build, the equivalent "libglib2.0-0" runtime library was not being staged for install.

So I added that library to the stage phase of the snapcraft.yaml and built and installed a local snap package from it, and it worked! 🎉ī¸

So, long story short, there's a new build of Snippet Pixie in the snap store that should actually work!

Snippet Pixie in the snap store

It's a little disheartening though to think that for 6 or more weeks Snippet Pixie has not been working for new installs of the snap version, and no one either noticed it or bothered to tell me if they did. ☚ī¸


"Snippet Pixie snap fresh install fixed" was published on June 4, 2021.