Source: indexed-gzip
Version: 1.6.4-2
Severity: important
Tags: ftbfs patch
Justification: fails to build from source (but built successfully in the past)
User: debian-ri...@lists.debian.org
Usertags: riscv64
X-Debbugs-Cc: i...@hack3r.moe

Dear maintainer(s),

We are currently porting packages to riscv64 platform. indexed-gzip failed to
build on riscv64 due to test failure concerning nibabel:

```
_____________________________ test_bad_image_error _____________________________

    def test_bad_image_error():
    
        if nibver < Version('2.3.0'):
            return
    
        with tempdir():
>           create_random_image((10, 10, 10, 10), 'image.nii.gz')

../indexed_gzip/tests/test_nibabel_integration.py:113: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../indexed_gzip/tests/test_nibabel_integration.py:46: in create_random_image
    nib.Nifti1Image(data, aff, None).to_filename(fname)
/usr/lib/python3/dist-packages/nibabel/nifti1.py:1758: in __init__
    super(Nifti1Pair, self).__init__(dataobj,
/usr/lib/python3/dist-packages/nibabel/analyze.py:918: in __init__
    super(AnalyzeImage, self).__init__(
/usr/lib/python3/dist-packages/nibabel/spatialimages.py:469: in __init__
    self.update_header()
/usr/lib/python3/dist-packages/nibabel/nifti1.py:2034: in update_header
    super(Nifti1Image, self).update_header()
/usr/lib/python3/dist-packages/nibabel/nifti1.py:1797: in update_header
    super(Nifti1Pair, self).update_header()
/usr/lib/python3/dist-packages/nibabel/spatialimages.py:503: in update_header
    self._affine2header()
/usr/lib/python3/dist-packages/nibabel/nifti1.py:1807: in _affine2header
    hdr.set_qform(self._affine, code='unknown')
/usr/lib/python3/dist-packages/nibabel/nifti1.py:1024: in set_qform
    P, S, Qs = npl.svd(R)
<__array_function__ internals>:5: in svd
    ???
```

```
        m, n = a.shape[-2:]
        if compute_uv:
            if full_matrices:
                if m < n:
                    gufunc = _umath_linalg.svd_m_f
                else:
                    gufunc = _umath_linalg.svd_n_f
            else:
                if m < n:
                    gufunc = _umath_linalg.svd_m_s
                else:
                    gufunc = _umath_linalg.svd_n_s
    
            signature = 'D->DdD' if isComplexType(t) else 'd->ddd'
>           u, s, vh = gufunc(a, signature=signature, extobj=extobj)
E           ValueError: On entry to DGESDD parameter number 10 had an illegal 
value

/usr/lib/python3/dist-packages/numpy/linalg/linalg.py:1660: ValueError
----------------------------- Captured stderr call -----------------------------
```

Full buildd log: 
https://buildd.debian.org/status/fetch.php?pkg=indexed-gzip&arch=riscv64&ver=1.6.4-2%2Bb1&stamp=1662548284&raw=0

It turns out to be problems in `numpy.linalg.svd` which nibabel uses but
indexed-gzip don't. So I'm safe to say these can be simply resolved by disabling
the tests and waiting for nibabel/numpy to fix the issue.

I've attached a patch to disable the related tests. Please let me know if I
missed anything.

Cheers,
Eric
Description: Disable test_nibabel_integration on riscv64
 nibabel's Nifti1Image constructor uses numpy.linalg.svd, which throws error
 `ValueError: On entry to DGESDD parameter number 10 had an illegal value` on
 riscv64. Disables the tests because it's not indexed-gzip's fault.
Author: Eric Long <i...@hack3r.moe>
Last-Update: 2022-09-10
--- a/indexed_gzip/tests/test_nibabel_integration.py
+++ b/indexed_gzip/tests/test_nibabel_integration.py
@@ -14,6 +14,10 @@
 
 from indexed_gzip.tests import tempdir
 
+import platform
+
+if platform.machine() == 'riscv64':
+    pytest.skip('nibabel fails on riscv64', allow_module_level=True)
 
 pytestmark = pytest.mark.nibabel_test
 

Reply via email to