[Debian-pan-maintainers] Bug#1083180: tomopy: FTBFS: test_shape fails on single-CPU systems

Santiago Vila sanvila at debian.org
Wed Oct 2 20:36:35 BST 2024


Package: src:tomopy
Version: 1.15.0+ds1-4
Severity: important
Tags: ftbfs patch

Dear maintainer:

During a rebuild of all packages in unstable, your package failed to build:

--------------------------------------------------------------------------------
[...]
  debian/rules build
dh build --with python3 --buildsystem=pybuild --test-pytest
    dh_update_autotools_config -O--buildsystem=pybuild -O--test-pytest
    dh_autoreconf -O--buildsystem=pybuild -O--test-pytest
    debian/rules override_dh_auto_configure
make[1]: Entering directory '/<<PKGBUILDDIR>>'
mkdir -p source/PTL
for i in VERSION CMakeLists.txt cmake source ; do ln -s ../../PTL/$i source/PTL/ ; done
dh_auto_configure -Spython3 --buildsystem=pybuild -O--test-pytest
dh_auto_configure -Scmake -- -DCMAKE_CXX_FLAGS="-g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2" -DCMAKE_SHARED_LINKER_FLAGS_RELEASE="-Wl,-z,relro -Wl,-z,now" -DWITH_SHARED_LIB=1 -DWITH_STATIC_LIB=0 -DCMAKE_INSTALL_LIBDIR=/usr/lib/python3/dist-packages/tomopy/util/extern -DCMAKE_CUDA_HOST_COMPILER=cuda-g++ -DMKL_ROOT_DIR=/usr -DMKL_INCLUDE_DIR=/usr/include/mkl -DCMAKE_BUILD_TYPE=Release
	cd obj-x86_64-linux-gnu && DEB_PYTHON_INSTALL_LAYOUT=deb PKG_CONFIG=/usr/bin/pkg-config cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON -DFETCHCONTENT_FULLY_DISCONNECTED=ON -DCMAKE_INSTALL_RUNSTATEDIR=/run -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON "-GUnix Makefiles" -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu "-DCMAKE_CXX_FLAGS=-g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2" "-DCMAKE_SHARED_LINKER_FLAGS_RELEASE=-Wl,-z,relro -Wl,-z,now" -DWITH_SHARED_LIB=1 -DWITH_STATIC_LIB=0 -DCMAKE_INSTALL_LIBDIR=/usr/lib/python3/dist-packages/tomopy/util/extern -DCMAKE_CUDA_HOST_COMPILER=cuda-g\+\+ -DMKL_ROOT_DIR=/usr -DMKL_INCLUDE_DIR=/usr/include/mkl -DCMAKE_BUILD_TYPE=Release ..
-- The C compiler identification is GNU 14.2.0
-- The CXX compiler identification is GNU 14.2.0
-- Detecting C compiler ABI info
[...]
-- Installing: /<<PKGBUILDDIR>>/debian/python3-tomopy/usr/lib/python3/dist-packages/tomopy/util/extern/cmake/libtomo/libtomoTargets.cmake
-- Installing: /<<PKGBUILDDIR>>/debian/python3-tomopy/usr/lib/python3/dist-packages/tomopy/util/extern/cmake/libtomo/libtomoTargets-release.cmake
-- Installing: /<<PKGBUILDDIR>>/debian/python3-tomopy/usr/lib/python3/dist-packages/tomopy/util/extern/cmake/libtomo/libtomoConfig.cmake
-- Installing: /<<PKGBUILDDIR>>/debian/python3-tomopy/usr/lib/python3/dist-packages/tomopy/util/extern/cmake/libtomo/libtomoConfigVersion.cmake
make[2]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
    debian/rules execute_before_dh_auto_test
make[1]: Entering directory '/<<PKGBUILDDIR>>'
for v in $(py3versions -sv) ; do cp -v debian/python3-tomopy//usr/lib/python3/dist-packages/tomopy/util/extern/*.so /<<PKGBUILDDIR>>/.pybuild/cpython3_${v}_tomopy/build/tomopy/util/extern ; done
'debian/python3-tomopy//usr/lib/python3/dist-packages/tomopy/util/extern/libtomo-accel.so' -> '/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_tomopy/build/tomopy/util/extern/libtomo-accel.so'
'debian/python3-tomopy//usr/lib/python3/dist-packages/tomopy/util/extern/libtomo-gridrec.so' -> '/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_tomopy/build/tomopy/util/extern/libtomo-gridrec.so'
'debian/python3-tomopy//usr/lib/python3/dist-packages/tomopy/util/extern/libtomo-misc.so' -> '/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_tomopy/build/tomopy/util/extern/libtomo-misc.so'
'debian/python3-tomopy//usr/lib/python3/dist-packages/tomopy/util/extern/libtomo-prep.so' -> '/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_tomopy/build/tomopy/util/extern/libtomo-prep.so'
'debian/python3-tomopy//usr/lib/python3/dist-packages/tomopy/util/extern/libtomo-recon.so' -> '/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_tomopy/build/tomopy/util/extern/libtomo-recon.so'
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
    dh_auto_test -O--buildsystem=pybuild -O--test-pytest
I: pybuild base:311: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_tomopy/build; python3.12 -m pytest test
============================= test session starts ==============================
platform linux -- Python 3.12.6, pytest-8.3.3, pluggy-1.5.0
rootdir: /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_tomopy/build
configfile: pyproject.toml
plugins: typeguard-4.3.0
collected 68 items

test/test_tomopy/test_misc/test_corr.py ............                     [ 17%]
test/test_tomopy/test_misc/test_morph.py ...                             [ 22%]
test/test_tomopy/test_misc/test_phantom.py ....s...                      [ 33%]
test/test_tomopy/test_prep/test_alignment.py ..                          [ 36%]
test/test_tomopy/test_prep/test_normalize.py ...                         [ 41%]
test/test_tomopy/test_prep/test_phase.py .                               [ 42%]
test/test_tomopy/test_prep/test_stripe.py ............                   [ 60%]
test/test_tomopy/test_recon/test_algorithm.py .......ss......ss..        [ 88%]
test/test_tomopy/test_recon/test_rotation.py s...s                       [ 95%]
test/test_tomopy/test_sim/test_project.py .                              [ 97%]
test/test_tomopy/test_util/test_mproc.py .F                              [100%]

=================================== FAILURES ===================================
________________________ TestDistributeJobs.test_shape _________________________

self = <test_tomopy.test_util.test_mproc.TestDistributeJobs testMethod=test_shape>

     def test_shape(self):
         a = np.zeros((2, 4, 8))
         # whole array on single core
         self._test_shape(a, a.shape, axis=0, ncore=1, nchunk=None)
         # chunk=0 for diff axis
         self._test_shape(a, (4, 8), axis=0, ncore=1, nchunk=0)
         self._test_shape(a, (4, 8), axis=0, ncore=None, nchunk=0)
         self._test_shape(a, (2, 8), axis=1, ncore=1, nchunk=0)
         self._test_shape(a, (2, 8), axis=1, ncore=None, nchunk=0)
         self._test_shape(a, (2, 4), axis=2, ncore=1, nchunk=0)
         self._test_shape(a, (2, 4), axis=2, ncore=None, nchunk=0)
         # two core tests
>       self._test_shape(a, (1, 4, 8), axis=0, ncore=2, nchunk=None)

test/test_tomopy/test_util/test_mproc.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test/test_tomopy/test_util/test_mproc.py:75: in _test_shape
     ret = mproc.distribute_jobs(
tomopy/util/mproc.py:329: in distribute_jobs
     _arg_parser(m)
tomopy/util/mproc.py:383: in _arg_parser
     result = func(*func_args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

a = array([[[0., 0., 0., 0., 0., 0., 0., 0.],
         [0., 0., 0., 0., 0., 0., 0., 0.],
         [0., 0., 0., 0., 0., 0., 0...[0., 0., 0., 0., 0., 0., 0., 0.],
         [0., 0., 0., 0., 0., 0., 0., 0.],
         [0., 0., 0., 0., 0., 0., 0., 0.]]])
expected_shape = (1, 4, 8)

     def _test_shape(a, expected_shape):
>       assert a.shape == expected_shape
E       assert (2, 4, 8) == (1, 4, 8)
E
E         At index 0 diff: 2 != 1
E         Use -v to get more diff

test/test_tomopy/test_util/test_mproc.py:68: AssertionError
=============================== warnings summary ===============================
test/test_tomopy/test_prep/test_stripe.py::StripeRemovalTestCase::test_remove_all_stripe
test/test_tomopy/test_prep/test_stripe.py::StripeRemovalTestCase::test_remove_dead_stripe
   /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_tomopy/build/tomopy/prep/stripe.py:826: DeprecationWarning: `interp2d` is deprecated in SciPy 1.10 and will be removed in SciPy 1.14.0.
   
   For legacy code, nearly bug-for-bug compatible replacements are
   `RectBivariateSpline` on regular grids, and `bisplrep`/`bisplev` for
   scattered 2D data.
   
   In new code, for regular grids use `RegularGridInterpolator` instead.
   For scattered data, prefer `LinearNDInterpolator` or
   `CloughTocher2DInterpolator`.
   
   For more details see
   `https://scipy.github.io/devdocs/notebooks/interp_transition_guide.html`
   
     finter = interpolate.interp2d(listx, listy, matz, kind='linear')

test/test_tomopy/test_prep/test_stripe.py::StripeRemovalTestCase::test_remove_all_stripe
test/test_tomopy/test_prep/test_stripe.py::StripeRemovalTestCase::test_remove_dead_stripe
   /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_tomopy/build/tomopy/prep/stripe.py:829: DeprecationWarning: `interp2d` is deprecated in SciPy 1.10 and will be removed in SciPy 1.14.0.
   
   For legacy code, nearly bug-for-bug compatible replacements are
   `RectBivariateSpline` on regular grids, and `bisplrep`/`bisplev` for
   scattered 2D data.
   
   In new code, for regular grids use `RegularGridInterpolator` instead.
   For scattered data, prefer `LinearNDInterpolator` or
   `CloughTocher2DInterpolator`.
   
   For more details see
   `https://scipy.github.io/devdocs/notebooks/interp_transition_guide.html`
   
     sinogram[:, listxmiss] = finter(listxmiss, listy)

test/test_tomopy/test_prep/test_stripe.py::StripeRemovalTestCase::test_remove_stripe_based_interpolation
   /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_tomopy/build/tomopy/prep/stripe.py:966: DeprecationWarning: `interp2d` is deprecated in SciPy 1.10 and will be removed in SciPy 1.14.0.
   
   For legacy code, nearly bug-for-bug compatible replacements are
   `RectBivariateSpline` on regular grids, and `bisplrep`/`bisplev` for
   scattered 2D data.
   
   In new code, for regular grids use `RegularGridInterpolator` instead.
   For scattered data, prefer `LinearNDInterpolator` or
   `CloughTocher2DInterpolator`.
   
   For more details see
   `https://scipy.github.io/devdocs/notebooks/interp_transition_guide.html`
   
     finter = interpolate.interp2d(listx, listy, matz, kind='linear')

test/test_tomopy/test_prep/test_stripe.py::StripeRemovalTestCase::test_remove_stripe_based_interpolation
   /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_tomopy/build/tomopy/prep/stripe.py:969: DeprecationWarning: `interp2d` is deprecated in SciPy 1.10 and will be removed in SciPy 1.14.0.
   
   For legacy code, nearly bug-for-bug compatible replacements are
   `RectBivariateSpline` on regular grids, and `bisplrep`/`bisplev` for
   scattered 2D data.
   
   In new code, for regular grids use `RegularGridInterpolator` instead.
   For scattered data, prefer `LinearNDInterpolator` or
   `CloughTocher2DInterpolator`.
   
   For more details see
   `https://scipy.github.io/devdocs/notebooks/interp_transition_guide.html`
   
     sinogram[:, listxmiss] = finter(listxmiss, listy)

test/test_tomopy/test_prep/test_stripe.py: 16 warnings
   /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_tomopy/build/tomopy/prep/stripe.py:286: DeprecationWarning: Calling nonzero on 0d arrays is deprecated, as it behaves surprisingly. Use `atleast_1d(cond).nonzero()` if the old behavior was intended. If the context of this warning is of the form `arr[nonzero(cond)]`, just use `arr[cond]`.
     pos = np.where(np.isnan(mysino) is True)

test/test_tomopy/test_recon/test_rotation.py: 48 warnings
   /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_tomopy/build/tomopy/recon/rotation.py:291: DeprecationWarning: Please import `shift` from the `scipy.ndimage` namespace; the `scipy.ndimage.interpolation` namespace is deprecated and will be removed in SciPy 2.0.0.
     sino_shift = ndimage.interpolation.shift(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED test/test_tomopy/test_util/test_mproc.py::TestDistributeJobs::test_shape
============ 1 failed, 60 passed, 7 skipped, 70 warnings in 20.03s =============
E: pybuild pybuild:389: test: plugin pyproject failed with: exit code=1: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_tomopy/build; python3.12 -m pytest test
dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p 3.12 returned exit code 13
make: *** [debian/rules:25: build] Error 25
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
--------------------------------------------------------------------------------

The above is just how the build ends and not necessarily the most relevant part.
If required, the full build log is available here:

https://people.debian.org/~sanvila/build-logs/202410/

About the archive rebuild: The build was made on virtual machines from AWS,
using sbuild and a reduced chroot with only build-essential packages.

If you could not reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.

Note: This is trivial to reproduce by using GRUB_CMDLINE_LINUX="nr_cpus=1".

If this is really a bug in one of the build-depends, please use
reassign and affects, so that this is still visible in the BTS web
page for this package.


Note: This used to work in the past, namely in version 1.10.4+ds1-7.

If test_shape is actually not expected to work on single-cpu systems,
then we might better disable the test in such case, because we still
want the package to build from source.

I've attached a patch which is simple enough and it works for me.

On the other hand, if test_shape is expected to work on any machine,
then please report this upstream (in this case, disabling the test
in the meantime is still a good idea, because we don't want the build
to fail).

Thanks.
-------------- next part --------------
diff --git a/debian/changelog b/debian/changelog
index 3c76059..ee0809a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+tomopy (1.15.0+ds1-8) unstable; urgency=medium
+
+  * Fix FTBFS on single-CPU systems. Closes: #XXXXXXX.
+
+ -- Roland Mas <lolando at debian.org>  Tue, 01 Oct 2024 22:44:35 +0200
+
 tomopy (1.15.0+ds1-7) unstable; urgency=medium
 
   * Only try to use OpenMP if present.
diff --git a/debian/patches/0008-skip-test-shape-on-single-cpu-machines.patch b/debian/patches/0008-skip-test-shape-on-single-cpu-machines.patch
new file mode 100644
index 0000000..1302506
--- /dev/null
+++ b/debian/patches/0008-skip-test-shape-on-single-cpu-machines.patch
@@ -0,0 +1,22 @@
+From: Santiago Vila <sanvila at debian.org>
+Subject: Skip test_shape on single-CPU systems
+Last-Update: 2024-10-02
+
+--- tomopy-1.15.0+ds1.orig/test/test_tomopy/test_util/test_mproc.py
++++ tomopy-1.15.0+ds1/test/test_tomopy/test_util/test_mproc.py
+@@ -53,6 +53,7 @@ import tomopy.util.mproc as mproc
+ import numpy as np
+ from numpy.testing import assert_allclose, assert_array_equal
+ import unittest
++import os
+ 
+ __author__ = "Doga Gursoy"
+ __copyright__ = "Copyright (c) 2015, UChicago Argonne, LLC."
+@@ -81,6 +82,7 @@ class TestDistributeJobs(unittest.TestCa
+             nchunk=nchunk)
+         assert_array_equal(a, ret)
+ 
++    @unittest.skipIf(os.cpu_count() == 1, "Skipping test on a single CPU machine")
+     def test_shape(self):
+         a = np.zeros((2, 4, 8))
+         # whole array on single core
diff --git a/debian/patches/series b/debian/patches/series
index 2594ed9..da6578f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,4 @@
 0006-Fix-scipy-API-call.patch
 0007-Increase-tolerance-to-cope-with-i386.patch
 0007-Replace-deprecated-interp2d.patch
+0008-skip-test-shape-on-single-cpu-machines.patch


More information about the Debian-pan-maintainers mailing list