Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1006615: python3-pybind11: Handle Python 3.10's default sysconfig paths

482 views
Skip to first unread message

Stefano Rivera

unread,
Feb 28, 2022, 1:10:04 PM2/28/22
to
Package: python3-pybind11
Version: 2.9.1-1
Severity: normal
Tags: patch
Forwarded: https://github.com/pybind/pybind11/pull/3764

Until recently, the Python sysconfig module didn't know about Debian's
deb_system and posix_local schemes that were patched into
distutils.sysconfig. This changed in 3.10.2-3, to allow the deprecation
of distutils, upstream.

See https://bugs.launchpad.net/ubuntu/+source/python3.10/+bug/1960608
for some of the back-story here.

The effective change here is that with Python 3.10 as default, packages
using pybind11 are FTBFS because they can't find Python.h. e.g.
https://launchpad.net/ubuntu/+source/avogadrolibs/1.95.1-8

> CMake Error in python/CMakeLists.txt:
> Imported target "pybind11::module" includes non-existent path
>
> "/usr/local/include/python3.10"
>
> in its INTERFACE_INCLUDE_DIRECTORIES.

I'm pointing to Ubuntu bugs here, because we're hitting these issues in
Ubuntu first, where Python 3.10 is the default Python 3. Debian hasn't
got there, yet.

The solutions here are two-fold:
1. Migrate from distutils.sysconfig to sysconfig. This needs to happen,
upstream, before distutils is gone from stdlib.
2. Explicitly select the correct system scheme when looking for
Python3's headers, rather than the default install-to-/usr/local
scheme.

Attached are a pair of patches to address the issue. I've forwarded them
upstream in https://github.com/pybind/pybind11/pull/3764

SR
0001-Use-sysconfig-in-Python-3.10.patch
0002-Explicitly-select-the-posix_prefix-scheme-for-platin.patch

Stefano Rivera

unread,
Mar 1, 2022, 3:40:04 PM3/1/22
to
Hi Debian (2022.02.28_13:58:36_-0400)
> Attached are a pair of patches to address the issue. I've forwarded them
> upstream in https://github.com/pybind/pybind11/pull/3764

And it has been merged, upstream.

SR

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

stef...@debian.org

unread,
Mar 9, 2022, 11:10:03 AM3/9/22
to
Hi Gianfranco (2022.03.09_15:40:56_+0000)
> Why is then gemmi in Ubuntu installing stuff into /usr/local/lib/python3.10 and dh-python not moving it into /usr/lib?

Because dh_python3 hasn't been called yet, at this point in the build.
You need to update the dh_install config file.

> -- Installing: /gemmi-0.5.2+ds/debian/tmp/usr/include/gemmi/sfcalc.hpp
> -- Installing: /gemmi-0.5.2+ds/debian/tmp/usr/include/gemmi/sprintf.hpp
> -- Installing: /gemmi-0.5.2+ds/debian/tmp/usr/include/gemmi/mmcif.hpp
> -- Installing: /gemmi-0.5.2+ds/debian/tmp/usr/include/gemmi/assembly.hpp
> -- Installing: /gemmi-0.5.2+ds/debian/tmp/usr/include/gemmi/floodfill.hpp
> -- Installing: /gemmi-0.5.2+ds/debian/tmp/usr/include/gemmi/asudata.hpp
> -- Installing: /gemmi-0.5.2+ds/debian/tmp/usr/include/gemmi/metadata.hpp
> -- Installing: /gemmi-0.5.2+ds/debian/tmp/usr/include/gemmi/to_mmdb.hpp
> -- Installing: /gemmi-0.5.2+ds/debian/tmp/usr/include/gemmi/utf.hpp
> -- Installing: /gemmi-0.5.2+ds/debian/tmp/usr/include/gemmi/placeh.hpp
> -- Installing: /gemmi-0.5.2+ds/debian/tmp/usr/include/gemmi/read_coor.hpp
> -- Installing: /gemmi-0.5.2+ds/debian/tmp/usr/include/gemmi/remarks.hpp
> -- Installing: /gemmi-0.5.2+ds/debian/tmp/usr/include/gemmi/solmask.hpp

Hrm, these should probably go to /usr/local unless redirected to /usr.
Sounds like this patch needs some more work.
0 new messages