8000 Build failure on Python3.11 · Issue #36 · DiamondLightSource/cothread · GitHub
[go: up one dir, main page]

Skip to content
Build failure on Python3.11 #36
@AlexanderWells-diamond

Description

@AlexanderWells-diamond

It seems cothread cannot be built on Python 3.11. It looks like the API for PyThreadState has changed.

The errors reported by a CI build in pythonSoftIOC are:

 building 'cothread._coroutine' extension
        creating build/temp.linux-x86_64-cpython-311
        creating build/temp.linux-x86_64-cpython-311/context
        gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tmp/tmp.3osZKRDAwo/venv/include -I/opt/_internal/cpython-3.11.1/include/python3.11 -c context/_coroutine.c -o build/temp.linux-x86_64-cpython-311/context/_coroutine.o -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wundef -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes
        context/_coroutine.c: In function ‘coroutine_wrapper’:
        context/_coroutine.c:83:19: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘frame’; did you mean ‘cframe’?
           83 |     thread_state->frame = NULL;
              |                   ^~~~~
              |                   cframe
        context/_coroutine.c:84:19: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘recursion_depth’; did you mean ‘recursion_limit’?
           84 |     thread_state->recursion_depth = 0;
              |                   ^~~~~~~~~~~~~~~
              |                   recursion_limit
        In file included from /opt/_internal/cpython-3.11.1/include/python3.11/Python.h:38,
                         from context/_coroutine.c:33:
        context/_coroutine.c:110:30: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘frame’; did you mean ‘cframe’?
          110 |     Py_XDECREF(thread_state->frame);
              |                              ^~~~~
        /opt/_internal/cpython-3.11.1/include/python3.11/pyport.h:24:38: note: in definition of macro ‘_Py_CAST’
           24 | #define _Py_CAST(type, expr) ((type)(expr))
              |                                      ^~~~
        /opt/_internal/cpython-3.11.1/include/python3.11/object.h:606:37: note: in expansion of macro ‘_PyObject_CAST’
          606 | #  define Py_XDECREF(op) Py_XDECREF(_PyObject_CAST(op))
              |                                     ^~~~~~~~~~~~~~
        context/_coroutine.c:110:5: note: in expansion of macro ‘Py_XDECREF’
          110 |     Py_XDECREF(thread_state->frame);
              |     ^~~~~~~~~~
        context/_coroutine.c:112:39: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_type’
          112 |     Py_XDECREF(thread_state->exc_state.exc_type);
              |                                       ^
        /opt/_internal/cpython-3.11.1/include/python3.11/pyport.h:24:38: note: in definition of macro ‘_Py_CAST’
           24 | #define _Py_CAST(type, expr) ((type)(expr))
              |                                      ^~~~
        /opt/_internal/cpython-3.11.1/include/python3.11/object.h:606:37: note: in expansion of macro ‘_PyObject_CAST’
          606 | #  define Py_XDECREF(op) Py_XDECREF(_PyObject_CAST(op))
              |                                     ^~~~~~~~~~~~~~
        context/_coroutine.c:112:5: note: in expansion of macro ‘Py_XDECREF’
          112 |     Py_XDECREF(thread_state->exc_state.exc_type);
              |     ^~~~~~~~~~
        context/_coroutine.c:114:39: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_traceback’
          114 |     Py_XDECREF(thread_state->exc_state.exc_traceback);
              |                                       ^
        /opt/_internal/cpython-3.11.1/include/python3.11/pyport.h:24:38: note: in definition of macro ‘_Py_CAST’
           24 | #define _Py_CAST(type, expr) ((type)(expr))
              |                                      ^~~~
        /opt/_internal/cpython-3.11.1/include/python3.11/object.h:606:37: note: in expansion of macro ‘_PyObject_CAST’
          606 | #  define Py_XDECREF(op) Py_XDECREF(_PyObject_CAST(op))
              |                                     ^~~~~~~~~~~~~~
        context/_coroutine.c:114:5: note: in expansion of macro ‘Py_XDECREF’
          114 |     Py_XDECREF(thread_state->exc_state.exc_traceback);
              |     ^~~~~~~~~~
        context/_coroutine.c: In function ‘coroutine_switch’:
        context/_coroutine.c:156:53: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘frame’; did you mean ‘cframe’?
          156 |         struct _frame *python_frame = thread_state->frame;
              |                                                     ^~~~~
              |                                                     cframe
        context/_coroutine.c:157:45: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘recursion_depth’; did you mean ‘recursion_limit’?
          157 |         int recursion_depth = thread_state->recursion_depth;
              |                                             ^~~~~~~~~~~~~~~
              |                                             recursion_limit
        context/_coroutine.c:181:23: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘frame’; did you mean ‘cframe’?
          181 |         thread_state->frame = python_frame;
              |                       ^~~~~
              |                       cframe
        context/_coroutine.c:182:23: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘recursion_depth’; did you mean ‘recursion_limit’?
          182 |         thread_state->recursion_depth = recursion_depth;
              |                       ^~~~~~~~~~~~~~~
              |                       recursion_limit
        error: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
        [end of output]

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0