Bug#1079735: libglib2.0-0t64: "Exec format error" in foreign-arch installation

Daniel Richard G. skunk at iSKUNK.ORG
Tue Aug 27 20:01:03 BST 2024


On Tue, 2024 Aug 27 05:10-04:00, Simon McVittie wrote:
>
>> The postinst script should check that the package is being installed
>> on a compatible architecture before running these (binary) programs.
>
> How? We cannot know whether running a foreign-architecture executable
> is possible on the current architecture (perhaps natively, perhaps via
> qemu-user-binfmt or box86 or similar) other than by trying it.

If running the actual binary is the only viable way of checking
whether or not it is usable, then do so explicitly with a trivial
invocation, e.g.

    if ! /usr/lib/x86_64-linux-gnu/glib-2.0/glib-compile-schemas --version >/dev/null 2>&1
    then
      # System architecture is probably incompatible
      echo 'Cannot run glib-compile-schemas, skipping update'
      exit 0
    fi

(Even better would be to detect the package_arch != system_arch
condition and print out a more specific error message, but I don't know
the right way of getting that info in a postinst script.)

That at least avoids showing an error message to the user that is, to
all appearances, not anticipated/handled by the package installation.



More information about the pkg-gnome-maintainers mailing list