Problem building GIMP master flatpak version

I have a fix for a problem that only affects the flatpak version of GIMP. I have tested the code using the ‘normal’ build and simulating a flatpak environment (export container=“flatpak”) and it works but I really would like to test it with a flatpak build before submitting an MR

I created ~/gimp_prefix and set GIMP_PREFIX to this folder. I then created ~/GIMP_flatpak and cloned GIMP into this folder (using HTTPS (on the PC where I build GIMP ‘normally’ I use SSH but I don’t have this setup on the laptop where I’m trying to build the flatpak version - I don’t suppose that this is the problem though)). I then ran ~/GIMP_flatpak/gimp/build/linux/flatpak/1_build-deps-flatpak.sh - this seemed to be successful and created files in ~/gimp_prefix.

Running ~/GIMP_flatpak/gimp/build/linux/flatpak/2_build-gimp-flatpak.sh failed when it started building gimp-data (which it had automatically downloaded) as follows:

richard@Pavilion-Notebook:~/GIMP_flatpak/gimp/_build$ flatpak-builder --run --ccache “$GIMP_PREFIX” /home/richard/GIMP_flatpak/gimp/build/linux/flatpak/org.gimp.GIMP-nightly.json ninja
[59/2623] Generating gimp-data/cursors/gimp-tool-cursors_c with a custom command
FAILED: gimp-data/cursors/gimp-tool-cursors.c
/usr/bin/glib-compile-resources gimp-data/cursors/gimp-tool-cursors.gresource.xml --sourcedir …/gimp-data/cursors --c-name gimp_tool_cursors --internal --generate --target gimp-data/cursors/gimp-tool-cursors.c --dependency-file gimp-data/cursors/gimp-tool-cursors.c.d

(gdk-pixbuf-pixdata:369): GLib-GObject-CRITICAL **: 17:07:45.204: g_object_ref: assertion ‘G_IS_OBJECT (object)’ failed

(gdk-pixbuf-pixdata:369): glycin-CRITICAL **: 17:07:45.210: A loader needs to be initiatilized with exatly one of ‘file’, ‘stream’, or ‘bytes’.

(gdk-pixbuf-pixdata:369): GLib-GObject-CRITICAL **: 17:07:45.213: g_object_unref: assertion ‘G_IS_OBJECT (object)’ failed
failed to load “…/gimp-data/cursors/cursor-bad.png”: Failed to load image ?../gimp-data/cursors/cursor-bad.png?: A loader can only be used once
gimp-data/cursors/gimp-tool-cursors.gresource.xml: Child process exited with code 1.
[64/2623] Linking target libgimpcolor/libgimpcolor-3.0.so.0.100.3
ninja: build stopped: subcommand failed.
richard@Pavilion-Notebook:~/GIMP_flatpak/gimp/_build$

I have also tried starting with a fresh ~/GIMP_flatpak folder, cloning GIMP and gimp-data in to it. Then in a terminal window in gimp running the command:

flatpak-builder --run --ccache “$GIMP_PREFIX” build/linux/flatpak/org.gimp.GIMP-nightly.json meson setup _build --buildtype=release -Db_lto=true -Dprefix=/app/ -Dlibdir=/app/lib/

this seems to work correctly.

then:

cd _build
flatpak-builder --run --ccache “$GIMP_PREFIX” /home/richard/GIMP_flatpak/gimp/build/linux/flatpak/org.gimp.GIMP-nightly.json ninja

this fails in the same way as noted above.

Does anyone have any idea what I am doing wrong?

These logs are tough to read without the ``` before and after them. I will try a local build in the described conditions to diagnose this.

I think there were recent updates to pixbuf that now include glycin, but that seems to be only in development releases 2.43.2 and up. Since glycin is mentioned in one of the errors, I would look for possible needed API changes, or using an older pixbuf version.

Thanks - seem to be using older versions of gdk-pixbuf. I’ll try updating.

seem to be using older versions of gdk-pixbuf

Very unlikely. The deps script auto updates GNOME SDK and GNOME Platform.

I also see a lot of Glycin warnings in my tests adn they happen because we are not truly running in flatpak sandboxed environment when using these commands directly.

As a workaround, you can use the --ci param when calling such scripts: GIMP Developer - Building GIMP for Linux

Thanks Bruno I hadn’t noticed the --ci options - I can now build and run the flatpak version and continue testing.