ffmpeg:x64-windows build failure
Host Environment
- OS: Windows 10
- Compiler: whatever the master branch of vcpkg uses as of the time of filing this.
To Reproduce
Steps to reproduce the behavior:
.\vcpkg install ffmpeg:x64-windows
.\vcpkg list
EXPECTED BEHAVIOR ffmpeg listed as an installed package.
ACTUAL BEHAVIOR ffmpeg NOT listed as an installed package. Trying to install again runs install again, from scratch.
Comments Additionally, once all dependencies are already met (git, msys, nuget, powershell and all the bloat), building ffmpeg takes over 30 minutes on a modern laptop (Surface Pro 2). This is likely due to Windows Defender kicking in and going berserk EVERY SINGLE TIME a vcpkg install runs. (?)
Any error during installation? Or do you receive the installation success?
I have the same problem:
C:\Users\x\Source\Repos\vcpkg\vcpkg>vcpkg install ffmpeg
The following packages will be built and installed:
ffmpeg[avresample,core]:x64-windows
Starting package 1/1: ffmpeg:x64-windows
Building package ffmpeg[avresample,core]:x64-windows...
Warning: abi keys are missing values:
zlib
-- Using cached C:/Users/x/Source/Repos/vcpkg/downloads/ffmpeg-ffmpeg-n4.2.tar.gz
-- Using source at C:/Users/x/Source/Repos/vcpkg/buildtrees/ffmpeg/src/n4.2-b7812eeecc
-- Acquiring MSYS Packages...
-- Acquiring MSYS Packages... OK
-- Building Options: --enable-asm --enable-yasm --disable-doc --enable-debug --enable-runtime-cpudetect --disable-openssl --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-libvpx --disable-libx264 --disable-opencl --disable-lzma --disable-bzlib --enable-avresample --disable-static --enable-shared --extra-cflags=-DHAVE_UNISTD_H=0
-- Building Release Options: --extra-cflags=-MD --extra-cxxflags=-MD
-- Building ffmpeg for Release
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:72 (message):
Command failed: C:/Users/x/Source/Repos/vcpkg/downloads/tools/msys2/msys64/usr/bin/bash.exe --noprofile --norc C:/Users/x/Source/Repos/vcpkg/ports/ffmpeg\build.sh C:/Users/x/Source/Repos/vcpkg/buildtrees/ffmpeg/x64-windows-rel C:/Users/x/Source/Repos/vcpkg/buildtrees/ffmpeg/src/n4.2-b7812eeecc C:/Users/x/Source/Repos/vcpkg/packages/ffmpeg_x64-windows "--enable-asm --enable-yasm --disable-doc --enable-debug --enable-runtime-cpudetect --disable-openssl --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-libvpx --disable-libx264 --disable-opencl --disable-lzma --disable-bzlib --enable-avresample --disable-static --enable-shared --extra-cflags=-DHAVE_UNISTD_H=0 --extra-cflags=-MD --extra-cxxflags=-MD"
Working Directory: C:/Users/x/Source/Repos/vcpkg/buildtrees/ffmpeg/x64-windows-rel
Error code: 127
See logs for more information:
C:\Users\x\Source\Repos\vcpkg\vcpkg\buildtrees\ffmpeg\build-x64-windows-rel-out.log
Call Stack (most recent call first):
ports/ffmpeg/portfile.cmake:193 (vcpkg_execute_required_process)
scripts/ports.cmake:94 (include)
Error: Building package ffmpeg:x64-windows failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
Package: ffmpeg:x64-windows
Vcpkg version: 2020.01.17-nohash
Additionally, attach any relevant sections from the log files above.
Triplet configuration:
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_PLATFORM_TOOLSET v140)
Log file: build-x64-windows-rel-out.log
Platform Toolset v142 also fails with the same error.
Is "x" real or anonymized? Make sure you don't have spaces in the path when building ffmpeg
Anonymized, it doesn't have spaces. FFmpeg updates worked for months with the same config.
I've got a successful build after removing the "ffmpeg_x64-windows" folder out of the packages folder and emptying the downloads folder. The first is probably enough, but I'm not sure because I did both at the same time.
@bendonderer I didn't find any error records in the logs you provided. Can you provide all logs under VCPKG_PATH/buildtrees/ffmpeg?
Thanks.
@JackBoosY I have now the same problem. Which is very strange: there is no error anywhere! The err files are empty, the out are without any hint, the console has only the error you can see above. Very strange!! Also, the portfile itself has been the same for a long time. I don't know why is failing now. Maybe the compiler (I try to keep VS up to date, and now it is the latest version) has an internal error??
@JackBoosY My err files were also empty. After getting a successful build as mentioned before I got two warnings in build-x64-windows-rel-err.log:
C:/Users/x/Source/Repos/vcpkg/vcpkg/buildtrees/ffmpeg/src/n4.2-b7812eeecc/libavcodec/x86/h264_idct.asm:1152: warning: redefining multi-line macro `STORE_DIFFx2'
C:/Users/x/Source/Repos/vcpkg/vcpkg/buildtrees/ffmpeg/src/n4.2-b7812eeecc/libavcodec/x86/h264_idct.asm:1152: warning: redefining multi-line macro `STORE_DIFFx2'
Probably unrelated to this problem.
@cenit If it is a Visual Studio internal error, it should be displayed on the log unless the compiler crashes.
@bendonderer I think so.
In any case, without any log, I don't know where to look at. I might start rewriting the port file using more modern routines, but still it might not end well
@bendonderer to be honest, it might be that emptying the downloads folder did the trick. I will investigate it on my machine. Downloads folder contains also important tools for building ffmpeg, while the packages folder should not matter....
@cenit Since ffmpeg uses a shell script to install, it may be related to this.
I also tried using vcpkg_*_make to rewrite ffmpeg, but it failed.
Anyone interested in this can modify it based on my changes.
I can confirm that removing the downloads folder did the trick and the build went fine. Still unsure what broke the build (yasm update maybe?), because everything is related to changes to vcpkg happened outside of this port.
I had another machine with the same issue. Just clearing the tools folder inside downloads also helped. Just deleting yasm and cmake didn't work. I didn't try the other tools individually. These tools were installed after installing FFmpeg:
- 7-zip-18.1.0-windows
- git-2.21.0-1-windows
- msys2
- nuget-4.6.2-windows
- powershell-core-6.2.1-windows
- yasm
I don't think it's related to an compiler update as I'm getting the same result with VS2015 (platform toolset v140) and VS2019 (v142).
Just removing downloads\tools\msys2 did the trick as well.
if it were not for yasm, the only other involved tool is msys2. Still wondering what happened, have to check. It's possible that the last update on msys2 was mine, which means that it's very old by now...? so strange!
In my case there were no errors. Build finished successfully after taking forever (at least it did not yell at me at the end?) but package was not recognized as being installed.
I'm not familiar with vcpkg internals, so not sure if this helps at all.. the built package can be found in vcpkg\packages:
Directory of C:\Apps\vcpkg\packages
01/25/2020 11:13 PM <DIR> .
01/25/2020 11:13 PM <DIR> ..
01/25/2020 11:44 PM <DIR> ffmpeg_x64-windows <- the built binaries are here!!!!
01/25/2020 11:13 PM <DIR> zlib_x64-windows
0 File(s) 0 bytes
But it is NOT found in vcpkg\installed:
Directory of C:\Apps\vcpkg\installed\x64-windows\bin
01/25/2020 11:13 PM <DIR> .
01/25/2020 11:13 PM <DIR> ..
01/25/2020 11:13 PM 512,000 zlib.pdb
01/25/2020 11:13 PM 85,504 zlib1.dll
2 File(s) 597,504 bytes
Upon closer inspection, I found error logs though.
build-x64-windows-rel-err.log
C:/Apps/vcpkg/buildtrees/ffmpeg/src/n4.2-b7812eeecc/libavcodec/x86/h264_idct.asm:1152: warning: redefining multi-line macro `STORE_DIFFx2'
C:/Apps/vcpkg/buildtrees/ffmpeg/src/n4.2-b7812eeecc/libavcodec/x86/h264_idct.asm:1152: warning: redefining multi-line macro `STORE_DIFFx2'
and build-x64-windows-dbg-err.log
make: *** Deleting file 'libavcodec/hevcpred.o'
make: unlink: libavcodec/hevcpred.o: Device or resource busy
make: *** Deleting file 'libavcodec/hevcdsp.o'
make: unlink: libavcodec/hevcdsp.o: Device or resource busy
make: *** [/c/Apps/vcpkg/buildtrees/ffmpeg/src/n4.2-b7812eeecc/ffbuild/common.mak:59: libavcodec/hq_hqa.o] Error 4
make: *** [/c/Apps/vcpkg/buildtrees/ffmpeg/src/n4.2-b7812eeecc/ffbuild/common.mak:59: libavcodec/hq_hqadsp.o] Error 4
make: *** [/c/Apps/vcpkg/buildtrees/ffmpeg/src/n4.2-b7812eeecc/ffbuild/common.mak:59: libavcodec/hevcpred.o] Interrupt
make: *** [/c/Apps/vcpkg/buildtrees/ffmpeg/src/n4.2-b7812eeecc/ffbuild/common.mak:59: libavcodec/hevcdsp.o] Interrupt
Respective output files attached below:
build-x64-windows-rel-out.log build-x64-windows-dbg-out.log
I'm not sure why the package install build BOTH release and debug versions of the library (at 30+ mins for each build for an 1+ hour just to install ffmpeg). When I ran install the first time, it completed on its own and then did not recognize the package as installed. I think I interrupted the debug build the second time around when I ran it again and it was still "hanging" 45+ mins later. I ended up just dropping the DLLs in my project and linking them manually rather than using the Visual Studio vcpkg integration. It was just not worth it for me to wait another hour or so to try and make it "nice an easy and automatic package dependency management" with vcpkg. ¯_(ツ)_/¯
I had the same problem, but simply retrying succeeded: Windows 10 x64 + Visual Studio 2019 + today's master: no error in the log files as far as I saw
:: Starting core system upgrade...
warning: resolving dependencies...
terminate other MSYS2 programs before proceeding
looking for conflicting packages...
Packages (6) filesystem-2020.01-1 libzstd-1.4.4-2 mintty-1~3.1.0-1 msys2-runtime-3.0.7-6 pacman-5.2.1-6 zstd-1.4.4-2
Total Download Size: 14.60 MiB
Total Installed Size: 55.72 MiB
Net Upgrade Size: -1.76 MiB
:: Proceed with installation? [Y/n]
:: Retrieving packages... downloading filesystem-2020.01-1-x86_64.pkg.tar.xz... 19:09downloading msys2-runtime-3.0.7-6-x86_64.pkg.tar.xz...
downloading mintty-1~3.1.0-1-x86_64.pkg.tar.xz...
downloading libzstd-1.4.4-2-x86_64.pkg.tar.xz...
downloading zstd-1.4.4-2-x86_64.pkg.tar.xz...
downloading pacman-5.2.1-6-x86_64.pkg.tar.xz...
checking keyring...
checking package integrity...
loading package files...
checking for file conflicts...
checking available disk space...
:: Processing package changes...
upgrading filesystem...
upgrading msys2-runtime...
upgrading mintty...
installing libzstd...
installing zstd...
upgrading pacman...
warning: terminate MSYS2 without returning to shell and check for updates again
warning: for example close your terminal window instead of calling exit
-- Acquiring MSYS2... OK
-- Acquiring MSYS Packages...
-- Acquiring MSYS Packages... OK -- Building Options: --enable-asm --enable-yasm --disable-doc --enable-debug --enable-runtime-cpudetect --disable-openssl --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-libvpx --disable-libx264 --disable-opencl --disable-lzma --disable-bzlib --enable-avresample --disable-static --enable-shared --extra-cflags=-DHAVE_UNISTD_H=0 -- Building Release Options: --extra-cflags=-MD --extra-cxxflags=-MD -- Building ffmpeg for Release -- Building Debug Options: --debug --extra-cflags=-MDd --extra-cxxflags=-MDd -- Building ffmpeg for Debug CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:72 (message): Command failed: D:/Pro/vcpkg/downloads/tools/msys2/msys64/usr/bin/bash.exe --noprofile --norc D:/Pro/vcpkg/ports/ffmpeg\build.sh D:/Pro/vcpkg/buildtrees/ffmpeg/x64-windows-dbg D:/Pro/vcpkg/buildtrees/ffmpeg/src/n4.2-b7812eeecc D:/Pro/vcpkg/packages/ffmpeg_x64-windows/debug "--enable-asm --enable-yasm --disable-doc --enable-debug --enable-runtime-cpudetect --disable-openssl --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-libvpx --disable-libx264 --disable-opencl --disable-lzma --disable-bzlib --enable-avresample --disable-static --enable-shared --extra-cflags=-DHAVE_UNISTD_H=0 --debug --extra-cflags=-MDd --extra-cxxflags=-MDd" Working Directory: D:/Pro/vcpkg/buildtrees/ffmpeg/x64-windows-dbg Error code: 2 See logs for more information: D:\Pro\vcpkg\buildtrees\ffmpeg\build-x64-windows-dbg-out.log D:\Pro\vcpkg\buildtrees\ffmpeg\build-x64-windows-dbg-err.log Call Stack (most recent call first): ports/ffmpeg/portfile.cmake:212 (vcpkg_execute_required_process) scripts/ports.cmake:90 (include)
Error: Building package ffmpeg:x64-windows failed with: BUILD_FAILED Please ensure you're using the latest portfiles with `.\vcpkg update`, then submit an issue at https://github.com/Microsoft/vcpkg/issues including: Package: ffmpeg:x64-windows Vcpkg version: 2020.01.18-nohash Additionally, attach any relevant sections from the log files above.
@ras0219-msft Can you have a look?