Bug 1896411

Summary: libsolv fails with Python 3.10: _solv.so: undefined symbol: PyObject_AsReadBuffer
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: libsolvAssignee: Miro Hrončok <mhroncok>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dmach, igor.raits, jmracek, jrohel, karsten, mcermak, mhroncok, ngompa13, nphilipp, pkratoch, rpm-software-management, thrnciar
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libsolv-0.7.15-3.eln108 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-12-08 10:20:40 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: 1890881    

Description Tomáš Hrnčiar 2020-11-10 13:56:44 UTC
fedmod fails to build with Python 3.10.0a2.

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/builddir/build/BUILD/fedmod-0.6.3/_fedmod/cli.py", line 8, in <module>
    from . import _fetchrepodata, _repodata
  File "/builddir/build/BUILD/fedmod-0.6.3/_fedmod/_fetchrepodata.py", line 17, in <module>
    from lxml import etree
ImportError: /usr/lib64/python3.10/site-packages/lxml/etree.cpython-310-x86_64-linux-gnu.so: undefined symbol: _PyGen_Send

This seem to be related to https://github.com/cython/cython/issues/3876.
It might be fixed with this patch https://github.com/cython/cython/pull/3877 that works for numpy. Upstream has decided to solve this differently, but until that happens, we are using this patch in our Copr (for other packages).

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.10/fedora-rawhide-x86_64/01756929-fedmod/

For all our attempts to build fedmod with Python 3.10, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/fedmod/

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.10:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/

Let us know here if you have any questions.

Python 3.10 will be included in Fedora 35. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.10.
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 Miro Hrončok 2020-11-10 14:27:48 UTC
We might just need to rebuild lxml with patched cython, than make sure the old lxml is not in our copr any more and than rebuild fedmod.

Comment 2 Miro Hrončok 2020-11-10 14:33:21 UTC
That solves the first problem, but goes to:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/builddir/build/BUILD/fedmod-0.6.3/_fedmod/cli.py", line 8, in <module>
    from . import _fetchrepodata, _repodata
  File "/builddir/build/BUILD/fedmod-0.6.3/_fedmod/_repodata.py", line 7, in <module>
    import solv
  File "/usr/lib64/python3.10/site-packages/solv.py", line 15, in <module>
    import _solv
ImportError: /usr/lib64/python3.10/site-packages/_solv.so: undefined symbol: PyObject_AsReadBuffer

Comment 3 Miro Hrončok 2020-11-10 14:37:10 UTC
This is a problem in libsolv.

https://docs.python.org/3.10/whatsnew/3.10.html#id4

PyObject_AsCharBuffer(), PyObject_AsReadBuffer(), PyObject_CheckReadBuffer(), and PyObject_AsWriteBuffer() are removed. Please migrate to new buffer protocol; PyObject_GetBuffer() and PyBuffer_Release().

https://bugs.python.org/issue41103

libsolv itself builds fine, so the Python binding is most likely not tested in %check.

Comment 4 Miro Hrončok 2020-11-16 10:27:59 UTC
I've reported this to libsolv upstream: https://github.com/openSUSE/libsolv/issues/410

Comment 6 Fedora Update System 2021-01-08 15:11:03 UTC
FEDORA-2021-28834317a6 has been pushed to the Fedora ELN stable repository.
If problem still persists, please make note of it in this bug report.