Building Flatpak KDE Runtime

Hello,

I was trying to build the Flatpak KDE Runtime in order to test a small change, but unfortunately it does not seem to work. This is probably more of a general flatpak question so I hope the question is still welcome around here :slight_smile:

After cloning the repository (Packaging / Flatpak KDE Runtime · GitLab) and the desired branch (qt5.15lts-23.08) I made my change inside the .json.in file and try to build it using the provided Makefile. After that, it starts building and seems to succeed in building all the modules (yay!).

However, the cleanup step fails (while executing freedesktop-post.sh):

Cleaning up
Warning: Schema “org.gnome.system.locale” has path “/system/locale/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.proxy” has path “/system/proxy/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.proxy.http” has path “/system/proxy/http/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.proxy.https” has path “/system/proxy/https/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.proxy.ftp” has path “/system/proxy/ftp/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.proxy.socks” has path “/system/proxy/socks/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Fontconfig error: Cannot load config file "/run/host/font-dirs.xml": No such file: /run/host/font-dirs.xml
chmod: changing permissions of '/etc/pki/ca-trust/extracted/README': Read-only file system
chmod: changing permissions of '/etc/pki/ca-trust/extracted/edk2/README': Read-only file system
chmod: changing permissions of '/etc/pki/ca-trust/extracted/java/README': Read-only file system
chmod: changing permissions of '/etc/pki/ca-trust/extracted/openssl/README': Read-only file system
chmod: changing permissions of '/etc/pki/ca-trust/extracted/pem/README': Read-only file system
Error: Der Kindprozess wurde mit Status 1 beendet
make: *** [Makefile:23: org.kde.Sdk.app] Fehler 1
rm org.kde.Sdk.json
make  8,66s user 14,84s system 22% cpu 1:43,65 total

While I’m still new to building flatpaks, this seems to make sense to me as /etc/* shouldn’t be writable (?). When inspecting the script, the corresponding line (chmod -R ... /etc/pki/ca-trust/extracted) is referenced to come from freedesktop’s ca-certificates.bst (elements/components/ca-certificates.bst · release/23.08 · freedesktop-sdk / freedesktop-sdk · GitLab). I assume that this part was written by people a lot more knowledgeable than me and that it should indeed work :slight_smile:

So there’s obviously something I’m missing here and I have some hope that maybe someone could help me out. Thanks a lot!

Are you building from inside a container? You might need to pass --disable-rofiles-fuse to flatpak-builder: Makefile: Disable rofiles-fuse when run in a container (e19fc74f) · Commits · Packaging / Flatpak KDE Runtime · GitLab

Try deleting the .flatpak-builder in the repo and try again

Hello everyone and thanks for your help!

I did try to build it on my Arch Linux host with the current flatpak-builder package from the repos (1.4.2-1), no containers involved. However, --disable-rofiles-fuse did the trick!

When I have a lot of time on my hands again to do a full rebuild I will also check if deleting .flatpak-builder helps. Maybe also on a second machine using Fedora to see if this is reproducible on another setup.

Thanks again!

Today I tried to do another build on on another system using Fedora Kinoite 40 using flatpak-builder from org.flatpak.Builder, which gives the same result. Does a flatpak run environment count as containerized :wink: ? It certainly doesn’t exhibit a /run/.containerenv file.

I think I’ll try to come up with a more minimal example and see if this works in a VM using “bare-metal” flatpak-builder. My guess is that this will not work either. Is anybody a bit more knowledgeable about flatpak internals willing to support me a bit with debugging this in order to write a useful bug report?