Desktop app snap in 300KB

KDE Neon developer Harald Sitter was able to package up the KDE calculator, kcalc, in a snap that weighs in at a mere 320KB! How did he do it?

KCalc and KDE Frameworks snaps

Like most applications in KDE, kcalc depends on several KDE Frameworks (though not all), sets of libraries and services that provide the common functionality and shared UI/UX found in KDE and it’s suite of applications. This means that, while kcalc is itself a small application, it’s dependency chain is not. In the past, any KDE application snap had to include many megabytes of platforms dependencies, even for the smallest app.

Recently I introduced the new “content” interface that has been added to snapd. I used this interface to share plugin code with a text editor, but Harald has taken it even further and created a KDE Frameworks snap that can share the entire platform with applications that are built on it!

While still in the very early stages of development, this approach will allow the KDE project to deliver all of their applications as independent snaps, while still letting them all share the one common set of Frameworks that they depend on. The end result will be that you, the user, will get the very latest stable (or development!) version of the KDE platform and applications, direct from KDE themselves, even if you’re on a stable/LTS release of your distro.

If you are running a snap-capable distro, you can try these experimental packages yourself by downloading kde-frameworks-5_5.26_amd64.snap and kcalc_0_amd64.snap from Neon’s build servers, and installing them with “snap install –devmode –force-dangerous <snap_file>”. To learn more about how he did this, and to help him build more KDE application snaps, you can find Harald as <sitter> on #kde-neon on Freenode IRC.

This entry was posted in Community, Upstream, Work and tagged , , , , , , , . Bookmark the permalink.

7 Responses to Desktop app snap in 300KB

  1. Omer Akram says:

    Is there going to be some kind of dependency resolution for snaps in the store ? Lets say kcalc requires the kde-frameworks that is not installed, Will it download its dependency automatically or will the install just fail ?

    • Michael Hall says:

      I believe that’s the plan, yes. The content interface lets you define a “default-provider” that can be installed if you don’t already have something that provides the kind of content you’re looking for. But I don’t believe that implementation has been started yet.

  2. Oli says:

    I’ve always struggled to see how Snaps fit into the mature package management landscape but this really has me flummoxed. If they needed to patch the framework, the update isn’t 300kb, or even just the bit they patched, it’s the whole 130MB framework snap that needs replacing.

    Now I can certainly see the point of splitting these two packages apart and sharing the framework as a dependency, but I’m all for debs and Apt. What I don’t understand is that if you want dependency chains —however long or short— why wouldn’t you just use a deb?

    I’d really like to get on board with these new packages so what am I missing? At this point, where we’re fracturing packages out into versioned dependencies, what do snaps offer that’s better than a similar pattern of debs?

    • Michael Hall says:

      The main difference is that both packages must be owned by the same developer (in this case, KDE) in order to allow this.

  3. Keshav Bhatt says:

    Nice work Michael Hall :) but this again is not what a snap is defined. Ex- kcalc.snap is not independent package. It need some dependency to make it run.

    • Paul says:

      Agreed, if I want to install kcalc into my Unity DE, apt will install the dependencies after which I can install any kde app. There is no difference that I can see with snap. Just another new way to accomplish the same thing.

  4. Pingback: Links 2/10/2016: Wine 1.9.20, Raspberry Pi PIXEL | Techrights

Comments are closed.