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

2020-11-06 Thread Rebecca N. Palmer

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".




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

2020-11-06 Thread Matthias Klose
On 11/6/20 9:35 AM, Rebecca N. Palmer wrote:
> 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:

no, you are using chroots in a wrong way.  You'll never see that e.g. on the
Debian porter boxes. Use linux32/setarch to enter the chroot.

schroot has the personality configuration for that.

> (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".



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

2020-11-05 Thread Matthias Klose
Package: src:statsmodels
Version: 0.12.1-1

+import sys
+import glob
+i386_looser_tolerances=len(glob.glob('/usr/lib/i386-*/'))>0 and
np.log2(sys.maxsize)<=32

this is not safe. the directory can exist on any installation. better use
sysconfig.get_platform()