Hi Simon (2019.11.18_09:34:19_-0400)

Firstly, please note that this bug is only reproducible when there are
at least two supported versions of python3, currently 3.7 and 3.8.

Sorry for never looking at this sooner, I forget to do it while we have multiple supported versions in the archive.

 Depends: dbus, python3-dbus, python3 (<< 3.8), python3 (>= 3.7~),
python3.8, python3.8:any, python3:any, python3.7, python3.7:any, libc6 (>=
2.4), libpython3.7 (>= 3.7.0), libpython3.8 (>= 3.8.0~a1)

I can reproduce the issue by reverting 03a575e082f3b6313c52f16808186d39e9942448 and building dbus-python.

This is because python3-dbus-tests contains one private directory per
supported Python 3 version, with names like
/usr/lib/x86_64-linux-gnu/installed-tests/dbus-python/python3.7/test. They
are GNOME-style "installed tests", and are run by the autopkgtest.

I was not familiar with GNOME's installed test style. My inclination would have been to have one Python tree that I run the tests against with each supported Python version. I see the upstream exposes the PYTHON variable for this purpose, so there could be two trees of '.test' files referring to one tree of Python source.

I guess this would require some work in the package's build system to support it... If you did that, then I think this whole issue becomes moot.

dbus-python's debian/rules loops over all those private directories running
an appropriate dh_python3 --shebang for each one.

I think the crux of it is calling dh_python3 multiple times for the same binary package. That was not something it was designed to do, and it's how you get mutually-incompatible sets of dependencies.

I don't know how other debhelper scripts handle this, but I'd expect that anything that's expecting to generate comprehensive sets of dependencies could run into trouble in this situation.

Back to this issue, do we even need to alter the shebangs? It looks like the .test files explicitly call the correct Python, so we can do something as simple as:

override_dh_python3:
        dh_python3 /usr/libexec/installed-tests/dbus-python/

That will generate:
 Depends: dbus-daemon, python3-dbus, python3 (<< 3.15), python3 (>= 3.13~), python3:any, 
libc6 (>= 2.34), libpython3.13 (>= 3.13.0~rc3), libpython3.14 (>= 3.14.1)

The tests don't pass, and I didn't dig into why, but they could probably be made to work.

However, a little sed shebang hackery makes them work:

override_dh_python3:
        set -e; for x in $(PYTHON3); do \
                sed -i "1 s,^#!.*,#!/usr/bin/python$$x," \
                        
debian/python3-dbus-tests/usr/libexec/installed-tests/dbus-python/python$$x/test/*.py;
 \
        done
        dh_python3 /usr/libexec/installed-tests/dbus-python/

So, where does that leave us?

While the bug looked nasty from the description, I'm really not convinced that dh-python should change anything here. Maybe document that you can't call dh_python3 multiple times for different Python versions, but that's not something I can easily imagine needing to do in Debian. This was a very unusual use-case.

Stefano

--
Stefano Rivera
  http://tumbleweed.org.za/
  +1 415 683 3272

Reply via email to