Hi,
So I’ve noticed there is some controversy going on regarding SDK extensions or it would seem so anyway. I recently opened a PR to add SDK extensions for the Qt framework, personally I think it would be very useful to have Qt available in SDK extensions, however the common consensus so far seems to indicate that the flatpak/flathub community seems to disagree and prefers the KDE SDK in combination with Base apps.
I’ve also noticed that the SDK and Base apps unfortunately in certain cases do not suffice. I guess that methodology is not the most flexible and comes with a set of challenges, for example when a package needs Qt WebEngine (for which a Base app exists) but also needs the python bindings (for which another Base app exists).
Another example is when a package requires other Qt modules that are for whatever reason not available in the KDE SDK, in this case the flatpak docs state that it would be better to bundle the modules with the package manually instead of using the KDE SDK (Qt — Flatpak documentation). However that will produce long build times and just adding the modules in the app package and still using the SDK makes it harder to keep the exact versions of the modules in sync (when you want to use the external data checker in your app package there is no guarantee that the SDK is already updated and uses the same minor/micro version).
So if we want to save (build) time and not build the same things over and over again (and maintain building those parts as well) for different apps we can use a Base app if we’re lucky enough to be in such a situation where we just require one, otherwise it doesn’t work for some part of it (in the case where we require multiple dependencies like that).
To me it seems very similar to a polymorphism paradigm that we come across in Object Oriented Programming, especially in languages that do not support multiple-inheritance. As that is exactly what we’re facing here. We can only inherit from 1 source.
Now in software development we often solve this issue by using the composition over inheritance principle, which works quite nicely there, however in the case of flatpak we end up with losing out on disk space as we’d be copying things out of SDK extensions into our packages (although if we build/include it as modules it would be similar). It does provide much more flexibility that way though. As even the Base Apps and SDK’s could be composed using SDK extensions.
It’s also common practice when building containers with Docker for example using COPY --from=...
It would be great if there was some nice way to inherit (parts of) SDK extensions, but it seems we can only inherit the extension points and not so much the actual content of an extension or define a dependency on an SDK extension (for an app package, to have it available in a runtime), so we can only copy things from it at this point in time.
I would like to propose for flathub to provide some sort of policy or guidelines when it comes to this, as what is currently happening seems messy and doesn’t always provide an adequate solution.
What are your thoughts on this?