AppImageCrafters / appimage-builder

GNU/Linux packaging solution using the AppImage format
MIT License
298 stars 55 forks source link

How to run gdk-pixbuf-query-loaders --update-cache #331

Open caclark opened 8 months ago

caclark commented 8 months ago

This may be associated with #277

I am creating an AppImage via Actions on GitHub. Part of the project creates a new pixbuf loader. After the AppDir is created, the new pixbuf loader is copied to /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/ and then sudo /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders --update-cache is run.

The created loaders.cache file is correct.

When the AppImage is created I can see from the extracted AppImage that ..../squashfs-root/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache does not include the new pixbuf loader.

I see that if I run gdk-pixbuf-query-loaders during the process, the header shows Created by gdk-pixbuf-query-loaders from gdk-pixbuf-2.42.8. The final loaders.cache file contains Created by gdk-pixbuf-query-loaders from gdk-pixbuf-2.40.0

The log file shows: INFO:root:GDK loaders cache modules dir: /github/workspace/AppDir/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache WARNING:root:gdk-pixbuf-query-loaders cannot generate cache from modules of a different version or architecture. Therefore it will be ran using thesystem modules and the output will be *adapted* to the AppDir. INFO:root:GDK loaders cache wrote to: /github/workspace/AppDir/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache

Does anyone have an idea what I have missed?

caclark commented 8 months ago

A work-around is to call a script from after-runtime The script appends the required text for the new pixbuf loader to the end of the just-created loaders.cache.

This is not too good because the text to be included as to be created and stored in the script file.

But it seems to work....

goldstar611 commented 4 months ago

Yep, it's not ideal but in reality there's no way to know what pixbuf loaders will be available when the AppImage is created. Best AppImage Builder can do is "adapt" what is has and change some paths. This is especially hard when, for example, the host is missing libpng or libtiff but the app needs that :/