Package: gir1.2-ayatanacommon-0.1
Version: 0.9.12-1
Severity: grave
Tags: upstream
Justification: renders package unusable
A smoke-test similar to this one should work for every package
containing "public" typelibs:
$ podman run --rm -it debian:sid-slim
# apt update
# apt upgrade
# apt install python3-gi gir1.2-ayatanacommon-0.1
# python3
>>> import gi
>>> gi.require_version('ayatanacommon', '0.1')
>>> from gi.repository import ayatanacommon
>>> assert ayatanacommon.utils_is_gnome() in (True, False)
But for gir1.2-ayatanacommon-0.1, it currently fails:
>>> gi.require_version('ayatanacommon', '0.1')
Traceback (most recent call last):
File "<python-input-2>", line 1, in <module>
gi.require_version('ayatanacommon', '0.1')
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/gi/__init__.py", line 150, in
require_version
raise ValueError(f"Namespace {namespace} not available")
ValueError: Namespace ayatanacommon not available
because the typelib is installed to a directory that is not searched by
GObject-Introspection: /usr/lib/x86_64-linux-gnu/girepository-1.2/
instead of the correct /usr/lib/x86_64-linux-gnu/girepository-1.0/.
Similarly the -dev package installs the GIR XML into /usr/share/gir-1.2/
instead of the correct /usr/share/gir-1.0/. I know the XML says
"<repository version="1.2"..." but the correct directory names still
have 1.0 in them, as documented in
file:///usr/share/doc/gobject-introspection/policy.txt.gz:
> Note that the format is specified in the .gir file
> itself and may not match the /usr/lib/*/girepository-1.0 and
> /usr/share/gir-1.0 paths.
This appears to have been an intentional upstream change:
> * debian/:
> + Upstream installs gir1.2 files now to gir-1.2 directory.
which surprises me, because I don't see how this change can have worked
successfully. How was it tested?
It is often a good idea for packages with GObject-Introspection to have
a superficial autopkgtest similar to
<https://salsa.debian.org/gnome-team/libadwaita/-/blob/debian/latest/debian/tests/python-gi-test?ref_type=heads>
to confirm that the intended typelib API can be loaded successfully.
Thanks,
smcv