Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.11 support #437

Closed
obilodeau opened this issue Jun 27, 2023 · 0 comments
Closed

Python 3.11 support #437

obilodeau opened this issue Jun 27, 2023 · 0 comments
Assignees
Labels
workaround A workaround exists for this bug
Milestone

Comments

@obilodeau
Copy link
Collaborator

Did a fresh build on my Arch's Python 3.11 today. PyAV complains:

Building wheels for collected packages: av
  Building wheel for av (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [204 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-311
      creating build/lib.linux-x86_64-cpython-311/av
      copying av/__main__.py -> build/lib.linux-x86_64-cpython-311/av
      copying av/deprecation.py -> build/lib.linux-x86_64-cpython-311/av
      copying av/__init__.py -> build/lib.linux-x86_64-cpython-311/av
      copying av/datasets.py -> build/lib.linux-x86_64-cpython-311/av
      creating build/lib.linux-x86_64-cpython-311/av/filter
      copying av/filter/__init__.py -> build/lib.linux-x86_64-cpython-311/av/filter
      creating build/lib.linux-x86_64-cpython-311/av/video
      copying av/video/__init__.py -> build/lib.linux-x86_64-cpython-311/av/video
      creating build/lib.linux-x86_64-cpython-311/av/data
      copying av/data/__init__.py -> build/lib.linux-x86_64-cpython-311/av/data
      creating build/lib.linux-x86_64-cpython-311/av/sidedata
      copying av/sidedata/__init__.py -> build/lib.linux-x86_64-cpython-311/av/sidedata
      creating build/lib.linux-x86_64-cpython-311/av/codec
      copying av/codec/__init__.py -> build/lib.linux-x86_64-cpython-311/av/codec
      creating build/lib.linux-x86_64-cpython-311/av/subtitles
      copying av/subtitles/__init__.py -> build/lib.linux-x86_64-cpython-311/av/subtitles
      creating build/lib.linux-x86_64-cpython-311/av/container
      copying av/container/__init__.py -> build/lib.linux-x86_64-cpython-311/av/container
      creating build/lib.linux-x86_64-cpython-311/av/audio
      copying av/audio/__init__.py -> build/lib.linux-x86_64-cpython-311/av/audio
      running build_ext
      running config
      PyAV: 8.1.0 (unknown commit)
      Python: 3.11.3 (main, Jun  5 2023, 09:32:32) [GCC 13.1.1 20230429]
      platform: Linux-6.1.35-1-lts-x86_64-with-glibc2.37
      extension_extra:
          include_dirs: [b'include']
          libraries: [b'avformat', b'avcodec', b'avdevice', b'avutil', b'avfilter', b'swscale', b'swresample']
          library_dirs: []
          define_macros: []
          runtime_library_dirs: []
      config_macros:
          PYAV_COMMIT_STR="unknown-commit"
          PYAV_VERSION=8.1.0
          PYAV_VERSION_STR="8.1.0"
      writing build/temp.linux-x86_64-cpython-311/include/pyav/config.h
      running cythonize
      building 'av.dictionary' extension
      creating build/temp.linux-x86_64-cpython-311/src
      creating build/temp.linux-x86_64-cpython-311/src/av
      gcc -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -fPIC -I/usr/include/python3.11 -I/home/olivier/Documents/gosecure/src/pyrdp/venv/include -Ibuild/temp.linux-x86_64-cpython-311/include -Iinclude -I/home/olivier/Documents/gosecure/src/pyrdp/venv/include -I/usr/include/python3.11 -Ibuild/temp.linux-x86_64-cpython-311/include -c src/av/dictionary.c -o build/temp.linux-x86_64-cpython-311/src/av/dictionary.o
      src/av/dictionary.c: In function ‘__Pyx_PyErr_GetTopmostException’:
      src/av/dictionary.c:4611:21: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_type’
       4611 |     while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
            |                     ^~
      src/av/dictionary.c:4611:51: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_type’
       4611 |     while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
            |                                                   ^~
      src/av/dictionary.c: In function ‘__Pyx__ExceptionSave’:
      src/av/dictionary.c:4625:21: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_type’
       4625 |     *type = exc_info->exc_type;
            |                     ^~
      src/av/dictionary.c:4627:19: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_traceback’
       4627 |     *tb = exc_info->exc_traceback;
            |                   ^~
      src/av/dictionary.c: In function ‘__Pyx__ExceptionReset’:
      src/av/dictionary.c:4641:24: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_type’
       4641 |     tmp_type = exc_info->exc_type;
            |                        ^~
      src/av/dictionary.c:4643:22: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_traceback’
       4643 |     tmp_tb = exc_info->exc_traceback;
            |                      ^~
      src/av/dictionary.c:4644:13: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_type’
       4644 |     exc_info->exc_type = type;
            |             ^~
      src/av/dictionary.c:4646:13: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_traceback’
       4646 |     exc_info->exc_traceback = tb;
            |             ^~
      src/av/dictionary.c: In function ‘__Pyx__GetException’:
      src/av/dictionary.c:4703:28: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_type’
       4703 |         tmp_type = exc_info->exc_type;
            |                            ^~
      src/av/dictionary.c:4705:26: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_traceback’
       4705 |         tmp_tb = exc_info->exc_traceback;
            |                          ^~
      src/av/dictionary.c:4706:17: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_type’
       4706 |         exc_info->exc_type = local_type;
            |                 ^~
      src/av/dictionary.c:4708:17: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_traceback’
       4708 |         exc_info->exc_traceback = local_tb;
            |                 ^~
      src/av/dictionary.c: In function ‘__Pyx_AddTraceback’:
      src/av/dictionary.c:489:62: error: invalid use of incomplete typedef ‘PyFrameObject’ {aka ‘struct _frame’}
        489 |   #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
            |                                                              ^~
      src/av/dictionary.c:5047:5: note: in expansion of macro ‘__Pyx_PyFrame_SetLineNumber’
       5047 |     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
            |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      src/av/dictionary.c: In function ‘__Pyx__ExceptionSwap’:
      src/av/dictionary.c:5651:24: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_type’
       5651 |     tmp_type = exc_info->exc_type;
            |                        ^~
      src/av/dictionary.c:5653:22: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_traceback’
       5653 |     tmp_tb = exc_info->exc_traceback;
            |                      ^~
      src/av/dictionary.c:5654:13: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_type’
       5654 |     exc_info->exc_type = *type;
            |             ^~
      src/av/dictionary.c:5656:13: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_traceback’
       5656 |     exc_info->exc_traceback = *tb;
            |             ^~
      src/av/dictionary.c: In function ‘__Pyx_Coroutine_ExceptionClear’:
      src/av/dictionary.c:5880:18: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_type’
       5880 |     t = exc_state->exc_type;
            |                  ^~
      src/av/dictionary.c:5882:19: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_traceback’
       5882 |     tb = exc_state->exc_traceback;
            |                   ^~
      src/av/dictionary.c:5883:14: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_type’
       5883 |     exc_state->exc_type = NULL;
            |              ^~
      src/av/dictionary.c:5885:14: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_traceback’
       5885 |     exc_state->exc_traceback = NULL;
            |              ^~
      src/av/dictionary.c: In function ‘__Pyx_Coroutine_SendEx’:
      src/av/dictionary.c:5962:18: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_type’
       5962 |     if (exc_state->exc_type) {
            |                  ^~
      src/av/dictionary.c:5965:22: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_traceback’
       5965 |         if (exc_state->exc_traceback) {
            |                      ^~
      src/av/dictionary.c:5966:68: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_traceback’
       5966 |             PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
            |                                                                    ^~
      src/av/dictionary.c:5970:14: error: invalid use of incomplete typedef ‘PyFrameObject’ {aka ‘struct _frame’}
       5970 |             f->f_back = PyThreadState_GetFrame(tstate);
            |              ^~
      src/av/dictionary.c: In function ‘__Pyx_Coroutine_ResetFrameBackpointer’:
      src/av/dictionary.c:6001:33: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_traceback’
       6001 |     PyObject *exc_tb = exc_state->exc_traceback;
            |                                 ^~
      In file included from /usr/include/python3.11/Python.h:38,
                       from src/av/dictionary.c:63:
      src/av/dictionary.c:6007:19: error: invalid use of incomplete typedef ‘PyFrameObject’ {aka ‘struct _frame’}
       6007 |         Py_CLEAR(f->f_back);
            |                   ^~
      /usr/include/python3.11/pyport.h:24:38: note: in definition of macro ‘_Py_CAST’
         24 | #define _Py_CAST(type, expr) ((type)(expr))
            |                                      ^~~~
      /usr/include/python3.11/object.h:581:29: note: in expansion of macro ‘_PyObject_CAST’
        581 |         PyObject *_py_tmp = _PyObject_CAST(op); \
            |                             ^~~~~~~~~~~~~~
      src/av/dictionary.c:6007:9: note: in expansion of macro ‘Py_CLEAR’
       6007 |         Py_CLEAR(f->f_back);
            |         ^~~~~~~~
      In file included from /usr/include/python3.11/Python.h:44:
      src/av/dictionary.c:6007:19: error: invalid use of incomplete typedef ‘PyFrameObject’ {aka ‘struct _frame’}
       6007 |         Py_CLEAR(f->f_back);
            |                   ^~
      /usr/include/python3.11/object.h:583:14: note: in definition of macro ‘Py_CLEAR’
        583 |             (op) = NULL;                        \
            |              ^~
      In file included from /usr/include/python3.11/Python.h:45:
      src/av/dictionary.c: In function ‘__Pyx_Coroutine_traverse_excstate’:
      src/av/dictionary.c:6313:23: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_type’
       6313 |     Py_VISIT(exc_state->exc_type);
            |                       ^~
      /usr/include/python3.11/objimpl.h:199:13: note: in definition of macro ‘Py_VISIT’
        199 |         if (op) {                                                       \
            |             ^~
      src/av/dictionary.c:6313:23: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_type’
       6313 |     Py_VISIT(exc_state->exc_type);
            |                       ^~
      /usr/include/python3.11/pyport.h:24:38: note: in definition of macro ‘_Py_CAST’
         24 | #define _Py_CAST(type, expr) ((type)(expr))
            |                                      ^~~~
      /usr/include/python3.11/objimpl.h:200:30: note: in expansion of macro ‘_PyObject_CAST’
        200 |             int vret = visit(_PyObject_CAST(op), arg);                  \
            |                              ^~~~~~~~~~~~~~
      src/av/dictionary.c:6313:5: note: in expansion of macro ‘Py_VISIT’
       6313 |     Py_VISIT(exc_state->exc_type);
            |     ^~~~~~~~
      src/av/dictionary.c:6315:23: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_traceback’
       6315 |     Py_VISIT(exc_state->exc_traceback);
            |                       ^~
      /usr/include/python3.11/objimpl.h:199:13: note: in definition of macro ‘Py_VISIT’
        199 |         if (op) {                                                       \
            |             ^~
      src/av/dictionary.c:6315:23: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_traceback’
       6315 |     Py_VISIT(exc_state->exc_traceback);
            |                       ^~
      /usr/include/python3.11/pyport.h:24:38: note: in definition of macro ‘_Py_CAST’
         24 | #define _Py_CAST(type, expr) ((type)(expr))
            |                                      ^~~~
      /usr/include/python3.11/objimpl.h:200:30: note: in expansion of macro ‘_PyObject_CAST’
        200 |             int vret = visit(_PyObject_CAST(op), arg);                  \
            |                              ^~~~~~~~~~~~~~
      src/av/dictionary.c:6315:5: note: in expansion of macro ‘Py_VISIT’
       6315 |     Py_VISIT(exc_state->exc_traceback);
            |     ^~~~~~~~
      src/av/dictionary.c: In function ‘__Pyx__Coroutine_NewInit’:
      src/av/dictionary.c:6562:22: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_type’
       6562 |     gen->gi_exc_state.exc_type = NULL;
            |                      ^
      src/av/dictionary.c:6564:22: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_traceback’
       6564 |     gen->gi_exc_state.exc_traceback = NULL;
            |                      ^
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for av
  Running setup.py clean for av
Failed to build av
ERROR: Could not build wheels for av, which is required to install pyproject.toml-based projects

Didn't investigate the compile error much since PyAV provides Linux binary wheels. Updating setup.py to a newer version of PyAV worked.

@obilodeau obilodeau self-assigned this Jun 27, 2023
@obilodeau obilodeau added the workaround A workaround exists for this bug label Jun 27, 2023
@obilodeau obilodeau added this to the v1.2.1 milestone Jun 27, 2023
obilodeau added a commit that referenced this issue Jun 27, 2023
I'm expecting a CI failure here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
workaround A workaround exists for this bug
Projects
None yet
Development

No branches or pull requests

1 participant