PyAV-Org / PyAV

Pythonic bindings for FFmpeg's libraries.
https://pyav.basswood-io.com/
BSD 3-Clause "New" or "Revised" License
2.39k stars 354 forks source link

`argument 2 of ‘av_bsf_list_parse_str’ from incompatible pointer type` in `bitstream.c` #1412

Closed christophfink closed 1 month ago

christophfink commented 1 month ago

Overview

PyAV 12.1.0 does not build on my system (Arch Linux, Python 3.12, GCC 14.1.1)

Expected behavior

python setup.py build_ext finishes successfully

Actual behavior

python setup.py build_ext fails with a GCC error

Build report:

# python ./setup.py build_ext --inplace
Compiling av/error.pyx because it changed.
[1/1] Cythonizing av/error.pyx
Compiling av/_core.pyx because it changed.
[1/1] Cythonizing av/_core.pyx
Compiling av/logging.pyx because it changed.
[1/1] Cythonizing av/logging.pyx
Compiling av/format.pyx because it changed.
[1/1] Cythonizing av/format.pyx
Compiling av/frame.pyx because it changed.
[1/1] Cythonizing av/frame.pyx
Compiling av/utils.pyx because it changed.
[1/1] Cythonizing av/utils.pyx
Compiling av/enum.pyx because it changed.
[1/1] Cythonizing av/enum.pyx
Compiling av/dictionary.pyx because it changed.
[1/1] Cythonizing av/dictionary.pyx
Compiling av/plane.pyx because it changed.
[1/1] Cythonizing av/plane.pyx
Compiling av/packet.pyx because it changed.
[1/1] Cythonizing av/packet.pyx
Compiling av/bitstream.pyx because it changed.
[1/1] Cythonizing av/bitstream.pyx
Compiling av/buffer.pyx because it changed.
[1/1] Cythonizing av/buffer.pyx
Compiling av/bytesource.pyx because it changed.
[1/1] Cythonizing av/bytesource.pyx
Compiling av/stream.pyx because it changed.
[1/1] Cythonizing av/stream.pyx
Compiling av/option.pyx because it changed.
[1/1] Cythonizing av/option.pyx
Compiling av/descriptor.pyx because it changed.
[1/1] Cythonizing av/descriptor.pyx
Compiling av/container/streams.pyx because it changed.
[1/1] Cythonizing av/container/streams.pyx
Compiling av/container/core.pyx because it changed.
[1/1] Cythonizing av/container/core.pyx
Compiling av/container/input.pyx because it changed.
[1/1] Cythonizing av/container/input.pyx
Compiling av/container/output.pyx because it changed.
[1/1] Cythonizing av/container/output.pyx
Compiling av/container/pyio.pyx because it changed.
[1/1] Cythonizing av/container/pyio.pyx
Compiling av/video/format.pyx because it changed.
[1/1] Cythonizing av/video/format.pyx
Compiling av/video/frame.pyx because it changed.
[1/1] Cythonizing av/video/frame.pyx
Compiling av/video/plane.pyx because it changed.
[1/1] Cythonizing av/video/plane.pyx
Compiling av/video/reformatter.pyx because it changed.
[1/1] Cythonizing av/video/reformatter.pyx
Compiling av/video/codeccontext.pyx because it changed.
[1/1] Cythonizing av/video/codeccontext.pyx
Compiling av/video/stream.pyx because it changed.
[1/1] Cythonizing av/video/stream.pyx
Compiling av/filter/context.pyx because it changed.
[1/1] Cythonizing av/filter/context.pyx
Compiling av/filter/link.pyx because it changed.
[1/1] Cythonizing av/filter/link.pyx
Compiling av/filter/filter.pyx because it changed.
[1/1] Cythonizing av/filter/filter.pyx
Compiling av/filter/pad.pyx because it changed.
[1/1] Cythonizing av/filter/pad.pyx
Compiling av/filter/graph.pyx because it changed.
[1/1] Cythonizing av/filter/graph.pyx
Compiling av/codec/context.pyx because it changed.
[1/1] Cythonizing av/codec/context.pyx
Compiling av/codec/codec.pyx because it changed.
[1/1] Cythonizing av/codec/codec.pyx
Compiling av/data/stream.pyx because it changed.
[1/1] Cythonizing av/data/stream.pyx
Compiling av/subtitles/subtitle.pyx because it changed.
[1/1] Cythonizing av/subtitles/subtitle.pyx
Compiling av/subtitles/codeccontext.pyx because it changed.
[1/1] Cythonizing av/subtitles/codeccontext.pyx
Compiling av/subtitles/stream.pyx because it changed.
[1/1] Cythonizing av/subtitles/stream.pyx
Compiling av/audio/format.pyx because it changed.
[1/1] Cythonizing av/audio/format.pyx
Compiling av/audio/frame.pyx because it changed.
[1/1] Cythonizing av/audio/frame.pyx
Compiling av/audio/resampler.pyx because it changed.
[1/1] Cythonizing av/audio/resampler.pyx
Compiling av/audio/plane.pyx because it changed.
[1/1] Cythonizing av/audio/plane.pyx
Compiling av/audio/fifo.pyx because it changed.
[1/1] Cythonizing av/audio/fifo.pyx
Compiling av/audio/codeccontext.pyx because it changed.
[1/1] Cythonizing av/audio/codeccontext.pyx
Compiling av/audio/stream.pyx because it changed.
[1/1] Cythonizing av/audio/stream.pyx
Compiling av/audio/layout.pyx because it changed.
[1/1] Cythonizing av/audio/layout.pyx
Compiling av/sidedata/sidedata.pyx because it changed.
[1/1] Cythonizing av/sidedata/sidedata.pyx
Compiling av/sidedata/motionvectors.pyx because it changed.
[1/1] Cythonizing av/sidedata/motionvectors.pyx
running build_ext
building 'av.error' extension
creating build
creating build/temp.linux-x86_64-cpython-312
creating build/temp.linux-x86_64-cpython-312/src
creating build/temp.linux-x86_64-cpython-312/src/av
gcc -fno-strict-overflow -DNDEBUG -g -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 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python-av/src=/usr/src/debug/python-av -flto=auto -fPIC -I/usr/include/python3.12 -c src/av/error.c -o build/temp.linux-x86_64-cpython-312/src/av/error.o
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<command-line>: note: this is the location of the previous definition
creating build/lib.linux-x86_64-cpython-312
creating build/lib.linux-x86_64-cpython-312/av
gcc -shared -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python-av/src=/usr/src/debug/python-av -flto=auto build/temp.linux-x86_64-cpython-312/src/av/error.o -L/usr/lib -lavformat -lavcodec -lavdevice -lavutil -lavfilter -lswscale -lswresample -o build/lib.linux-x86_64-cpython-312/av/error.cpython-312-x86_64-linux-gnu.so
building 'av._core' extension
gcc -fno-strict-overflow -DNDEBUG -g -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 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python-av/src=/usr/src/debug/python-av -flto=auto -fPIC -I/usr/include/python3.12 -c src/av/_core.c -o build/temp.linux-x86_64-cpython-312/src/av/_core.o
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<command-line>: note: this is the location of the previous definition
gcc -shared -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python-av/src=/usr/src/debug/python-av -flto=auto build/temp.linux-x86_64-cpython-312/src/av/_core.o -L/usr/lib -lavformat -lavcodec -lavdevice -lavutil -lavfilter -lswscale -lswresample -o build/lib.linux-x86_64-cpython-312/av/_core.cpython-312-x86_64-linux-gnu.so
building 'av.logging' extension
gcc -fno-strict-overflow -DNDEBUG -g -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 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python-av/src=/usr/src/debug/python-av -flto=auto -fPIC -I/usr/include/python3.12 -c src/av/logging.c -o build/temp.linux-x86_64-cpython-312/src/av/logging.o
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<command-line>: note: this is the location of the previous definition
gcc -shared -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python-av/src=/usr/src/debug/python-av -flto=auto build/temp.linux-x86_64-cpython-312/src/av/logging.o -L/usr/lib -lavformat -lavcodec -lavdevice -lavutil -lavfilter -lswscale -lswresample -o build/lib.linux-x86_64-cpython-312/av/logging.cpython-312-x86_64-linux-gnu.so
building 'av.format' extension
gcc -fno-strict-overflow -DNDEBUG -g -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 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python-av/src=/usr/src/debug/python-av -flto=auto -fPIC -I/usr/include/python3.12 -c src/av/format.c -o build/temp.linux-x86_64-cpython-312/src/av/format.o
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<command-line>: note: this is the location of the previous definition
src/av/format.c: In function ‘__pyx_pf_2av_6format_15ContainerFormat___cinit__’:
src/av/format.c:3349:24: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 3349 |     __pyx_v_self->iptr = av_find_input_format(__pyx_t_4);
      |                        ^
src/av/format.c:3386:24: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 3386 |     __pyx_v_self->optr = av_guess_format(__pyx_t_5, NULL, NULL);
      |                        ^
gcc -shared -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python-av/src=/usr/src/debug/python-av -flto=auto build/temp.linux-x86_64-cpython-312/src/av/format.o -L/usr/lib -lavformat -lavcodec -lavdevice -lavutil -lavfilter -lswscale -lswresample -o build/lib.linux-x86_64-cpython-312/av/format.cpython-312-x86_64-linux-gnu.so
building 'av.frame' extension
gcc -fno-strict-overflow -DNDEBUG -g -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 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python-av/src=/usr/src/debug/python-av -flto=auto -fPIC -I/usr/include/python3.12 -c src/av/frame.c -o build/temp.linux-x86_64-cpython-312/src/av/frame.o
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<command-line>: note: this is the location of the previous definition
src/av/frame.c: In function ‘__pyx_f_2av_5frame_5Frame__copy_internal_attributes’:
src/av/frame.c:3739:5: warning: ‘channel_layout’ is deprecated [-Wdeprecated-declarations]
 3739 |     __pyx_t_1 = __pyx_v_source->ptr->channel_layout;
      |     ^~~~~~~~~
In file included from src/av/frame.c:1258:
/usr/include/libavutil/frame.h:575:14: note: declared here
  575 |     uint64_t channel_layout;
      |              ^~~~~~~~~~~~~~
src/av/frame.c:3740:5: warning: ‘channel_layout’ is deprecated [-Wdeprecated-declarations]
 3740 |     __pyx_v_self->ptr->channel_layout = __pyx_t_1;
      |     ^~~~~~~~~~~~
/usr/include/libavutil/frame.h:575:14: note: declared here
  575 |     uint64_t channel_layout;
      |              ^~~~~~~~~~~~~~
src/av/frame.c:3749:5: warning: ‘channels’ is deprecated [-Wdeprecated-declarations]
 3749 |     __pyx_t_1 = __pyx_v_source->ptr->channels;
      |     ^~~~~~~~~
/usr/include/libavutil/frame.h:731:9: note: declared here
  731 |     int channels;
      |         ^~~~~~~~
src/av/frame.c:3750:5: warning: ‘channels’ is deprecated [-Wdeprecated-declarations]
 3750 |     __pyx_v_self->ptr->channels = __pyx_t_1;
      |     ^~~~~~~~~~~~
/usr/include/libavutil/frame.h:731:9: note: declared here
  731 |     int channels;
      |         ^~~~~~~~
gcc -shared -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python-av/src=/usr/src/debug/python-av -flto=auto build/temp.linux-x86_64-cpython-312/src/av/frame.o -L/usr/lib -lavformat -lavcodec -lavdevice -lavutil -lavfilter -lswscale -lswresample -o build/lib.linux-x86_64-cpython-312/av/frame.cpython-312-x86_64-linux-gnu.so
building 'av.utils' extension
gcc -fno-strict-overflow -DNDEBUG -g -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 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python-av/src=/usr/src/debug/python-av -flto=auto -fPIC -I/usr/include/python3.12 -c src/av/utils.c -o build/temp.linux-x86_64-cpython-312/src/av/utils.o
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<command-line>: note: this is the location of the previous definition
gcc -shared -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python-av/src=/usr/src/debug/python-av -flto=auto build/temp.linux-x86_64-cpython-312/src/av/utils.o -L/usr/lib -lavformat -lavcodec -lavdevice -lavutil -lavfilter -lswscale -lswresample -o build/lib.linux-x86_64-cpython-312/av/utils.cpython-312-x86_64-linux-gnu.so
building 'av.enum' extension
gcc -fno-strict-overflow -DNDEBUG -g -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 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python-av/src=/usr/src/debug/python-av -flto=auto -fPIC -I/usr/include/python3.12 -c src/av/enum.c -o build/temp.linux-x86_64-cpython-312/src/av/enum.o
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<command-line>: note: this is the location of the previous definition
gcc -shared -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python-av/src=/usr/src/debug/python-av -flto=auto build/temp.linux-x86_64-cpython-312/src/av/enum.o -L/usr/lib -lavformat -lavcodec -lavdevice -lavutil -lavfilter -lswscale -lswresample -o build/lib.linux-x86_64-cpython-312/av/enum.cpython-312-x86_64-linux-gnu.so
building 'av.dictionary' extension
gcc -fno-strict-overflow -DNDEBUG -g -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 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python-av/src=/usr/src/debug/python-av -flto=auto -fPIC -I/usr/include/python3.12 -c src/av/dictionary.c -o build/temp.linux-x86_64-cpython-312/src/av/dictionary.o
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<command-line>: note: this is the location of the previous definition
gcc -shared -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python-av/src=/usr/src/debug/python-av -flto=auto build/temp.linux-x86_64-cpython-312/src/av/dictionary.o -L/usr/lib -lavformat -lavcodec -lavdevice -lavutil -lavfilter -lswscale -lswresample -o build/lib.linux-x86_64-cpython-312/av/dictionary.cpython-312-x86_64-linux-gnu.so
building 'av.plane' extension
gcc -fno-strict-overflow -DNDEBUG -g -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 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python-av/src=/usr/src/debug/python-av -flto=auto -fPIC -I/usr/include/python3.12 -c src/av/plane.c -o build/temp.linux-x86_64-cpython-312/src/av/plane.o
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<command-line>: note: this is the location of the previous definition
gcc -shared -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python-av/src=/usr/src/debug/python-av -flto=auto build/temp.linux-x86_64-cpython-312/src/av/plane.o -L/usr/lib -lavformat -lavcodec -lavdevice -lavutil -lavfilter -lswscale -lswresample -o build/lib.linux-x86_64-cpython-312/av/plane.cpython-312-x86_64-linux-gnu.so
building 'av.packet' extension
gcc -fno-strict-overflow -DNDEBUG -g -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 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python-av/src=/usr/src/debug/python-av -flto=auto -fPIC -I/usr/include/python3.12 -c src/av/packet.c -o build/temp.linux-x86_64-cpython-312/src/av/packet.o
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<command-line>: note: this is the location of the previous definition
gcc -shared -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python-av/src=/usr/src/debug/python-av -flto=auto build/temp.linux-x86_64-cpython-312/src/av/packet.o -L/usr/lib -lavformat -lavcodec -lavdevice -lavutil -lavfilter -lswscale -lswresample -o build/lib.linux-x86_64-cpython-312/av/packet.cpython-312-x86_64-linux-gnu.so
building 'av.bitstream' extension
gcc -fno-strict-overflow -DNDEBUG -g -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 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python-av/src=/usr/src/debug/python-av -flto=auto -fPIC -I/usr/include/python3.12 -c src/av/bitstream.c -o build/temp.linux-x86_64-cpython-312/src/av/bitstream.o
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<command-line>: note: this is the location of the previous definition
src/av/bitstream.c: In function ‘__pyx_pf_2av_9bitstream_22BitStreamFilterContext___cinit__’:
src/av/bitstream.c:3517:66: error: passing argument 2 of ‘av_bsf_list_parse_str’ from incompatible pointer type [-Wincompatible-pointer-types]
 3517 |         __pyx_v_res = av_bsf_list_parse_str(__pyx_v_filter_str, (&__pyx_v_self->ptr));
      |                                                                 ~^~~~~~~~~~~~~~~~~~~
      |                                                                  |
      |                                                                  const struct AVBSFContext **
In file included from src/av/bitstream.c:1270:
/usr/include/libavcodec/bsf.h:317:59: note: expected ‘AVBSFContext **’ but argument is of type ‘const struct AVBSFContext **’
  317 | int av_bsf_list_parse_str(const char *str, AVBSFContext **bsf);
      |                                            ~~~~~~~~~~~~~~~^~~
src/av/bitstream.c:3644:47: warning: passing argument 1 of ‘av_bsf_init’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 3644 |         __pyx_v_res = av_bsf_init(__pyx_v_self->ptr);
      |                                   ~~~~~~~~~~~~^~~~~
/usr/include/libavcodec/bsf.h:170:31: note: expected ‘AVBSFContext *’ but argument is of type ‘const struct AVBSFContext *’
  170 | int av_bsf_init(AVBSFContext *ctx);
      |                 ~~~~~~~~~~~~~~^~~
src/av/bitstream.c: In function ‘__pyx_pf_2av_9bitstream_22BitStreamFilterContext_2__dealloc__’:
src/av/bitstream.c:3816:18: error: passing argument 1 of ‘av_bsf_free’ from incompatible pointer type [-Wincompatible-pointer-types]
 3816 |     av_bsf_free((&__pyx_v_self->ptr));
      |                 ~^~~~~~~~~~~~~~~~~~~
      |                  |
      |                  const struct AVBSFContext **
/usr/include/libavcodec/bsf.h:233:33: note: expected ‘AVBSFContext **’ but argument is of type ‘const struct AVBSFContext **’
  233 | void av_bsf_free(AVBSFContext **ctx);
      |                  ~~~~~~~~~~~~~~~^~~
src/av/bitstream.c: In function ‘__pyx_f_2av_9bitstream_22BitStreamFilterContext_filter’:
src/av/bitstream.c:3961:54: warning: passing argument 1 of ‘av_bsf_send_packet’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 3961 |         __pyx_v_res = av_bsf_send_packet(__pyx_v_self->ptr, __pyx_t_6);
      |                                          ~~~~~~~~~~~~^~~~~
/usr/include/libavcodec/bsf.h:193:38: note: expected ‘AVBSFContext *’ but argument is of type ‘const struct AVBSFContext *’
  193 | int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt);
      |                        ~~~~~~~~~~~~~~^~~
src/av/bitstream.c:4048:59: warning: passing argument 1 of ‘av_bsf_receive_packet’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 4048 |           __pyx_v_res = av_bsf_receive_packet(__pyx_v_self->ptr, __pyx_v_new_packet->ptr);
      |                                               ~~~~~~~~~~~~^~~~~
/usr/include/libavcodec/bsf.h:222:41: note: expected ‘AVBSFContext *’ but argument is of type ‘const struct AVBSFContext *’
  222 | int av_bsf_receive_packet(AVBSFContext *ctx, AVPacket *pkt);
      |                           ~~~~~~~~~~~~~~^~~
src/av/bitstream.c: In function ‘__pyx_f_2av_9bitstream_22BitStreamFilterContext_flush’:
src/av/bitstream.c:4407:28: warning: passing argument 1 of ‘av_bsf_flush’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 4407 |   av_bsf_flush(__pyx_v_self->ptr);
      |                ~~~~~~~~~~~~^~~~~
/usr/include/libavcodec/bsf.h:227:33: note: expected ‘AVBSFContext *’ but argument is of type ‘const struct AVBSFContext *’
  227 | void av_bsf_flush(AVBSFContext *ctx);
      |                   ~~~~~~~~~~~~~~^~~
error: command '/usr/bin/gcc' failed with exit code 1

Investigation

I tried to build the previous version of PyAV 12.0.0 with the same toolchain to ensure that this is not connected to a recent GCC upgrade (or changed libraries). It built successfully.

Reproduction

  1. unpack the source archive
  2. run python setup.py build_ext

Versions

Research

I have done the following:

WyattBlue commented 1 month ago

Are you using ffmpeg7, the 12 series still needs ffmpeg 6 or ffmpeg 5

christophfink commented 1 month ago

No, it’s ffmpeg 6.1.1

(edit: but I see that ffmpeg 7 is in the staging repositories for Arch, so this will, indeed, be an issue over here in a matter of days or weeks)

WyattBlue commented 1 month ago

Try applying this diff:

--- a/av/bitstream.pxd
+++ b/av/bitstream.pxd
@@ -5,7 +5,7 @@ from av.packet cimport Packet

 cdef class BitStreamFilterContext:

-    cdef const lib.AVBSFContext *ptr
+    cdef lib.AVBSFContext *ptr

     cpdef filter(self, Packet packet=?)
     cpdef flush(self)
christophfink commented 1 month ago

Thanks, with this change it builds successfully

jlaine commented 1 month ago

Try applying this diff:

--- a/av/bitstream.pxd
+++ b/av/bitstream.pxd
@@ -5,7 +5,7 @@ from av.packet cimport Packet

 cdef class BitStreamFilterContext:

-    cdef const lib.AVBSFContext *ptr
+    cdef lib.AVBSFContext *ptr

     cpdef filter(self, Packet packet=?)
     cpdef flush(self)

If this fix is required on the 12.x series it's a shame you prematurely dropped Python 3.8..

WyattBlue commented 1 month ago

@jlaine Not an issue if you make separate branches

WyattBlue commented 1 month ago

This isn't worth making a new release over. Debian distros still use gcc 12, Mac and Windows are unaffected, the AUR people will apply a patch. Plus each release takes an ungodly amount of space on PyPI.

christophfink commented 1 month ago

the AUR people will apply a patch I did already: https://aur.archlinux.org/packages/python-av