Package: python3-imath
Version: 3.2.3-5
Severity: serious
X-Debbugs-Cc: [email protected]

Dear Maintainer,

The build system for python3-imath goes to a lot of effort to build the
package for each supported Python interpreter which is great... but it
doesn't correctly copy the files into the .deb and so the package is not
actually available for each interpreter. Worse, the .so tagged for
Python 3.14 actually links against Python 3.15.

Additionally, there are no autopkgtest tests and so this error is not
found by ci.d.n.

The current package in sid contains:

python3-imath: 
/usr/lib/python3/dist-packages/imath.cpython-314-x86_64-linux-gnu.so
python3-imath: 
/usr/lib/python3/dist-packages/imathnumpy.cpython-314-x86_64-linux-gnu.so
python3-imath: /usr/lib/x86_64-linux-gnu/libPyImath.so
python3-imath: /usr/lib/x86_64-linux-gnu/libPyImath_Python3_14-3_2.so
python3-imath: /usr/lib/x86_64-linux-gnu/libPyImath_Python3_14-3_2.so.30
python3-imath: /usr/lib/x86_64-linux-gnu/libPyImath_Python3_14-3_2.so.30.3.2.3
python3-imath: /usr/lib/x86_64-linux-gnu/libPyImath_Python3_15-3_2.so
python3-imath: /usr/lib/x86_64-linux-gnu/libPyImath_Python3_15-3_2.so.30
python3-imath: /usr/lib/x86_64-linux-gnu/libPyImath_Python3_15-3_2.so.30.3.2.3

As you can see, the libraries in /usr/lib/{triple}/ exist for both
Python 3.14 and Python 3.15. However, the .so to be imported by Python
directly only exists in the package for Python 3.14.

Looking at the build log, we see that the install steps for both Python
3.14 and 3.15 write the .so to the same location in the d/tmp staging
area:


  dh_auto_install -a -O-Bbuild
  [...]
  -- Installing: 
/build/reproducible-path/imath-3.2.3/debian/tmp/usr/lib/python3/dist-packages/imath.so

  set -e; for v in 3.15; do \
        dh_auto_install --builddirectory=build-py$v ; \
  done
  [...]
  -- Installing: 
/build/reproducible-path/imath-3.2.3/debian/tmp/usr/lib/python3/dist-packages/imath.so


and this is later renamed into a interpreter-specific path:


  dh_python3 -a -O-Bbuild
  I: dh_python3 fs:545: renaming imath.so to 
imath.cpython-314-x86_64-linux-gnu.so
  I: dh_python3 fs:545: renaming imathnumpy.so to 
imathnumpy.cpython-314-x86_64-linux-gnu.so


dh_python3 has concluded that it is for Python 3.14 because it is in the
default dist-packages, but this .so is actually built for Python 3.15
(because it is the second one that was copied into the tree in the above
sequence):

$ ldd imath.cpython-314-x86_64-linux-gnu.so | grep -i python
        libPyImath_Python3_15-3_2.so.30
        libboost_python315.so.1.92.0


The solution is normally to get the .so installed into a separate
dist-packages tree for each Python-interpreter
(d/tmp/usr/lib/python3.YY/dist-packages) then
dh_python3 will merge the two trees and separately tag the .so
files with the different origins.

(And, as per #1035257, please add autopkgtests at least for the Python
component, so that errors like this can be caught earlier. Even the most
simple $pyver -c 'import imath' would have caught this with a
SystemError)

regards
Stuart

Reply via email to