GTK-related issues when upgrading snap pkg generation from 20.04 to 22.04

Hello. I have a snap package that uses GTK so my snapcraft.yaml contains this fragment:


  gtk2:
    source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
    source-subdir: gtk
    plugin: make
    make-parameters: ["FLAVOR=gtk2"]
    build-packages:
      - libgtk2.0-dev
    stage-packages:
      - libxkbcommon0  # XKB_CONFIG_ROOT
      - ttf-ubuntu-font-family
      - dmz-cursor-theme
      - light-themes
      - adwaita-icon-theme
      - gnome-themes-standard
      - shared-mime-info
      - libgtk2.0-0
      - libgdk-pixbuf2.0-0
      - libglib2.0-bin
      - libgtk2.0-bin
      - unity-gtk2-module
      - libappindicator1
      - locales-all
      - ibus-gtk
      - libibus-1.0-5

plugs:
  gtk-2-engines:
    interface: content
    target: $SNAP/lib/gtk-2.0
    default-provider: gtk2-common-themes
  gtk-2-themes:
    interface: content
    target: $SNAP/data-dir/themes
    default-provider: gtk-common-themes
  icon-themes:
    interface: content
    target: $SNAP/data-dir/icons
    default-provider: gtk-common-themes
  sound-themes:
    interface: content
    target: $SNAP/data-dir/sounds
    default-provider: gtk-common-themes

We have a CI pipeline that generates the snap package. This package has been running fine for months or even years with an ubuntu 20.04 OS.

Now, this week I decided to upgrade the CI pipeline to use 22.04 instead of 20.04 and I noticed two issues:

  1. First is that the build started failing with the error “Failed to fetch stage packages: Error downloading packages for part ‘gtk2’: The package ttf-ubuntu-font-family was not found…”. I tried to find a replacement for that package in 22.04 but was not very successful, so I decided to just remove the line that mentions this package from snapcraft.yaml, and it seems to make it work (and no apparent issues when launching the app from the snap). Hopefully this is fine, but if you know the alternative package I should have used, please let me know?

  2. Since the upgrade, I’ve noticed these errors happening in the console when launching the app (which don’t seem to cause any harm, but are simply a bit worrying):

update.go:85: cannot change mount namespace according to change mount (/snap/gtk-common-themes/1535/share/gtk2/Materia-compact /snap/geewallet/60/data-dir/themes/Materia-compact none bind,ro 0 0): cannot write to "/snap/gtk-common-themes/1535/share/gtk2/Materia-compact" because it would affect the host in "/snap"

update.go:85: cannot change mount namespace according to change mount (/snap/gtk-common-themes/1535/share/gtk2/Materia-dark-compact /snap/geewallet/60/data-dir/themes/Materia-dark-compact none bind,ro 0 0): cannot write to "/snap/gtk-common-themes/1535/share/gtk2/Materia-dark-compact" because it would affect the host in "/snap"

update.go:85: cannot change mount namespace according to change mount (/snap/gtk-common-themes/1535/share/gtk2/Yaru-MATE-dark /snap/geewallet/60/data-dir/themes/Yaru-MATE-dark none bind,ro 0 0): cannot use "/snap/gtk-common-themes/1535/share/gtk2/Yaru-MATE-dark" as bind-mount source: not a directory

update.go:85: cannot change mount namespace according to change mount (/snap/gtk-common-themes/1535/share/gtk2/Yaru-MATE-light /snap/geewallet/60/data-dir/themes/Yaru-MATE-light none bind,ro 0 0): cannot use "/snap/gtk-common-themes/1535/share/gtk2/Yaru-MATE-light" as bind-mount source: not a directory

Is it that something needs updating in the ‘gtk’ plug or desktop helper?

Thanks in advance.