shinchiro / mpv-winbuild-cmake

CMake-based MinGW-w64 Cross Toolchain
603 stars 109 forks source link

ffmpeg configure failed because libjxl >= 0.7.0 not found using pkg-config #207

Closed zhongfly closed 2 years ago

zhongfly commented 2 years ago

When doing a fresh build with the current latest commit, ffmpeg configure failed due to ERROR: libjxl >= 0.7.0 not found using pkg-config logs: logs.zip

https://github.com/zhongfly/mpv-winbuild/runs/6273516808?check_suite_focus=true

zhongfly commented 2 years ago

a simpler example,using https://github.com/shinchiro/mpv-winbuild-cmake/commit/96f8b952b1eb2a1c98148e901263cc30b24edded https://github.com/zhongfly/mpv-winbuild-example/runs/6273688929?check_suite_focus=true

build command:

cd mpv-winbuild-cmake
cmake -DTARGET_ARCH=x86_64-w64-mingw32 -DALWAYS_REMOVE_BUILDFILES=ON -DSINGLE_SOURCE_LOCATION=$PWD/src_packages -G Ninja -Bbuild64 -H.
ninja -C build64 download || true
if [[ ! "$(ls -A build64/install/bin)" ]]; then ninja -C build64 gcc; fi
ninja -C build64 update
ninja -C build64 mpv
qwerty12 commented 2 years ago

I ran into that over @ #205. Adding -DJXL_STATIC_DEFINE -DJXL_THREADS_STATIC_DEFINE to the ffmpeg extra-cflags worked to solve that, but then ffmpeg couldn't link its test program properly anyway - gcc (which ffmpeg shouldn't be using) wanted functions from libstdc++

shinchiro commented 2 years ago

ffmpeg's configure failed because it cannot find libjxl. I assume its gha limitation (timeout?) to kill long process since libjxl's building takes longer time. Try to do ninja libjxl and ninja mpv afterward when starting fresh build

shinchiro commented 2 years ago

Can you test again with current master branch? Just do ninja mpv

zhongfly commented 2 years ago

Can you test again with current master branch? Just do ninja mpv

ok,https://github.com/zhongfly/mpv-winbuild-example/actions/runs/2267596937

zhongfly commented 2 years ago

Now the build works fine

zhongfly commented 2 years ago

The problem reappears, ninja libjxl-fullclean is required before each build, otherwise ffmpeg still configure failed because libjxl >= 0.7.0 not found using pkg-config

The patch seems to only work the first time, and the ffmpeg build fails without patching on the next build after that

[11/34] No update step for 'libjxl'
[12/34] Symlinking brotli
[13/34] Performing patch step for 'libjxl'
Applying: fix pkgconfig file
[14/34] Performing configure step for 'libjxl'
[15/34] Performing build step for 'libjxl'
[16/34] Performing install step for 'libjxl'
[17/34] Performing fix-lib step for 'libjxl'
[18/34] Deleting build directory of libjxl package after install
[19/34] Completed 'libjxl'
[20/34] No update step for 'ffmpeg'
[21/34] No patch step for 'ffmpeg'
[22/34] Performing configure step for 'ffmpeg'
[23/34] Performing build step for 'ffmpeg'
[24/34] Performing install step for 'ffmpeg'
[25/34] Deleting build directory of ffmpeg package after install
[26/34] Completed 'ffmpeg'
[10/29] Completed 'highway'
[11/29] Performing configure step for 'libjxl'
[12/29] Performing build step for 'libjxl'
[13/29] Performing install step for 'libjxl'
[14/29] Performing fix-lib step for 'libjxl'
[15/29] Deleting build directory of libjxl package after install
[16/29] Completed 'libjxl'
[17/29] Performing configure step for 'ffmpeg'
FAILED: packages/ffmpeg-prefix/src/ffmpeg-stamp/ffmpeg-configure /__w/mpv-winbuild/mpv-winbuild/mpv-winbuild-cmake/build64/packages/ffmpeg-prefix/src/ffmpeg-stamp/ffmpeg-configure 
cd /__w/mpv-winbuild/mpv-winbuild/mpv-winbuild-cmake/build64/packages/ffmpeg-prefix/src/ffmpeg-build && /usr/bin/cmake -P /__w/mpv-winbuild/mpv-winbuild/mpv-winbuild-cmake/build64/packages/ffmpeg-prefix/src/ffmpeg-stamp/ffmpeg-configure-.cmake && /usr/bin/cmake -E touch /__w/mpv-winbuild/mpv-winbuild/mpv-winbuild-cmake/build64/packages/ffmpeg-prefix/src/ffmpeg-stamp/ffmpeg-configure
CMake Error at /__w/mpv-winbuild/mpv-winbuild/mpv-winbuild-cmake/build64/packages/ffmpeg-prefix/src/ffmpeg-stamp/ffmpeg-configure-.cmake:49 (message):
  Command failed: 1

   '/__w/mpv-winbuild/mpv-winbuild/mpv-winbuild-cmake/build64/exec' '/__w/mpv-winbuild/mpv-winbuild/mpv-winbuild-cmake/src_packages/ffmpeg/configure' '--cross-prefix=x86_64-w64-mingw32-' '--prefix=/__w/mpv-winbuild/mpv-winbuild/mpv-winbuild-cmake/build64/install/mingw' '--arch=x86_64' '--target-os=mingw32' '--target-exec=wine' '--pkg-config-flags=--static' '--enable-cross-compile' '--enable-runtime-cpudetect' '--enable-gpl' '--enable-version3' '--enable-nonfree' '--enable-postproc' '--enable-avisynth' '--enable-vapoursynth' '--enable-gmp' '--enable-libass' '--enable-libbluray' '--enable-libfreetype' '--enable-libfribidi' '--enable-libmodplug' '--enable-libopenmpt' '--enable-libmp3lame' '--enable-libopus' '--enable-libsoxr' '--enable-libspeex' '--enable-libvorbis' '--enable-libbs2b' '--enable-libvpx' '--enable-libwebp' '--enable-libx264' '--enable-libx265' '--enable-libaom' '--enable-libdav1d' '--enable-libxvid' '--enable-libzimg' '--enable-libtls' '--enable-libxml2' '--enable-libmysofa' '--enable-libssh' '--enable-libsrt' '--enable-libmfx' '--enable-libjxl' '--enable-cuda' '--enable-cuvid' '--enable-nvdec' '--enable-nvenc' '--enable-amf' '--disable-doc' '--disable-decoder=libaom_av1'

  See also

    /__w/mpv-winbuild/mpv-winbuild/mpv-winbuild-cmake/build64/packages/ffmpeg-prefix/src/ffmpeg-stamp/ffmpeg-configure-*.log

ninja: build stopped: subcommand failed.
mitzsch commented 2 years ago

I´m having the same issue. When uncommenting libjxl the next package is not found by pkg-config... Uncommenting the new mentioned package won´t help either, as the next one is not found by pkg-config... So this is some sort of problem with FFmpeg not finding its stuff with pkg-config and not really a libjxl issue.

I also tried starting from scratch but every time it's stuck at the same ffmpeg configure step... xxx not found by pkg-config

zhongfly commented 2 years ago

I think the issue isn't fully resolved and still occurs occasionally

https://github.com/shinchiro/mpv-winbuild-cmake/runs/6480576212?check_suite_focus=true#step:10:371 https://github.com/zhongfly/mpv-winbuild/actions/runs/2338447654

zhongfly commented 2 years ago

I found that running ninja highway-fullclean or ninja brotli-fullclean before building can definitely cause this problem.

The specific problem seems to be that the patch for libjxl was reverted. It can be seen in https://github.com/zhongfly/winbuild-test/actions/runs/2343080618 and https://github.com/zhongfly/winbuild-test/actions/runs/2343020702 that the build fails, libjxl's commit hash is exactly the same as the remote.

zhongfly commented 2 years ago

After my testing, this didn't work, no difference compared to before.(logs) My test is to run ninja highway-fullclean or ninja brotli-fullclean after a successful build, then build again.

zhongfly commented 2 years ago

Sadly, the latest commit still doesn't solve the problem. I don't think the real problem is that the patch doesn't work From what I've found, libjxl is reverted to an unpatched state when pacakge, which libjxl depends on, is updated. The build fails because libjxl is not patched, not because the patch not work fine. Here's the build failing, libjxl is not patched(https://github.com/zhongfly/winbuild-test/runs/6534513680): image This is when the build succeeds, with libjxl patched: image

zhongfly commented 2 years ago

Everything is ok now

mitzsch commented 2 years ago

Also works on my end now, but only with Arch Linux, Ubuntu 22.04 is somehow still broken, although I think it's a different issue there! (maybe pkgconf (arch) vs pkg-config (ubuntu)?)

Thanks!! :)

CrendKing commented 2 years ago

For Ubuntu 22.04, I'm able to fix the issue by installing pkgconf then rebuild libjxl.