Description of problem: While trying to package numba for Fedora, my builds on rawhide are failing with this error: numba/_dispatcher.cpp: In function ‘int call_trace(Py_tracefunc, PyObject*, PyThreadState*, PyFrameObject*, int, PyObject*)’: numba/_dispatcher.cpp:28:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘use_tracing’; did you mean ‘tracing’? 28 | tstate->use_tracing = 0; | ^~~~~~~~~~~ | tracing numba/_dispatcher.cpp:30:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘use_tracing’; did you mean ‘tracing’? 30 | tstate->use_tracing = ((tstate->c_tracefunc != NULL) | ^~~~~~~~~~~ | tracing numba/_dispatcher.cpp: In function ‘PyObject* call_cfunc(Dispatcher*, PyObject*, PyObject*, PyObject*, PyObject*)’: numba/_dispatcher.cpp:387:17: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘use_tracing’; did you mean ‘tracing’? 387 | if (tstate->use_tracing && tstate->c_profilefunc) | ^~~~~~~~~~~ | tracing numba/_dispatcher.cpp: In function ‘PyObject* Dispatcher_call(Dispatcher*, PyObject*, PyObject*)’: numba/_dispatcher.cpp:663:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘use_tracing’; did you mean ‘tracing’? 663 | if (ts->use_tracing && ts->c_profilefunc) { | ^~~~~~~~~~~ | tracing numba/_dispatcher.cpp: In function ‘PyObject* Dispatcher_cuda_call(Dispatcher*, PyObject*, PyObject*)’: numba/_dispatcher.cpp:777:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘use_tracing’; did you mean ‘tracing’? 777 | if (ts->use_tracing && ts->c_profilefunc) { | ^~~~~~~~~~~ | tracing I found https://bugzilla.redhat.com/show_bug.cgi?id=1958938#c1 and other bugs where this was also seen, and it was noted to be a regression in Python (with a PR for Cython). I was wondering if this is still the case? Note that numba currently does not list python 3.10 as supported, so it could just be that it needs updating. But I thought I'd ask :) Version-Release number of selected component (if applicable): python3-devel-3.10.0~rc2-2.fc36.x86_64 How reproducible: Always Steps to Reproduce: 1. Try building numba package. WIP spec is here https://pagure.io/python-numba/blob/main/f/python-numba.spec 2. 3.
Yes, I believe this is a regression in Python, but it will not be fixed in time for Python 3.10. See https://bugs.python.org/issue43760 Unfortunately, numba code needs to be changed :(
Ah, no worries. We see that there's a PR for getting numba to work with py3.10, and it looks like there's some work needed there too (they've addressed the error I noted above in a commit too). So we'll just wait until they officially support 3.10 and then see how things go. https://github.com/numba/numba/pull/7381 Please close this bug if you folks don't need it to track the regression. Cheers,
I created https://github.com/python/cpython/pull/28527 to document how to update C extensions using PyThreadState.use_tracing: "tstate->use_tracing" must be replaced with "tstate->cframe->use_tracing".
I'm also working on a new C API to abstract access to PyThreadState: https://github.com/python/cpython/pull/28542