PF4Public / gentoo-overlay

Personal Gentoo overlay
76 stars 17 forks source link

www-client/ungoogled-chromium-117.0.5938.132_p1: fails to compile with ffmpeg-6: ../../media/filters/ffmpeg_demuxer.cc:114:7: error: use of undeclared identifier 'av_stream_get_first_dts'; did you mean 'av_stream_get_end_pts'? #260

Closed fordfrog closed 11 months ago

fordfrog commented 11 months ago

using system ffmpeg:

[ebuild   R   #] www-client/ungoogled-chromium-117.0.5938.132_p1::pf4public  USE="X bluetooth clang convert-dict cups hevc nvidia official optimize-thinlto optimize-webui pgo proprietary-codecs pulseaudio qt5 qt6 system-brotli system-crc32c system-double-conversion system-ffmpeg system-harfbuzz system-icu system-jsoncpp system-libevent system-libusb system-openh264 system-openjpeg system-png system-snappy system-woff2 thinlto vaapi widevine -cfi -custom-cflags -debug -enable-driver -gtk4 -hangouts -headless -kerberos -override-data-dir -pax-kernel -pic -screencast (-selinux) -suid -system-abseil-cpp -system-av1 -system-libvpx -system-re2 -uazo-bromite -wayland" L10N="cs -af -am -ar -bg -bn -ca -da -de -el -en-GB -es -es-419 -et -fa -fi -fil -fr -gu -he -hi -hr -hu -id -it -ja -kn -ko -lt -lv -ml -mr -ms -nb -nl -pl -pt-BR -pt-PT -ro -ru -sk -sl -sr -sv -sw -ta -te -th -tr -uk -ur -vi -zh-CN -zh-TW" 0 KiB

i just yesterday updated my systems to ffmpeg-6 and this was so far the only failure during compilation:

[29766/51209] x86_64-pc-linux-gnu-clang++ -MMD -MF obj/media/filters/filters/ffmpeg_demuxer.o.d -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D_GNU_SOURCE -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 
-DIS_MEDIA_IMPL -DUSE_PULSEAUDIO -DDLOPEN_PULSEAUDIO -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_56 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_56 -DBASE_USE_PERFETTO_CLIENT_LIBRARY=1 -DSK_ENABLE_SKSL -DSK_UNTIL_CRBUG_1187654_IS_FIXED -DSK_USER_CONFIG_HEADER=\"../../skia/config/SkUserConfig.h\" -DSK_WIN_FONTMGR_NO_SIMULATIONS -DSK_DISABLE_LEGACY_SKSURFACE_METHODS 
-DSK_DISABLE_LEGACY_GRAPHITE_IMAGE_FACTORIES -DSK_DISABLE_LEGACY_GRAPHITE_IMAGE_METHODS -DSK_DISABLE_LEGACY_SKSURFACE_FACTORIES -DSK_DISABLE_LEGACY_SKSURFACE_FLUSH -DSK_DISABLE_LEGACY_SKSURFACE_AS_IMAGE -DSK_DISABLE_LEGACY_SKSURFACE_DISPLAYLIST -DSK_DISABLE_LEGACY_IMAGE_SUBSET_METHODS -DSK_DISABLE_LEGACY_IMAGE_COLORSPACE_METHODS -DSK_DISABLE_LEGACY_IMAGE_RELEAS
E_PROCS -DSK_DISABLE_LEGACY_GL_BACKEND_SURFACE -DSK_CODEC_DECODES_JPEG -DSK_CODEC_DECODES_PNG -DSK_CODEC_DECODES_WEBP -DSK_ENCODE_JPEG -DSK_ENCODE_PNG -DSK_ENCODE_WEBP -DSK_HAS_WUFFS_LIBRARY -DSK_DISABLE_LEGACY_CANVAS_FLUSH -DSK_LEGACY_GPU_GETTERS_CONST -DSK_GANESH -DSK_GPU_WORKAROUNDS_HEADER=\"gpu/config/gpu_driver_bug_workaround_autogen.h\" -DSK_GL -DSK_VULKA
N=1 -DSK_GRAPHITE -DVK_USE_PLATFORM_XCB_KHR -DUSE_EGL -DLIBYUV_DISABLE_NEON -DUSING_SYSTEM_ICU=1 -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC -DU_IMPORT=U_EXPORT -DCRASHPAD_ZLIB_SOURCE_EXTERNAL -DUSE_SYSTEM_ZLIB=1 -DCONFIG_LOG=0 -DHAVE_PTHREAD_GETAFFINITY_NP=1 -DHAVE_PTHREAD_SETAFFINITY_NP=1 -DDAV1D_API= -I../.. -Igen -I../../third_party/perfetto/include -Igen/thi
rd_party/perfetto/build_config -Igen/third_party/perfetto -Igen/shim_headers/zlib_shim -Igen/shim_headers/jsoncpp_shim -Igen/shim_headers/double_conversion_shim -Igen/shim_headers/libevent_shim -Igen/shim_headers/icui18n_shim -Igen/shim_headers/icuuc_shim -I../../third_party/skia -Igen/third_party/skia -I../../third_party/wuffs/src/release/c -I../../third_party
/vulkan/include -I../../third_party/vulkan-deps/vulkan-headers/src/include -Igen/shim_headers/libpng_shim -Igen/shim_headers/libwebp_shim -I../../net/third_party/quiche/overrides -I../../net/third_party/quiche/src/quiche/common/platform/default -I../../net/third_party/quiche/src -Igen/shim_headers/brotli_shim -Igen/shim_headers/libXNVCtrl_shim -Igen/third_party
/dawn/include -I../../third_party/dawn/include -I../../third_party/khronos -I../../gpu -I../../third_party/libyuv/include -Igen/shim_headers/ffmpeg_shim -Igen/shim_headers/openh264_shim -Igen/shim_headers/opus_shim -I../../third_party/abseil-cpp -I../../third_party/boringssl/src/include -I../../third_party/protobuf/src -Igen/protoc_out -I../../third_party/mesa_
headers -I../../third_party/ipcz/include -I../../third_party/ced/src -I../../third_party/crashpad/crashpad -I../../third_party/crashpad/crashpad/compat/linux -I../../third_party/crashpad/crashpad/compat/non_win -I../../third_party/libaom/source/libaom -I../../third_party/libvpx/source/libvpx -I../../third_party/dav1d/version -Wimplicit-fallthrough -Wextra-semi 
-Wunreachable-code-aggressive -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-psabi -Wloop-analysis -Wno-unneeded-internal-declaration -Wenum-compare-conditional -Wno-ignored-pragma-optimize -Wno-deprecated-builtins -Wno-bitfield-constant-conversion -Wno-deprecated-this-capture -Wshadow -fno-delete-null-pointer-checks -fno-ident -fno-
strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -flto=thin -fsplit-lto-unit -fwhole-program-vtables -no-canonical-prefixes -ftrivial-auto-var-init=pattern -O2 -fdata-sections -ffunction-sections -fno-unique-section-names -fno-omit-frame-pointe
r -g0 -fprofile-use=../../chrome/build/pgo_profiles/chrome-linux-5938-1694538110-0c18cf4b1d955dedaa35a61d3e46b14386cd9e41.profdata -Wno-profile-instr-unprofiled -Wno-profile-instr-out-of-date -Wno-backend-plugin -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wexit-time-destructors -I/usr/include/glib-2.0 -I/usr/lib64/gl
ib-2.0/include -I/usr/lib64/libffi/include -Wno-redundant-parens -Wno-redundant-parens -DPROTOBUF_ALLOW_DEPRECATED=1 -I/usr/include/opus -std=c++20 -Wno-trigraphs -gsimple-template-names -fno-exceptions -fno-rtti -fvisibility-inlines-hidden  -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -march=rocketlake -pipe -frecord-gcc-switches -Wno-unknown-warning-option -Wno-b
uiltin-macro-redefined -c ../../media/filters/ffmpeg_demuxer.cc -o obj/media/filters/filters/ffmpeg_demuxer.o
FAILED: obj/media/filters/filters/ffmpeg_demuxer.o 
x86_64-pc-linux-gnu-clang++ -MMD -MF obj/media/filters/filters/ffmpeg_demuxer.o.d -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D_GNU_SOURCE -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DIS_MEDIA_IMP
L -DUSE_PULSEAUDIO -DDLOPEN_PULSEAUDIO -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_56 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_56 -DBASE_USE_PERFETTO_CLIENT_LIBRARY=1 -DSK_ENABLE_SKSL -DSK_UNTIL_CRBUG_1187654_IS_FIXED -DSK_USER_CONFIG_HEADER=\"../../skia/config/SkUserConfig.h\" -DSK_WIN_FONTMGR_NO_SIMULATIONS -DSK_DISABLE_LEGACY_SKSURFACE_METHODS -DSK_DISABLE_L
EGACY_GRAPHITE_IMAGE_FACTORIES -DSK_DISABLE_LEGACY_GRAPHITE_IMAGE_METHODS -DSK_DISABLE_LEGACY_SKSURFACE_FACTORIES -DSK_DISABLE_LEGACY_SKSURFACE_FLUSH -DSK_DISABLE_LEGACY_SKSURFACE_AS_IMAGE -DSK_DISABLE_LEGACY_SKSURFACE_DISPLAYLIST -DSK_DISABLE_LEGACY_IMAGE_SUBSET_METHODS -DSK_DISABLE_LEGACY_IMAGE_COLORSPACE_METHODS -DSK_DISABLE_LEGACY_IMAGE_RELEASE_PROCS -DSK_D
ISABLE_LEGACY_GL_BACKEND_SURFACE -DSK_CODEC_DECODES_JPEG -DSK_CODEC_DECODES_PNG -DSK_CODEC_DECODES_WEBP -DSK_ENCODE_JPEG -DSK_ENCODE_PNG -DSK_ENCODE_WEBP -DSK_HAS_WUFFS_LIBRARY -DSK_DISABLE_LEGACY_CANVAS_FLUSH -DSK_LEGACY_GPU_GETTERS_CONST -DSK_GANESH -DSK_GPU_WORKAROUNDS_HEADER=\"gpu/config/gpu_driver_bug_workaround_autogen.h\" -DSK_GL -DSK_VULKAN=1 -DSK_GRAPH
ITE -DVK_USE_PLATFORM_XCB_KHR -DUSE_EGL -DLIBYUV_DISABLE_NEON -DUSING_SYSTEM_ICU=1 -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC -DU_IMPORT=U_EXPORT -DCRASHPAD_ZLIB_SOURCE_EXTERNAL -DUSE_SYSTEM_ZLIB=1 -DCONFIG_LOG=0 -DHAVE_PTHREAD_GETAFFINITY_NP=1 -DHAVE_PTHREAD_SETAFFINITY_NP=1 -DDAV1D_API= -I../.. -Igen -I../../third_party/perfetto/include -Igen/third_party/perfe
tto/build_config -Igen/third_party/perfetto -Igen/shim_headers/zlib_shim -Igen/shim_headers/jsoncpp_shim -Igen/shim_headers/double_conversion_shim -Igen/shim_headers/libevent_shim -Igen/shim_headers/icui18n_shim -Igen/shim_headers/icuuc_shim -I../../third_party/skia -Igen/third_party/skia -I../../third_party/wuffs/src/release/c -I../../third_party/vulkan/includ
e -I../../third_party/vulkan-deps/vulkan-headers/src/include -Igen/shim_headers/libpng_shim -Igen/shim_headers/libwebp_shim -I../../net/third_party/quiche/overrides -I../../net/third_party/quiche/src/quiche/common/platform/default -I../../net/third_party/quiche/src -Igen/shim_headers/brotli_shim -Igen/shim_headers/libXNVCtrl_shim -Igen/third_party/dawn/include 
-I../../third_party/dawn/include -I../../third_party/khronos -I../../gpu -I../../third_party/libyuv/include -Igen/shim_headers/ffmpeg_shim -Igen/shim_headers/openh264_shim -Igen/shim_headers/opus_shim -I../../third_party/abseil-cpp -I../../third_party/boringssl/src/include -I../../third_party/protobuf/src -Igen/protoc_out -I../../third_party/mesa_headers -I../.
./third_party/ipcz/include -I../../third_party/ced/src -I../../third_party/crashpad/crashpad -I../../third_party/crashpad/crashpad/compat/linux -I../../third_party/crashpad/crashpad/compat/non_win -I../../third_party/libaom/source/libaom -I../../third_party/libvpx/source/libvpx -I../../third_party/dav1d/version -Wimplicit-fallthrough -Wextra-semi -Wunreachable-
code-aggressive -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-psabi -Wloop-analysis -Wno-unneeded-internal-declaration -Wenum-compare-conditional -Wno-ignored-pragma-optimize -Wno-deprecated-builtins -Wno-bitfield-constant-conversion -Wno-deprecated-this-capture -Wshadow -fno-delete-null-pointer-checks -fno-ident -fno-strict-aliasin
g --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -flto=thin -fsplit-lto-unit -fwhole-program-vtables -no-canonical-prefixes -ftrivial-auto-var-init=pattern -O2 -fdata-sections -ffunction-sections -fno-unique-section-names -fno-omit-frame-pointer -g0 -fprofil
e-use=../../chrome/build/pgo_profiles/chrome-linux-5938-1694538110-0c18cf4b1d955dedaa35a61d3e46b14386cd9e41.profdata -Wno-profile-instr-unprofiled -Wno-profile-instr-out-of-date -Wno-backend-plugin -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wexit-time-destructors -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include
 -I/usr/lib64/libffi/include -Wno-redundant-parens -Wno-redundant-parens -DPROTOBUF_ALLOW_DEPRECATED=1 -I/usr/include/opus -std=c++20 -Wno-trigraphs -gsimple-template-names -fno-exceptions -fno-rtti -fvisibility-inlines-hidden  -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -march=rocketlake -pipe -frecord-gcc-switches -Wno-unknown-warning-option -Wno-builtin-macro-r
edefined -c ../../media/filters/ffmpeg_demuxer.cc -o obj/media/filters/filters/ffmpeg_demuxer.o
../../media/filters/ffmpeg_demuxer.cc:114:7: error: use of undeclared identifier 'av_stream_get_first_dts'; did you mean 'av_stream_get_end_pts'?
  114 |   if (av_stream_get_first_dts(stream) != kNoFFmpegTimestamp &&
      |       ^~~~~~~~~~~~~~~~~~~~~~~
      |       av_stream_get_end_pts
/usr/include/libavformat/avformat.h:1019:12: note: 'av_stream_get_end_pts' declared here
 1019 | int64_t    av_stream_get_end_pts(const AVStream *st);
      |            ^
../../media/filters/ffmpeg_demuxer.cc:114:7: warning: 'av_stream_get_end_pts' is deprecated [-Wdeprecated-declarations]
  114 |   if (av_stream_get_first_dts(stream) != kNoFFmpegTimestamp &&
      |       ^
/usr/include/libavformat/avformat.h:1018:1: note: 'av_stream_get_end_pts' has been explicitly marked deprecated here
 1018 | attribute_deprecated
      | ^
/usr/include/libavutil/attributes.h:100:49: note: expanded from macro 'attribute_deprecated'
  100 | #    define attribute_deprecated __attribute__((deprecated))
      |                                                 ^
../../media/filters/ffmpeg_demuxer.cc:119:48: error: use of undeclared identifier 'av_stream_get_first_dts'; did you mean 'av_stream_get_end_pts'?
  119 |         ConvertFromTimeBase(stream->time_base, av_stream_get_first_dts(stream));
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~
      |                                                av_stream_get_end_pts
/usr/include/libavformat/avformat.h:1019:12: note: 'av_stream_get_end_pts' declared here
 1019 | int64_t    av_stream_get_end_pts(const AVStream *st);
      |            ^
../../media/filters/ffmpeg_demuxer.cc:119:48: warning: 'av_stream_get_end_pts' is deprecated [-Wdeprecated-declarations]
  119 |         ConvertFromTimeBase(stream->time_base, av_stream_get_first_dts(stream));
      |                                                ^
/usr/include/libavformat/avformat.h:1018:1: note: 'av_stream_get_end_pts' has been explicitly marked deprecated here
 1018 | attribute_deprecated
      | ^
/usr/include/libavutil/attributes.h:100:49: note: expanded from macro 'attribute_deprecated'
  100 | #    define attribute_deprecated __attribute__((deprecated))
      |                                                 ^
../../media/filters/ffmpeg_demuxer.cc:1618:9: error: use of undeclared identifier 'av_stream_get_first_dts'; did you mean 'av_stream_get_end_pts'?
 1618 |     if (av_stream_get_first_dts(stream->av_stream()) == kInvalidPTSMarker)
      |         ^~~~~~~~~~~~~~~~~~~~~~~
      |         av_stream_get_end_pts
/usr/include/libavformat/avformat.h:1019:12: note: 'av_stream_get_end_pts' declared here
 1019 | int64_t    av_stream_get_end_pts(const AVStream *st);
      |            ^
../../media/filters/ffmpeg_demuxer.cc:1618:9: warning: 'av_stream_get_end_pts' is deprecated [-Wdeprecated-declarations]
 1618 |     if (av_stream_get_first_dts(stream->av_stream()) == kInvalidPTSMarker)
      |         ^
/usr/include/libavformat/avformat.h:1018:1: note: 'av_stream_get_end_pts' has been explicitly marked deprecated here
 1018 | attribute_deprecated
      | ^
/usr/include/libavutil/attributes.h:100:49: note: expanded from macro 'attribute_deprecated'
  100 | #    define attribute_deprecated __attribute__((deprecated))
      |                                                 ^
../../media/filters/ffmpeg_demuxer.cc:1639:9: error: use of undeclared identifier 'av_stream_get_first_dts'; did you mean 'av_stream_get_end_pts'?
 1639 |     if (av_stream_get_first_dts(stream->av_stream()) == kInvalidPTSMarker)
      |         ^~~~~~~~~~~~~~~~~~~~~~~
      |         av_stream_get_end_pts
/usr/include/libavformat/avformat.h:1019:12: note: 'av_stream_get_end_pts' declared here
 1019 | int64_t    av_stream_get_end_pts(const AVStream *st);
      |            ^
../../media/filters/ffmpeg_demuxer.cc:1639:9: warning: 'av_stream_get_end_pts' is deprecated [-Wdeprecated-declarations]
 1639 |     if (av_stream_get_first_dts(stream->av_stream()) == kInvalidPTSMarker)
      |         ^
/usr/include/libavformat/avformat.h:1018:1: note: 'av_stream_get_end_pts' has been explicitly marked deprecated here
 1018 | attribute_deprecated
      | ^
/usr/include/libavutil/attributes.h:100:49: note: expanded from macro 'attribute_deprecated'
  100 | #    define attribute_deprecated __attribute__((deprecated))
      |                                                 ^
4 warnings and 4 errors generated.

before i had media-video/ffmpeg-4.4.4-r4 and now i'm on media-video/ffmpeg-6.0-r6.

PF4Public commented 11 months ago

You should've gotten this warning, have you not? https://github.com/PF4Public/gentoo-overlay/blob/843c15b2bcc926a222f14c5ba8724f9b8efc4cce/www-client/ungoogled-chromium/ungoogled-chromium-117.0.5938.132_p1.ebuild#L508

fordfrog commented 11 months ago

You should've gotten this warning, have you not?

https://github.com/PF4Public/gentoo-overlay/blob/843c15b2bcc926a222f14c5ba8724f9b8efc4cce/www-client/ungoogled-chromium/ungoogled-chromium-117.0.5938.132_p1.ebuild#L508

sorry, i really did not notice that warning. i found some older ffmpeg patch and adjusted it to apply, now testing the build on one of my machines. thank you for pointing this out.

fordfrog commented 11 months ago

so i got the patch wrong. chromium compiles, but does not link...

EDIT: got it to link now

PF4Public commented 11 months ago

Did you patch ungoogled-chromium? You shouldn't. You should patch ffmpeg to expose missing method first and then build ungoogled-chromium as usual. You could use a patch from Arch for example: https://gitlab.archlinux.org/archlinux/packaging/packages/ffmpeg/-/blob/main/add-av_stream_get_first_dts-for-chromium.patch?ref_type=heads

fordfrog commented 11 months ago

i patched ffmpeg, just my patch wasn't complete. i used something similar as you posted here, just the patch was older and it did not apply cleanly so i had to redo it. i just also checked the ffmpeg ebuild and though it has a chromium use flag, it's for something different.

PF4Public commented 11 months ago

@arbitrary-dev May I ask, what made you confused? :D

arbitrary-dev commented 11 months ago

@PF4Public Just don't like making manual patching :)

PF4Public commented 11 months ago

@arbitrary-dev Perhaps it would be possible to get this patch into Gentoo behind masked-by-default flag