Bug 2042360

Summary: Cython fails to build with Python 3.11: error: _PyErr_StackItem {aka struct _err_stackitem} has no member named exc_type
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: unspecified Docs Contact:
Priority: unspecified    
Version: 36CC: code, igor.raits, mhroncok, ndbecker2, python-sig, steve.traylen, thrnciar
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, 2046671    

Description Tomáš Hrnčiar 2022-01-19 10:32:23 UTC
Cython fails to build with Python 3.11.0a4.

/builddir/build/BUILD/cython-0.29.26/Cython/Compiler/Scanning.c: In function ‘__Pyx_PyErr_GetTopmostException’:
/builddir/build/BUILD/cython-0.29.26/Cython/Compiler/Scanning.c:19461:21: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_type’
19461 |     while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
      |                     ^~
/builddir/build/BUILD/cython-0.29.26/Cython/Compiler/Scanning.c:19461:51: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_type’
19461 |     while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
      |                                                   ^~
/builddir/build/BUILD/cython-0.29.26/Cython/Compiler/Scanning.c: In function ‘__Pyx__ExceptionSave’:
/builddir/build/BUILD/cython-0.29.26/Cython/Compiler/Scanning.c:19475:21: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_type’
19475 |     *type = exc_info->exc_type;
      |                     ^~
/builddir/build/BUILD/cython-0.29.26/Cython/Compiler/Scanning.c:19477:19: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_traceback’
19477 |     *tb = exc_info->exc_traceback;
      |                   ^~
/builddir/build/BUILD/cython-0.29.26/Cython/Compiler/Scanning.c: In function ‘__Pyx__ExceptionReset’:
/builddir/build/BUILD/cython-0.29.26/Cython/Compiler/Scanning.c:19491:24: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_type’
19491 |     tmp_type = exc_info->exc_type;
      |                        ^~
/builddir/build/BUILD/cython-0.29.26/Cython/Compiler/Scanning.c:19493:22: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_traceback’
19493 |     tmp_tb = exc_info->exc_traceback;
      |                      ^~
/builddir/build/BUILD/cython-0.29.26/Cython/Compiler/Scanning.c:19494:13: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_type’
19494 |     exc_info->exc_type = type;
      |             ^~
/builddir/build/BUILD/cython-0.29.26/Cython/Compiler/Scanning.c:19496:13: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_traceback’
19496 |     exc_info->exc_traceback = tb;
      |             ^~
/builddir/build/BUILD/cython-0.29.26/Cython/Compiler/Scanning.c: In function ‘__Pyx__GetException’:
/builddir/build/BUILD/cython-0.29.26/Cython/Compiler/Scanning.c:19578:28: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_type’
19578 |         tmp_type = exc_info->exc_type;
      |                            ^~
/builddir/build/BUILD/cython-0.29.26/Cython/Compiler/Scanning.c:19580:26: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_traceback’
19580 |         tmp_tb = exc_info->exc_traceback;
      |                          ^~
/builddir/build/BUILD/cython-0.29.26/Cython/Compiler/Scanning.c:19581:17: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_type’
19581 |         exc_info->exc_type = local_type;
      |                 ^~
/builddir/build/BUILD/cython-0.29.26/Cython/Compiler/Scanning.c:19583:17: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_traceback’
19583 |         exc_info->exc_traceback = local_tb;

The interpreter state’s representation of handled exceptions (a.k.a exc_info, or _PyErr_StackItem) now has only the exc_value field, exc_type and exc_traceback have been removed as their values can be derived from exc_value. (Contributed by Irit Katriel in bpo-45711.)

https://bugs.python.org/issue45711
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/03197418-Cython/

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

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 2 Tomáš Hrnčiar 2022-02-07 07:33:19 UTC
Cython in COPR was built with those two patches, but it's apparently not enough because some packages still don't build with it. I'll try to temporarily build Cython 3.0.0a10 to unblock other packages in COPR until 0.29.x branch is fixed.

Comment 3 Ben Cotton 2022-02-08 20:10:39 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle.
Changing version to 36.

Comment 4 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.