microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
23.27k stars 6.42k forks source link

Error: Building package ffmpeg:x64-windows failed with: BUILD_FAILED #14241

Closed guybashan closed 4 years ago

guybashan commented 4 years ago

Host Environment

To Reproduce Steps to reproduce the behavior: ./vcpkg install ffmpeg:x64-windows

Failure logs

Computing installation plan...
The following packages will be built and installed:
    ffmpeg[avcodec,avdevice,avfilter,avformat,avresample,core,gpl,postproc,swresample,swscale]:x64-windows
Detecting compiler hash for triplet x64-windows...
Starting package 1/1: ffmpeg:x64-windows
Building package ffmpeg[avcodec,avdevice,avfilter,avformat,avresample,core,gpl,postproc,swresample,swscale]:x64-windows...
Could not locate cached archive: C:\Users\xyz\AppData\Local\vcpkg\archives\c7\c7317455b0cac9e41b554297f8dc5e4505a48372.zip
-- Using cached C:/vcpkg/downloads/ffmpeg-ffmpeg-n4.3.1.tar.gz
-- Cleaning sources at C:/vcpkg/buildtrees/ffmpeg/src/n4.3.1-73f9ace9ef.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source C:/vcpkg/downloads/ffmpeg-ffmpeg-n4.3.1.tar.gz
-- Applying patch 0001-create-lib-libraries.patch
-- Applying patch 0003-fix-windowsinclude.patch
-- Applying patch 0004-fix-debug-build.patch
-- Applying patch 0005-fix-libvpx-linking.patch
-- Applying patch 0006-fix-StaticFeatures.patch
-- Applying patch 0007-fix-lib-naming.patch
-- Applying patch 0008-Fix-wavpack-detection.patch
-- Applying patch 0009-Fix-fdk-detection.patch
-- Applying patch 0010-Fix-x264-detection.patch
-- Applying patch 0011-Fix-x265-detection.patch
-- Applying patch 0012-Fix-ssl-110-detection.patch
-- Using source at C:/vcpkg/buildtrees/ffmpeg/src/n4.3.1-73f9ace9ef.clean
-- Downloading https://repo.msys2.org/msys/x86_64/libiconv-1.16-1-x86_64.pkg.tar.xz...
-- Downloading https://repo.msys2.org/msys/x86_64/libiconv-1.16-1-x86_64.pkg.tar.xz... Failed. Status: 22;"HTTP response code said error"
-- Downloading https://www2.futureware.at/~nickoe/msys2-mirror/msys/x86_64/libiconv-1.16-1-x86_64.pkg.tar.xz...
-- Downloading https://www2.futureware.at/~nickoe/msys2-mirror/msys/x86_64/libiconv-1.16-1-x86_64.pkg.tar.xz... Failed. Status: 22;"HTTP response code said error"
-- Downloading https://mirror.yandex.ru/mirrors/msys2/msys/x86_64/libiconv-1.16-1-x86_64.pkg.tar.xz...
-- Downloading https://mirror.yandex.ru/mirrors/msys2/msys/x86_64/libiconv-1.16-1-x86_64.pkg.tar.xz... Failed. Status: 22;"HTTP response code said error"
-- Downloading https://mirrors.tuna.tsinghua.edu.cn/msys2/msys/x86_64/libiconv-1.16-1-x86_64.pkg.tar.xz...
-- Downloading https://mirrors.tuna.tsinghua.edu.cn/msys2/msys/x86_64/libiconv-1.16-1-x86_64.pkg.tar.xz... Failed. Status: 22;"HTTP response code said error"
-- Downloading https://mirrors.ustc.edu.cn/msys2/msys/x86_64/libiconv-1.16-1-x86_64.pkg.tar.xz...
-- Downloading https://mirrors.ustc.edu.cn/msys2/msys/x86_64/libiconv-1.16-1-x86_64.pkg.tar.xz... Failed. Status: 22;"HTTP response code said error"
-- Downloading https://mirror.bit.edu.cn/msys2/msys/x86_64/libiconv-1.16-1-x86_64.pkg.tar.xz...
-- Downloading https://mirror.bit.edu.cn/msys2/msys/x86_64/libiconv-1.16-1-x86_64.pkg.tar.xz... Failed. Status: 22;"HTTP response code said error"
-- Downloading https://mirror.selfnet.de/msys2/msys/x86_64/libiconv-1.16-1-x86_64.pkg.tar.xz...
-- Downloading https://mirror.selfnet.de/msys2/msys/x86_64/libiconv-1.16-1-x86_64.pkg.tar.xz... Failed. Status: 22;"HTTP response code said error"
-- Downloading https://mirrors.sjtug.sjtu.edu.cn/msys2/msys/x86_64/libiconv-1.16-1-x86_64.pkg.tar.xz...
-- Downloading https://mirrors.sjtug.sjtu.edu.cn/msys2/msys/x86_64/libiconv-1.16-1-x86_64.pkg.tar.xz... Failed. Status: 22;"HTTP response code said error"
CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:181 (message):

      Failed to download file.
      If you use a proxy, please set the HTTPS_PROXY and HTTP_PROXY environment
      variables to "https://user:password@your-proxy-ip-address:port/".
      Otherwise, please submit an issue at https://github.com/Microsoft/vcpkg/issues

Call Stack (most recent call first):
  scripts/cmake/vcpkg_acquire_msys.cmake:87 (vcpkg_download_distfile)
  scripts/cmake/vcpkg_acquire_msys.cmake:125 (msys_package_download)
  scripts/cmake/vcpkg_acquire_msys.cmake:291 (msys_package)
  ports/ffmpeg/portfile.cmake:59 (vcpkg_acquire_msys)
  scripts/ports.cmake:79 (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.06.15-nohash

Additionally, attach any relevant sections from the log files above.
PhoebeHui commented 4 years ago

@guybashan, this issue should be fixed now, could you get latest source and try again?

guybashan commented 4 years ago

Thanks @PhoebeHui. works good. Now other things are breaking.. :)

guybashan commented 4 years ago

I am getting this failure now:

-- Downloading https://github.com/opencv/opencv/archive/4.3.0.tar.gz...
-- Extracting source C:/vcpkg/downloads/opencv-opencv-4.3.0.tar.gz
-- Applying patch 0001-disable-downloading.patch
-- Applying patch 0002-install-options.patch
-- Applying patch 0003-force-package-requirements.patch
-- Applying patch 0004-fix-policy-CMP0057.patch
-- Applying patch 0006-jpeg2000_getref.patch
-- Applying patch 0009-fix-uwp.patch
-- Using source at C://vcpkg/buildtrees/opencv4/src/4.3.0-1e84697c4a.clean
-- Downloading https://github.com/tiny-dnn/tiny-dnn/archive/v1.0.0a3.tar.gz...
-- Configuring x64-windows
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:106 (message):
    Command failed: ninja -v
    Working Directory: C:/vcpkg/buildtrees/opencv4/x64-windows-rel/vcpkg-parallel-configure
    Error code: 1
    See logs for more information:
      C:\vcpkg\buildtrees\opencv4\config-x64-windows-out.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_configure_cmake.cmake:312 (vcpkg_execute_required_process)
  ports/opencv4/portfile.cmake:280 (vcpkg_configure_cmake)
  scripts/ports.cmake:79 (include)

Error: Building package opencv4: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: opencv4:x64-windows
  Vcpkg version: 2020.06.15-nohash
guybashan commented 4 years ago

After digging further in the logs I got this:

Determining if the include file C:/vcpkg/installed/x64-windows/include/libpng/png.h exists failed with the following output:
Change Dir: C:/vcpkg/buildtrees/opencv4/x64-windows-rel/CMakeFiles/CMakeTmp

Run Build Command(s):C:/vcpkg/downloads/tools/ninja/1.10.1-windows/ninja.exe cmTC_cdbe6 && [1/2] Building C object CMakeFiles\cmTC_cdbe6.dir\CheckIncludeFile.c.obj

FAILED: CMakeFiles/cmTC_cdbe6.dir/CheckIncludeFile.c.obj 

C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\1427~1.291\bin\Hostx64\x64\cl.exe  /nologo   /nologo /DWIN32 /D_WINDOWS /W3 /utf-8 /MP   /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi  /fp:precise /FS        /MD /O2 /Oi /Gy /DNDEBUG /Z7 /showIncludes /FoCMakeFiles\cmTC_cdbe6.dir\CheckIncludeFile.c.obj /FdCMakeFiles\cmTC_cdbe6.dir\ /FS -c CheckIncludeFile.c

CheckIncludeFile.c(1): fatal error C1083: Cannot open include file: 'C:/vcpkg/installed/x64-windows/include/libpng/png.h': No such file or directory
ninja: build stopped: subcommand failed.

Determining if the include file pthread.h exists failed with the following output:
Change Dir: C:/vcpkg/buildtrees/opencv4/x64-windows-rel/CMakeFiles/CMakeTmp

Run Build Command(s):C:/vcpkg/downloads/tools/ninja/1.10.1-windows/ninja.exe cmTC_17ccd && [1/2] Building C object CMakeFiles\cmTC_17ccd.dir\CheckIncludeFile.c.obj

FAILED: CMakeFiles/cmTC_17ccd.dir/CheckIncludeFile.c.obj 

C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\1427~1.291\bin\Hostx64\x64\cl.exe  /nologo   /nologo /DWIN32 /D_WINDOWS /W3 /utf-8 /MP   /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi  /fp:precise /FS        /MD /O2 /Oi /Gy /DNDEBUG /Z7 /showIncludes /FoCMakeFiles\cmTC_17ccd.dir\CheckIncludeFile.c.obj /FdCMakeFiles\cmTC_17ccd.dir\ /FS -c CheckIncludeFile.c

CheckIncludeFile.c(1): fatal error C1083: Cannot open include file: 'pthread.h': No such file or directory
ninja: build stopped: subcommand failed.
PhoebeHui commented 4 years ago

@guybashan, could you attach C:\vcpkg\buildtrees\opencv4\config-x64-windows-out.log file?

BTW, I can't repro this issue locally. Starting package 2/2: opencv4:x64-windows Building package opencv4[core,dnn,jpeg,opengl,png,tiff,webp]:x64-windows... -- Downloading https://github.com/opencv/opencv/archive/4.3.0.tar.gz... -- Extracting source F:/vcpkg/src/downloads/opencv-opencv-4.3.0.tar.gz -- Applying patch 0001-disable-downloading.patch -- Applying patch 0002-install-options.patch -- Applying patch 0003-force-package-requirements.patch -- Applying patch 0004-fix-policy-CMP0057.patch -- Applying patch 0006-jpeg2000_getref.patch -- Applying patch 0009-fix-uwp.patch -- Using source at F:/vcpkg/src/buildtrees/opencv4/src/4.3.0-1e84697c4a.clean -- Downloading https://github.com/tiny-dnn/tiny-dnn/archive/v1.0.0a3.tar.gz... -- Configuring x64-windows -- Building x64-windows-dbg -- Building x64-windows-rel -- Installing: F:/vcpkg/src/packages/opencv4_x64-windows/share/opencv4/copyright -- Performing post-build validation -- Performing post-build validation done Building package opencv4[core,dnn,jpeg,opengl,png,tiff,webp]:x64-windows... done Installing package opencv4[core,dnn,jpeg,opengl,png,tiff,webp]:x64-windows... Installing package opencv4[core,dnn,jpeg,opengl,png,tiff,webp]:x64-windows... done Elapsed time for package opencv4:x64-windows: 13 min

Total elapsed time: 17.3 min

The package opencv4:x64-windows provides CMake targets:

find_package(OpenCV CONFIG REQUIRED)
# Note: 10 target(s) were omitted.
target_link_libraries(main PRIVATE opencv_ml opencv_dnn opencv_core opencv_flann)
guybashan commented 4 years ago

Attached. Please let me know if anything else is needed.

CMakeOutput.log config-x64-windows-out.log CMakeError.log

PhoebeHui commented 4 years ago

@guybashan, thanks for your updates!

This is a duplicated issue with https://github.com/microsoft/vcpkg/issues/14171, and would be fixed by PR https://github.com/microsoft/vcpkg/pull/14177.

Failures:

CMake Error at modules/videoio/cmake/init.cmake:12 (set_target_properties):
  Property INTERFACE_LINK_LIBRARIES may not contain link-type keyword
  "optimized".  The INTERFACE_LINK_LIBRARIES property may contain
  configuration-sensitive generator-expressions which may be used to specify
  per-configuration rules.