Bug#973854: debian/patches/i386_loosen_test_tolerances.patch not Multi-Arch safe

Rebecca N. Palmer rebecca_palmer at zoho.com
Fri Nov 6 08:35:02 GMT 2020


Control: severity -1 minor
Control: retitle -1 imperfect/non-upstreamable architecture detection

The sys.maxsize check should catch amd64 vs i386; the directory check is 
mostly to catch other-32-bit vs i386.  All this patch does is allow more 
rounding error in some tests (because i386 registers and memory are 
different precisions), so a wrong detection should be mostly harmless.

sysconfig.get_platform() / platform.uname() aren't chroot-safe, which 
for a tests-only patch in Debian infrastructure, is probably a worse 
problem:

(i386 chroot on amd64)
 >>> import sys;import sysconfig;import platform
 >>> sys.maxsize
2147483647
 >>> platform.uname()
uname_result(system='Linux', node='rnpalmer-laptop', 
release='4.19.0-12-amd64', version='#1 SMP Debian 4.19.152-1 
(2020-10-18)', machine='x86_64', processor='')
 >>> sys.platform
'linux'
 >>> sysconfig.get_platform()
'linux-x86_64'
 >>> import struct;struct.calcsize("P")
4

I would welcome better (and preferably upstreamable) ways of determining 
architecture from Python if they actually exist.  pandas/statsmodels 
have several patches that amount to "$feature is broken on $arch - xfail 
its tests and warn on use".



More information about the debian-science-maintainers mailing list