Package: dh-python Version: 3.20180607 Severity: normal Hi. Currently we can cross-build python3 extension modules, but not python2. I just worked on this a bit, and have a functional prototype we can talk about.
The test project that builds an Arch:any python extension: https://salsa.debian.org/dkogan/pymodule_test Fork of dh-python with a few extra commits to make python2 cross-building work: https://salsa.debian.org/dkogan/dh-python If I build and install that dh-python, I'm able to cross-build that extension module thusly: dpkg-buildpackage -us -uc -b -aarmhf Conceptually the patches do the same thing the python3 support does, but I didn't need any upstream support. For some reason python has separate sysconfig and distutils.sysconfig modules that are independent, but look VERY similar. In particular they both have global config dicts: sysconfig._CONFIG_VARS distutils.sysconfig._config_vars These both have stuff like compiler commands, library paths, etc in them. Ultimately both come from _sysconfigdata.build_time_vars The _sysconfigdata module lives in /usr/lib/python2.7/_sysconfigdata.py But it just reads /usr/lib/python2.7/plat-${DEB_HOST_GNU_TYPE}/_sysconfigdata_nd.py So for cross-building all I needed to do was to prepend /usr/lib/python2.7/plat-${DEB_HOST_GNU_TYPE} to the path, which is what that pybuild tree does. This may easily be incomplete, but is sufficient to cross-build that hello-world package. I can't find any non-toy packages that are good test cases: all have some other issue that makes things break. -- System Information: Debian Release: buster/sid APT prefers unstable APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental') Architecture: amd64 (x86_64) Foreign Architectures: armhf Kernel: Linux 4.15.0-1-amd64 (SMP w/2 CPU cores) Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C), LANGUAGE=C (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled Versions of packages dh-python depends on: ii python3 3.6.5-3 Versions of packages dh-python recommends: ii python3-distutils 3.6.6~rc1-3 Versions of packages dh-python suggests: ii dpkg-dev 1.19.0.5 ii libdpkg-perl 1.19.0.5 -- no debconf information