Building applications for both Snap and Flatpak at once

Hello,

I am from the Freedesktop SDK team, and we build the runtimes for Flatpak.

I have been looking at building application to be able to run both on
Flatpak and Snappy.

I believe that the user ultimately should choose the tools they want
to run applications. But developers should be able to target all of
them at once.

I have made a
demo building Firefox.

In order to achieve this, I use
BuildStream, the tool used to build the
Freedesktop SDK and the GNOME SDK, instead of Snapcraft. This tool is
generic and not targetting just Flatpak. So I have been able to make a
“base” snap image of the SDK’s runtime. Then I can make snap image of
an application using this base image.

This base image is just the runtime, it is not a SDK. You can not use
snapcraft to build with it.

I have a merge request ready for review in Freedesktop SDK. And I hope it will pass the review soon.

Once we merge that, we will start pushing continuously edge releases
on Snapcraft. And in the next release, the first “stable” version will
also be pushed.

I have a technical blog
post

on it if you want more information.

I post here because I would like to the feedback from this community.

7 Likes

Hey. Nice work!

I’m away from office but I want to review the technical article in detail when I am back. There are some inaccuracies I would like to clarify.

5 Likes