Putting libraries in the separate snap

Hi. We currently ship whole buildroot build output inside our snap (this is legacy and we want to get rid of it).
What would be the best practice to create new snap?
I basically need to build few things:

  • Qt 5 (possibly forked from the official one) for egl
  • Qt 5 webkit
  • Gstreamer
  • Our application.

Would it make sense to have our application in a separate snap and the libraries in a separate? Qt 5 and gstreamer should not be updated very frequently so I would prefer to not rebuild them every time for fast build time among other things.

If not what is the best practice in such case?

With snapd downloads from the store a lot of the things that are identical between releases should be omitted by the delta-download system which only downloads the difference between the two packages (the one installed and the new one replacing it). You can ensure that the libraries are identical between releases by creating your own PPA on launchpad saving the libraries into deb packages there and using the PPA when you build your snap.

Alternatively, you are correct that separating the libraries into a completely independant snap would allow that to update separately, however there is no auto-install mechanism so your application will need some way to prompt the user to install the library snap. There is also no version-compatibility guarantees, so there is potential for a user to have an incompatible combination of library snap and application snap. Library snaps are really the most useful when multiple application snaps depend on the same set of libraries, such as the gnome platform snap shared by several apps in the store from many developers.

TL/DR Iā€™d recommend that you either continue building the libraries as part of your snap build process or set up a PPA to hold them for easy replication.

1 Like