#1147230 dm-tree: FTBFS against python 3.15rc2

Package:
src:dm-tree
Source:
src:dm-tree
Submitter:
Maximiliano Curia
Date:
2026-09-09 20:37:02 UTC
Severity:
normal
Tags:
#1147230#5
Date:
2026-09-09 20:33:57 UTC
From:
To:
Hi!

While rebuilding the python related packages against the Python 3.15rc2
version we found that dm-tree fails to build from source [1].

The error is:

pybind11::handle::dec_ref() is being called while the GIL is either not held or invalid. Please see https://pybind11.readthedocs.io/en/stable/advanced/misc.html#common-sources-of-global-interpreter-lock-errors for debugging advice.
     If you are convinced there is no bug in your code, you can #define PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF to disable this check. In that case you have to ensure this #define is consistently used for all translation units linked into a given pybind11 extension, otherwise there will be ODR violations. The failing pybind11::handle::dec_ref() call was triggered on a ABCMeta object.
     terminate called after throwing an instance of 'std::runtime_error'
       what():  pybind11::handle::dec_ref() PyGILState_Check() failure.
     Aborted
     E: pybuild pybuild:485: test: plugin pyproject failed with: exit code=134: cd /build/reproducible-path/dm-tree-0.1.9/.pybuild/cpython3_3.15_dm-tree/build; python3.15 -m pytest

To fix the issues I had to apply two fixes:
- Backport c9be91f8 Add support for python 3.14 [2]. Which was already
   included in version 0.1.10.
- Add patch to Release static Python objects to avoid dec_ref during
   finalization. This is because in Python 3.15 this triggers the
   PyGILState_Check() assertion.

I've applied these fixes in the sandbox [3] to verify that it builds
successfully, please consider applying the patch to support the upcoming
3.15 version.

Setting the severity to important for now. Once Python 3.15 is released,
it will be added to python3-defaults and this bug will become release
critical.

Happy hacking,

[1]: https://debusine.debian.net/debian/r-python-python3.15/artifact/4597612/
[2]: https://github.com/google-deepmind/tree/commit/c9be91f8a9b84435da0d1e25b1d4bb4e249bc612
[3]: https://debusine.debian.net/debian/r-python-python3.15/