Perl scripting within flatpak

Alexander Larsson alexl at redhat.com
Fri Nov 16 08:43:01 UTC 2018


On Fri, Nov 16, 2018 at 1:36 AM Daniel Kasak <d.j.kasak.dk at gmail.com> wrote:
>
> All of these questions are related, so I'll just comment generally ...
>
> There is a method of registering "plugins" to a flatpak app ( which I haven't used yet ), which in theory could add a Perl distribution and "base" libraries. But I don't think this would be practical unless you could make this Perl base plugin available at build time ... as additional Perl libraries will often require their own set of Perl dependencies.

Yes, plugins are useful as *plugins*. I.e. they are optional and your
app must not break if not installed. They are *not* a way to try to
somehow add package dependencies to flatpak.

> When I started out building my app, I asked about adding Perl to the various flatpak runtimes, and there was some discussion, but it didn't go anywhere. From memory, there were concerns about adding to the size of the runtime. I guess this has to be considered against the relative number of Perl devs building flatpak apps - I assume there aren't very many of us ... and some users do like to scream about "bloat". Not having Perl in a runtime did slow me down quite a bit in the beginning ( actually it slowed me down by about a year ) - mainly due to issues I encountered building Perl in the container or whatever it is that forces a read-only filesystem on us. Once I was pointed at some existing flatpak-builder examples that had Perl, I was on my way and honestly I don't care too much now.
>
> If there is sufficient interest in having Perl in a runtime, maybe the approach would be to fork one of the runtimes and add Perl + goodies to it. I'm not sure how much work would be involved in maintaining such a thing.

There is a constant balance of adding things to the runtime or not.
Adding things adds both cost for every user having to download, as
well as maintainance costs of the runtime. It also doesn't always
help. Just because some version of perl is in the runtime doesn't mean
its the version your app needs. Fundamentally, flatpak is a bundling
system. Yes, we do avoid *some* bundling by having runtimes, but
runtimes can never contain *everything* your app needs. I realize this
is different than how it works in distro packaging, and it has a cost,
but it also has its advantages. For example you get to pick exactly
what perl version to use and how it is built.

For the specific case of perl in the runtime, we *do* ship a copy of
perl in the Sdk, because many apps need perl to build. However,
relatively few desktop applications use itl, so it is not in the
Platform. If more apps use perl we should maybe add some snippets to
https://github.com/flathub/shared-modules to make it easier to include
into apps.


More information about the Flatpak mailing list