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

Stefano Rivera stefanor at debian.org
Mon Feb 28 17:58:36 GMT 2022


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Use-sysconfig-in-Python-3.10.patch
Type: text/x-diff
Size: 1568 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/debian-science-maintainers/attachments/20220228/66bb45cc/attachment-0002.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Explicitly-select-the-posix_prefix-scheme-for-platin.patch
Type: text/x-diff
Size: 1204 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/debian-science-maintainers/attachments/20220228/66bb45cc/attachment-0003.patch>


More information about the debian-science-maintainers mailing list