OSInside / kiwi

KIWI - Appliance Builder Next Generation
https://osinside.github.io/kiwi
GNU General Public License v3.0
300 stars 152 forks source link

Add support for building flatpaks #2267

Open dcermak opened 1 year ago

dcermak commented 1 year ago

Problem description

Currently we lack a good way how to build flatpaks on OBS, we can only build them from sources using flatpak-builder directly. This unfortunately negates most of the advantages that OBS has, most importantly automated rebuilds and linking of sources.

While we could extend obs-build itself to build flatpaks from rpms, it does imho make much more sense to implement this feature in kiwi directly. First, OBS is already aware of kiwi and can handle it pretty well. Second, kiwi is quite mature and extensible and provides all the necessary inputs required to build flatpaks: input sources and (potentially multiple) post build steps. And at last, flatpaks can be afaik assembled from OCI images, which kiwi already supports.

This would be also interesting for Fedora's flatpak SIG, as they are currently relying on modularity & MBS to build flatpaks. Unfortunately it looks like MBS is dying and a new approach would be necessary. Kiwi could be a viable option here, as it is supported on koji as well.

cgrobertson commented 5 months ago

@dcermak, Please clarify what you mean by "...we can only build them from sources using flatpak-builder directly." In my FirefoxESR flatpak I'm building from the Firefox (and supporting) RPMs we built for SLE and not directly from Firefox sources. Also, when I update the RPMs in my flatpak package and check in to OBS it kicks off a rebuild so I'm not sure what you mean by "...negates advantages ... automated rebuilds..." Or, maybe you are referring to my comment on slack channel #help-obs where I mentioned that building using "obs build..." command-line fails?

dcermak commented 5 months ago

I assume that you are referring to this package: https://build.opensuse.org/package/show/home:cgrobertson:branches:OBS:Flatpak:Templates/MozillaFirefoxESR-flatpak?

Yes, you are building firefox from rpms, but you have to pre-fetch these rpms yourself. So every time there is an update or a rebuild of firefox, you'll have to manually redownload the rpms, upload them to OBS and rebuild the flatpak.

A better solution would be to define the dependencies in a separate file, have OBS resolve them for you and provide them in the build environment.