Bug 2042360 - Cython fails to build with Python 3.11: error: _PyErr_StackItem {aka struct _err_stackitem} has no member named exc_type
Summary: Cython fails to build with Python 3.11: error: _PyErr_StackItem {aka struct _...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: Cython
Version: 36
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tomáš Hrnčiar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.11 2046671
TreeView+ depends on / blocked
 
Reported: 2022-01-19 10:32 UTC by Tomáš Hrnčiar
Modified: 2022-06-22 11:49 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2022-06-22 11:49:14 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github cython cython issues 4581 0 None open [BUG] exc_type and exc_traceback have been removed from Python 3.11 in 4th alpha 2022-01-19 11:17:21 UTC

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.


Note You need to log in before you can comment on or make changes to this bug.