Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1895315

Summary: Cython generates Python 3.10 incompatible code: undefined symbol: _PyGen_Send [patch exists]
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: CythonAssignee: Tomáš Hrnčiar <thrnciar>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: rawhideCC: cstratak, gwync, igor.raits, jspaleta, mhroncok, ndbecker2, orion, pviktori, python-sig, rdieter, steve.traylen, thrnciar, tomspur
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Cython-0.29.22-1.fc35 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-03-04 15:02:19 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-06 10:26:08 UTC
numpy fails to build with Python 3.10.0a2.

Traceback (most recent call last):
  File "/builddir/build/BUILD/numpy-1.19.4/runtests.py", line 493, in <module>
    main(argv=sys.argv[1:])
  File "/builddir/build/BUILD/numpy-1.19.4/runtests.py", line 283, in main
    __import__(PROJECT_MODULE)
  File "/builddir/build/BUILD/numpy-1.19.4/build/testenv/lib64/python3.10/site-packages/numpy/__init__.py", line 151, in <module>
    from . import random
  File "/builddir/build/BUILD/numpy-1.19.4/build/testenv/lib64/python3.10/site-packages/numpy/random/__init__.py", line 179, in <module>
    from . import _pickle
  File "/builddir/build/BUILD/numpy-1.19.4/build/testenv/lib64/python3.10/site-packages/numpy/random/_pickle.py", line 1, in <module>
    from .mtrand import RandomState
  File "mtrand.pyx", line 1, in init numpy.random.mtrand
  File "bit_generator.pyx", line 1, in init numpy.random.bit_generator
ImportError: /builddir/build/BUILD/numpy-1.19.4/build/testenv/lib64/python3.10/site-packages/numpy/random/_common.cpython-310-x86_64-linux-gnu.so: undefined symbol: _PyGen_Send
error: Bad exit status from /var/tmp/rpm-tmp.lDvHNt (%check)

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

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

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-06 10:28:47 UTC
This seem to be related to https://github.com/cython/cython/issues/3876

Comment 2 Miro Hrončok 2020-11-09 12:38:31 UTC
With this patch https://github.com/cython/cython/pull/3877 numpy builds fine.

Upstream has decided to solve this differently, but until that happens, we'll use the patch in our Copr.

Comment 3 Petr Viktorin 2021-01-19 10:12:13 UTC
There's a new fix upstream: https://github.com/cython/cython/pull/3921

Comment 4 Ben Cotton 2021-02-09 16:11:50 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.

Comment 5 Tomáš Hrnčiar 2021-02-16 09:29:10 UTC
(In reply to Petr Viktorin from comment #3)
> There's a new fix upstream: https://github.com/cython/cython/pull/3921

The upstream fix seems to be working. We are building Cython in Python 3.10 COPR from this PR: https://src.fedoraproject.org/rpms/Cython/pull-request/26

Comment 6 Miro Hrončok 2021-03-04 15:02:19 UTC
This particular problem been fixed.

We have a new one: https://github.com/cython/cython/issues/4025