Skip to content

gio: Optionally install trigger executables to architecture-specific paths

Simon McVittie requested to merge wip/smcv/multiarch-triggers into main

In Debian-style multiarch (libdir = lib/x86_64-linux-gnu or similar), Red-Hat-style multilib (libdir = lib64 or lib) and Arch-style multilib (libdir = lib or lib32), we have to run a separate version of gio-querymodules to discover 32- or 64-bit modules on x86. Installing modules in the directory used for each word size needs to trigger recompilation of the correct modules list.

Debian, Fedora and Arch currently all have patches to facilitate this: Debian moves gio-querymodules into ${libdir}/glib-2.0 and provides a compat symlink in ${bindir}, while Fedora and Arch rename one or both of the gio-querymodules executables to give it a -32 or -64 suffix.

We can avoid the need for these patches by making this a build option. Doing this upstream has the advantage that the pkg-config metadata for each architecture points to the correct executable and is in sync with reality.

I'm using Debian's installation scheme with a separate directory here, because the word-size suffix used in Fedora and Arch only works for the common case of 32- and 64-bit multilib, and does not cover scenarios where there can be more than one ABI with the same word size, such as multiarch cross-compilation or alternative ABIs like x32.

Now that we have this infrastructure, it's also convenient to use it for glib-compile-schemas. This works with /usr/share, so it only needs to be run for one architecture (typically the system's primary architecture), but using /usr/bin/glib-compile-schemas for the trigger would result in either primary and secondary architectures trying to overwrite each other's /usr/bin/glib-compile-schemas binaries, or a circular dependency (the GLib library would have to depend on a common package that contains glib-compile-schemas, but glib-compile-schemas depends on the GLib library). Installing a glib-compile-schemas binary in an architecture-specific location alongside each GLib library bypasses this problem.

Signed-off-by: Simon McVittie smcv@collabora.com

Edited by Simon McVittie

Merge request reports