Package: pybuild-plugin-autopkgtest
Version: 6.20240824
Severity: normal
X-Debbugs-Cc: d...@debian.org, gin...@debian.org, hel...@subdivi.de

Ubuntu's autopkgtests for i386 run in a cross environment, with many
amd64 packages installed.

pybuild-plugin-autopkgtest exports some environment variables to assist
with cross building (#892931), but these break the cross autopkgtests.

e.g. 
https://autopkgtest.ubuntu.com/results/autopkgtest-oracular/oracular/i386/n/nxmx/20240914_133446_33f49@/log.gz

All the supporting packages are installed from amd64, not i386, not a single 
i386 package is mentioned in the autopkgtest log.

But:

 78s ==================================== ERRORS 
====================================
 78s _____________________ ERROR collecting tests/test_nxmx.py 
______________________
 78s ImportError while importing test module 
'/tmp/autopkgtest.O1QJkE/autopkgtest_tmp/build/tests/test_nxmx.py'.
 78s Hint: make sure your test modules/packages have valid Python names.
 78s Traceback:
 78s /usr/lib/python3.12/importlib/__init__.py:90: in import_module
 78s     return _bootstrap._gcd_import(name[level:], package, level)
 78s tests/test_nxmx.py:11: in <module>
 78s     import nxmx
 78s /usr/lib/python3/dist-packages/nxmx/__init__.py:15: in <module>
 78s     from scipy.spatial.transform import Rotation
 78s /usr/lib/python3/dist-packages/scipy/__init__.py:67: in <module>
 78s     from scipy._lib import _pep440
 78s /usr/lib/python3/dist-packages/scipy/_lib/__init__.py:12: in <module>
 78s     from scipy._lib._testutils import PytestTester
 78s /usr/lib/python3/dist-packages/scipy/_lib/_testutils.py:22: in <module>
 78s     _v = sysconfig.get_config_var('HOST_GNU_TYPE') or ''
 78s /usr/lib/python3.12/sysconfig.py:782: in get_config_var
 78s     return get_config_vars().get(name)
 78s /usr/lib/python3.12/sysconfig.py:765: in get_config_vars
 78s     _init_config_vars()
 78s /usr/lib/python3.12/sysconfig.py:706: in _init_config_vars
 78s     _init_posix(_CONFIG_VARS)
 78s /usr/lib/python3.12/sysconfig.py:572: in _init_posix
 78s     _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
 78s E   ModuleNotFoundError: No module named '_sysconfigdata__i386-linux-gnu'
 78s =========================== short test summary info 
============================
 78s ERROR tests/test_nxmx.py
 78s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection 
!!!!!!!!!!!!!!!!!!!!
 78s =============================== 1 error in 0.26s 
===============================

Presumably because environment variables were set for cross-compilation,
triggering this code:

https://salsa.debian.org/python-team/tools/dh-python/-/blob/b71d65b7b0b510bb6f90e2d3e98e35229b6c7c50/pybuild#L73-91

My assumption is that entire block should be skipped if we're running with
--autopkgtest. But I am not at all familiar with this cross autopkgtest 
environment.

Stefano

Reply via email to