#1105149 g-ir-scanner cross wrapper does not interact well with cross building Python extensions #1105149
- Package:
- gobject-introspection
- Source:
- gobject-introspection
- Description:
- Generate interface introspection data for GObject libraries
- Submitter:
- Helmut Grohne
- Date:
- 2025-09-18 19:21:02 UTC
- Severity:
- normal
- Tags:
I observed that zbar was not using qemu during g-ir-scanner and looked
into it. It turns out that I was patching it to export
_PYTHON_SYSCONFIGDATA_NAME as it would build a Python extension module.
That variable leaked into the part of the build where it runs
g-ir-scanner. It ended up calling the cross wrapper. Unfortunately,
there is a short cut "if sysconfig.get_config_var('MULTIARCH') ==
DEB_HOST_MULTIARCH". The left hand gets influenced by setting
_PYTHON_SYSCONFIGDATA_NAME and therefore the short cut is taken
disabling qemu.
Can we change this short cut to avoid this trap? Any suggestions for
how?
Thanks for considering
Helmut
And what was the result? Failing to run the scanner because it was a
host-architecture executable and you don't have transparent qemu
emulation of the host architecture on the build architecture?
I was hoping that sysconfig.get_config_var('MULTIARCH') would return the
hard-coded architecture of the running Python interpreter, which would
have meant that this shortcut was correct. But if your override for
cross-building makes sysconfig describe the host architecture rather
than the build architecture, then yes this is wrong.
Is there anything - perhaps in sys or platform rather than sysconfig -
that would tell us, specifically, the architecture of the running Python
interpreter? Unfortunately I don't see anything immediately useful in
the documentation of those modules.
The sysconfig API documentation says "The sysconfig module provides
access to Python’s configuration information like the list of
installation paths and the configuration variables relevant for the
current platform" which unfortunately doesn't really help us to decide
whether it refers to the host or build platform: either one of those
could reasonably be described as "current".
I think g-ir-scanner is probably slow enough that an exec of the CAN_RUN
helper before we run the actual scanner is not a significant slowdown,
so I think dropping this shortcut would probably be OK. Please could you
propose a tested merge request or patch?
Are you targeting this for a trixie freeze exception, or for forky?
smcv
Hi Simon, thanks for your quick followup. You correctly completed what I left implicit. The sysconfig module is extensively used while cross building Python extension modules. Therefore, it describes the host architecture in common build scenarios indeed. I concur. In an interpreter with _PYTHON_SYSCONFIGDATA_NAME set, both sys and platform describe the build architecture, but the interfaces they provide are not exactly useful in telling the build architecture. The Python interpreter startup we incur via cross-g-ir-tool should be larger than CAN_RUN already. I concur that dropping the short-cut should fix the issue at hand. I've copied d-cross@l.d.o to acquire some more ideas before moving forward with that approach. The proposed change bears a bit of risk as it may influence native builds. It also affects a small minority of packages. I suggest deferring this to forky. Helmut
Hello, Bug #1105149 in gobject-introspection reported by you has been fixed in the Git repository and is awaiting an upload. You can see the commit message below and you can check the diff of the fix at: https://salsa.debian.org/gnome-team/gobject-introspection/-/commit/cedb1da00b5962077d377e704b5db2eafd27e33a ------------------------------------------------------------------------ d/cross-g-ir-tool.in: Don't rely on sysconfig During cross-compilation of some packages it is necessary to set the environment variable _PYTHON_SYSCONFIGDATA_NAME, which alters sysconfig to describe the host rather than build architecture, meaning that it no longer has facts about the current interpreter. Closes: #1105149 ------------------------------------------------------------------------ (this message was generated automatically) -- Greetings https://bugs.debian.org/1105149
Now that forky development has started, I've queued up that change.
I checked the equivalent cross wrappers in src:glib2.0, but they are so
much simpler that they already did not have an equivalent bug.
smcv
We believe that the bug you reported is fixed in the latest version of
gobject-introspection, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 1105149@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Jeremy Bícha <jbicha@ubuntu.com> (supplier of updated gobject-introspection package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Sat, 13 Sep 2025 08:39:09 -0400
Source: gobject-introspection
Built-For-Profiles: noudeb
Architecture: source
Version: 1.86.0-1
Distribution: experimental
Urgency: medium
Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>
Changed-By: Jeremy Bícha <jbicha@ubuntu.com>
Closes: 1105149
Changes:
gobject-introspection (1.86.0-1) experimental; urgency=medium
.
[ Jeremy Bícha ]
* New upstream release
.
[ Simon McVittie ]
* d/cross-g-ir-tool.in: Don't rely on sysconfig.
During cross-compilation of some packages it is necessary to set
the environment variable _PYTHON_SYSCONFIGDATA_NAME, which alters
sysconfig to describe the host rather than build architecture,
meaning that it no longer has facts about the current interpreter.
(Closes: #1105149)
* Improve documentation in README.Debian:
- Simplify recommended gobject-introspection dependency to 1.80.
The previous recommendation was new in Debian 13 and Ubuntu 24.04,
but 1.80 is available in both of those releases too, so we can
recommend something shorter and easier to remember without losing
portability.
- Suggest a less intrusive workaround for #1060838/#1111001
- #1060907 in haskell-haskell-gi was fixed
Checksums-Sha1:
6df7d8979b5be1a1bbb62fcdce12326100605843 4073 gobject-introspection_1.86.0-1.dsc
a86f8979d6e2cba0ff9122a6f699025b2d81bab6 5475296 gobject-introspection_1.86.0.orig-glib.tar.xz
06f2c7c511f6ae476971106d9456f73a6121ff11 1083172 gobject-introspection_1.86.0.orig.tar.xz
274953c965573b075665f0f88d9f8f5675c4f93a 59112 gobject-introspection_1.86.0-1.debian.tar.xz
df1046e64ea3248afc044af99961e9d479d77b3e 11424 gobject-introspection_1.86.0-1_source.buildinfo
Checksums-Sha256:
680222b2e92de123bb19e55e6c3011d116626360b16e9dc163f2cc061756cb71 4073 gobject-introspection_1.86.0-1.dsc
b3764dd6e29b664085921dd4dd6ba2430fc19760ab6857ecfa3ebd4e8c1d114c 5475296 gobject-introspection_1.86.0.orig-glib.tar.xz
920d1a3fcedeadc32acff95c2e203b319039dd4b4a08dd1a2dfd283d19c0b9ae 1083172 gobject-introspection_1.86.0.orig.tar.xz
9bd42a744aea57b68fe73e3b454acd365506b08ba01a31c8f7f1a70090f9a560 59112 gobject-introspection_1.86.0-1.debian.tar.xz
83ffc3f3e0f6eb8a08a5ec302dd5a53e6879303a74c51b2033d53cdf381328a9 11424 gobject-introspection_1.86.0-1_source.buildinfo
Files:
abee2b1fdfe01d4bbb5ee4f6cd37a859 4073 devel optional gobject-introspection_1.86.0-1.dsc
9df2169686c0b7f891067017002ad111 5475296 devel optional gobject-introspection_1.86.0.orig-glib.tar.xz
fa0f2ae76868bf35ff725f940d75ec16 1083172 devel optional gobject-introspection_1.86.0.orig.tar.xz
91a28e1cd1a70a4f8146f7bafccacc2c 59112 devel optional gobject-introspection_1.86.0-1.debian.tar.xz
7b0714f3a0a0cc6e0e3814bf51b1bbf4 11424 devel optional gobject-introspection_1.86.0-1_source.buildinfo
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEETQvhLw5HdtiqzpaW5mx3Wuv+bH0FAmjFZiYACgkQ5mx3Wuv+
bH3K/Q//SLYzE9PORXCy7m3/kr4ze/m4Y4J0EhrHEEc5yBoXiEvawhy1gF39xnFc
SIVIZ5ecHQ4zolLItYq0gvNuLXKw6tVskrbiQHNOMOlbf0mm8jSrN8pgSAsmPVXt
NFcxn4ZnESKWXEtViwDBPsnONDM2CKjbI8Vzby5inBpQTyHaXormRpnSgTm39Jk0
xAIibxK1dVbxqV02sYmla/6DWnuvhtyu0aLgQvBx2c7Ok1gAOFxPeXmfNYVkPSaJ
kfaTvHAm52msM5b6PC85lln/KMgKsw+dpuylL256QoCB5WNu/pFUA74u7nmeLXEr
vTju08yX/OW1G759J6Ie7I9CMt8uzC02BR44Sz7iYf+1B/a3kmyPsl5PdarYXJ/v
KQCJDkFkzBlR6PyPRrE+G3u28IJHGQNu3yCYpJOn5ZGP7VUNXH5OIrrGfUgwyeg1
t+E7Im0U2fdb9FuuFSo9j6+q5GgLMXmbeBIk15otrLC+XD/kxHjAbvR53Ao3ppCH
SPJogDtruWDtvlAmybV+n3qhL8iPgM2nc1k2odcDG7A98FCTmtR5tQ98Iw9SoTaM
PDh5Axg7rdX33hSGfKHUOAQy8TwaxiexkvH5n3oZr6Kzww7CT3A0UtqdFAJucP6W
bXhuY5qo1XswjbKssV0slM+Z80k0ntamf9YizFh+Lo1bVgY1aeY=
=s6Zw
-----END PGP SIGNATURE-----
We believe that the bug you reported is fixed in the latest version of
gobject-introspection, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 1105149@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Jeremy Bícha <jbicha@ubuntu.com> (supplier of updated gobject-introspection package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Thu, 18 Sep 2025 14:55:11 -0400
Source: gobject-introspection
Built-For-Profiles: noudeb
Architecture: source
Version: 1.86.0-2
Distribution: unstable
Urgency: medium
Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>
Changed-By: Jeremy Bícha <jbicha@ubuntu.com>
Closes: 1105149
Changes:
gobject-introspection (1.86.0-2) unstable; urgency=medium
.
* Release to unstable
.
gobject-introspection (1.86.0-1) experimental; urgency=medium
.
[ Jeremy Bícha ]
* New upstream release
.
[ Simon McVittie ]
* d/cross-g-ir-tool.in: Don't rely on sysconfig.
During cross-compilation of some packages it is necessary to set
the environment variable _PYTHON_SYSCONFIGDATA_NAME, which alters
sysconfig to describe the host rather than build architecture,
meaning that it no longer has facts about the current interpreter.
(Closes: #1105149)
* Improve documentation in README.Debian:
- Simplify recommended gobject-introspection dependency to 1.80.
The previous recommendation was new in Debian 13 and Ubuntu 24.04,
but 1.80 is available in both of those releases too, so we can
recommend something shorter and easier to remember without losing
portability.
- Suggest a less intrusive workaround for #1060838/#1111001
- #1060907 in haskell-haskell-gi was fixed
Checksums-Sha1:
cddac96d8c54aafb5e0970f3c688d63ea5b83929 4073 gobject-introspection_1.86.0-2.dsc
72fe5723e73ae8154207edca77951a47244c1994 59124 gobject-introspection_1.86.0-2.debian.tar.xz
cffd62ba92f151e2dd4edffba6370020b00f0670 11473 gobject-introspection_1.86.0-2_source.buildinfo
Checksums-Sha256:
1854bfdafecaa81eb232e1e2895dc3dc218c69aadbcb68dae6521a0154237ac9 4073 gobject-introspection_1.86.0-2.dsc
1cc77c19e2eb5fc044703ceec0f426ed54f40c1985db5a7141cbdcb538f8eeb6 59124 gobject-introspection_1.86.0-2.debian.tar.xz
6a4709ea091d8671a726dfe91e1ea8d6e9e21bed583a025359f0355e8dc77476 11473 gobject-introspection_1.86.0-2_source.buildinfo
Files:
6a0711f1123c78e492b6f1d3acf81dea 4073 devel optional gobject-introspection_1.86.0-2.dsc
f0e563553089044a8920e798460d4c67 59124 devel optional gobject-introspection_1.86.0-2.debian.tar.xz
fcf9d28312f2d95b2b5e260da71ce360 11473 devel optional gobject-introspection_1.86.0-2_source.buildinfo
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEETQvhLw5HdtiqzpaW5mx3Wuv+bH0FAmjMVf8ACgkQ5mx3Wuv+
bH3wLw/+O4oreriVOyzHPvyHnWEQfN4M/kTxhtsLExX/Q6dSBhyjGnr1IamtTSXy
qplPbUsdWrSbDy0VBR1rdxVKkcAMBcvh5Bf/EA7r4FsLc4Zs/KfKEwcI/pLU4oPj
KfZ9m/4E2LobFPf/EZFXyqSRM+MJuOAKLlEaFf+d2PbWOJJNL+owrj/ZxhzqIdTu
739AwGwi0V3HStiTwQb1t0hlj3q4NK19bz86eZVCJ/Livr1JqhSbMlVtu01udInm
4M/9kRobC3ywl2rOjJk/DcXQrUnwNHGf0tMnQ5ddqMeVyc7LsPV9HO0/gI7pLeq3
Z5g7mpGLeF5UUUXgKYCHuu+paaVn6REt5yajyXcnmt3grgR/bssLhMwiAoYyVmum
Dm7WimTJ0lkQvKY0+7f0XR1TWJscO/XqTe7S0zoqEPvcj4DRsyPxx0Jcaeh++lOh
HUYlwlRl8cT7g+rftf49/kwpuaS1lCc4xkrbOeCZc8pCWGWGACdhYj9M6Defn012
j6tL/kCIzEPd6OsR6HvUtxCk6ceR4BiQv2033RX47VumtxYlC+tVy+U3vlXQbiKD
J8Gz7qt2uK+uHW8OM3fE5AVpFVTIeSyHw3LvyTJsqVuiT3mW0A4xn4YDsCqXC6JS
kVe5LNKjnfdej4Pkx6y+L6m234QXV5cSt4CLlyB57OYuN9SEHeA=
=5pU8
-----END PGP SIGNATURE-----