Question about runtimes

Mark Naughton mark at marknaughton.com
Tue Aug 6 13:18:21 UTC 2024


On Tue, Aug 06, 2024 at 10:10:12AM GMT, Emmanuele Bassi wrote:
> > No, I mean if I install a calculator that uses the GNOME runtime, why not
> just bring in the parts of the runtime that the calculator needs?
> 
> Because that's not how Flatpak works.
> 
> Flatpak sets up a complete environment for an application. Any application
> developer can either decide to bundle *all* its dependencies in its own
> build, and then maintain them; or they can defer to "run times", which
> provide and maintain a more complete environment, at the cost of a bigger
> size.

I understand how runtimes work: what I don't understand is why when I
install gnome calculator it brings in 800mb of libraries like SDL and FLAC etc all of which are not used by the calculator. To test, I deleted these libraries from the filesytem and the calculator still happily launched.

You already know what runtime the program was built against, and its dependencies can be discovered with ldd. It may use libraries provided by the runtime or bring its own, but there is no reason to bring in stuff it doesn't need.

If I install a program with a normal package manager I don't bring in
every .so in the repos, I bring in more on an as-need basis. It
seems distros have no problem keeping track of dependencies and since
flatpaks are packaged by the developer, the job is even easier. The
current flatpak situation is basically statically linking an entire
distro. Various applications require different versions of each runtime,
which means your first few downloads with flatpak tend to be very large. Not
fun on my 12Mbit/s DSL connection.


More information about the Flatpak mailing list