Bug 2076584

Summary: pybind11 fails to build with Python 3.11: ImportError: VanillaDictMix1: PyType_Ready failed (TypeError: mro() returned base with unsuitable layout ('pybind11_tests.multiple_inheritance.WithDict'))!
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: pybind11Assignee: Susi Lehtola <susi.lehtola>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: caolanm, mhroncok, negativo17, nforro, susi.lehtola, thrnciar, torsava, trix
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-06-22 11:49:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2016048    

Description Tomáš Hrnčiar 2022-04-19 12:06:15 UTC
pybind11 fails to build with Python 3.11.0a7.

ImportError while loading conftest '/builddir/build/BUILD/pybind11-2.9.2/tests/conftest.py'.
../../tests/conftest.py:19: in <module>
    import pybind11_tests  # noqa: F401
E   ImportError: VanillaDictMix1: PyType_Ready failed (TypeError: mro() returned base with unsuitable layout ('pybind11_tests.multiple_inheritance.WithDict'))!

This seems to be connected with this change in CPython:

The PyType_Ready() function now raises an error if a type is defined with the Py_TPFLAGS_HAVE_GC flag set but has no traverse function (PyTypeObject.tp_traverse). (Contributed by Victor Stinner in bpo-44263.)

https://bugs.python.org/issue?@action=redirect&bpo=44263
https://docs.python.org/3.11/whatsnew/3.11.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.11/fedora-rawhide-x86_64/04221007-pybind11/

For all our attempts to build pybind11 with Python 3.11, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/package/pybind11/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.11:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/

Let us know here if you have any questions.

Python 3.11 is planned to be included in Fedora 37. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.11.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Susi Lehtola 2022-04-19 18:20:33 UTC
I don't have the time nor the expertise to work on this. If anyone is willing to take pybind11 off my hands, please tell me.

Comment 2 Miro Hrončok 2022-04-19 18:48:32 UTC
CCing some people who might be interested in taking over pybind11.

pybind11 is needed for scipy, opae, and zxing-cpp in ELN.


In Rawhide, it is needed for more:

$ repoquery -q --repo=rawhide{,-source} --whatrequires pybind11-devel --whatrequires python3-pybind11
OpenColorIO-0:2.1.1-3.fc37.src
OpenImageIO-0:2.3.14.0-1.fc37.src
android-file-transfer-0:4.2-4.fc36.src
arbor-0:0.5.2-4.fc36.src
dolfin-0:2019.1.0.post0-30.fc36.src
gnuradio-0:3.10.2.0-1.fc37.src
gr-air-modes-0:0-0.93.20200807git9e2515a5.fc37.src
gr-funcube-0:1.0.0-12.20220130gitbf71b979.fc37.src
gr-hpsdr-0:3.0-12.fc37.src
gr-iqbal-0:0.38.2-13.20210210gitfbee239a.fc37.src
gr-osmosdr-0:0.2.3-22.20210217gita100eb02.fc37.src
gr-rds-0:1.1.0-30.20220127git51acc5bd.fc37.src
libsonata-0:0.1.11-6.fc37.src
morphio-0:3.3.3-1.fc37.src
netgen-mesher-0:6.2.2202-1.fc37.src
oneVPL-0:2022.1.0-1.fc37.src
opae-0:2.0.0-2.8.fc36.src
openshadinglanguage-0:1.11.16.0-3.fc36.src
orocos-kdl-0:1.5.1-1.fc37.src
psi4-1:1.3.2-13.fc35.src
pyosmium-0:3.3.0-1.fc37.src
python-ducc0-0:0.23.0-1.fc37.src
python-mapbox-earcut-0:1.0.0-1.fc36.src
python-mplcairo-0:0.4-4.fc36.src
python-pikepdf-0:5.1.0-1.fc37.src
python-pyopencl-0:2022.1-1.fc37.src
python3-dolfin-0:2019.1.0.post0-30.fc36.x86_64
python3-pybind11-0:2.9.2-1.fc37.x86_64
scipy-0:1.8.0-3.fc37.src
smoldyn-0:2.66.1-2.fc36.src
xcfun-0:2.1.1-5.fc36.src
xtensor-python-0:0.24.1-5.fc36.src
xtensor-python-devel-0:0.24.1-5.fc36.i686
xtensor-python-devel-0:0.24.1-5.fc36.x86_64
zxing-cpp-0:1.2.0-3.fc36.src

Comment 3 Miro Hrončok 2022-06-22 11:49:14 UTC
Closing this in bulk as it built with Python 3.11. If this needs to remain open for a followup, feel free to reopen, I won't close in bulk again.