shimat / opencvsharp

OpenCV wrapper for .NET
Apache License 2.0
5.22k stars 1.13k forks source link

Forked vcpkg and tesseract breaks compilation due to old and obsolete packages removed from servers #1546

Open netcorefan1 opened 1 year ago

netcorefan1 commented 1 year ago

I'm trying to compile the wrapper as is, but without success. I'm unable to get the required dependencies from the forked vcpkg because many packages has been removed from the servers.

Environment

Windows 11 Pro, VS 17.5.1, MSVC v143

What did you do when you faced the problem?

Tried to use the downloadable Tesseract, but compilation failed due to inability to install its required dependencies. I decided to build this myself because I want GPU support and an updated full featured version of OpenCv. Therefore I initially tried to link through the vcpkg CMAKE_TOOLCHAIN_FILE a very basic (no CUDA) version of OpenCv compiled through the official vcpkg repo and the latest tesseract. At the time of compilation I got plenty of errors even after having fixed the linked libraries version in OpenCvSharpExtern. There are dependencies (for example webp.lib, webpdecoder.lib, protobuf etc) that does not exists anymore from very long time in packages. I would like to ask if it is possible to make OpenCvSharp compatible with the packages provided from the officially vcpkg repo rather than relying in a forked repo with more than 2000 commits behind. As is I'm not sure if would be possible to link even a minimal recent version of OpenVc. Although downgrading working packages is something that I always try to avoid, I'm afraid that it will not work anyway without breaking the compilation.

Example code:

git clone https://github.com/shimat/vcpkg.git
.\bootstrap-vcpkg.bat
.\vcpkg.exe  install tesseract:x64-windows-static

Output:

The following packages will be built and installed:
  * bzip2[core]:x64-windows-static -> 1.0.8#2
  * giflib[core]:x64-windows-static -> 5.2.1#2
  * leptonica[core]:x64-windows-static -> 1.82.0
  * libarchive[bzip2,core,libxml2,lz4,lzma,openssl,zstd]:x64-windows-static -> 3.6.1
  * libiconv[core]:x64-windows-static -> 1.16#13
  * libjpeg-turbo[core]:x64-windows-static -> 2.1.3#3
  * liblzma[core]:x64-windows-static -> 5.2.5#6
  * libpng[core]:x64-windows-static -> 1.6.37#17
  * libwebp[core,libwebpmux,nearlossless,simd,unicode]:x64-windows-static -> 1.2.2
  * libxml2[core]:x64-windows-static -> 2.9.14
  * lz4[core]:x64-windows-static -> 1.9.3#3
  * openjpeg[core]:x64-windows-static -> 2.5.0
  * openssl[core]:x64-windows-static -> 3.0.3#2
    tesseract[core]:x64-windows-static -> 4.1.1#10
  * tiff[core,jpeg,lzma,zip]:x64-windows-static -> 4.4.0
  * vcpkg-cmake[core]:x64-windows -> 2022-05-10
  * vcpkg-cmake-config[core]:x64-windows -> 2022-02-06
  * vcpkg-cmake-get-vars[core]:x64-windows -> 2022-05-10
  * zlib[core]:x64-windows-static -> 1.2.12#1
  * zstd[core]:x64-windows-static -> 1.5.2#1
[DEBUG] To include the environment variables in debug output, pass --debug-env
[DEBUG] Feature flag 'binarycaching' unset
[DEBUG] Feature flag 'manifests' = off
[DEBUG] Feature flag 'compilertracking' unset
[DEBUG] Feature flag 'registries' unset
[DEBUG] Feature flag 'versions' unset
[DEBUG] Downloading https://repo.msys2.org/msys/x86_64/libtool-2.4.6-9-x86_64.pkg.tar.xz
[DEBUG] Downloading https://www2.futureware.at/~nickoe/msys2-mirror/msys/x86_64/libtool-2.4.6-9-x86_64.pkg.tar.xz
[DEBUG] Downloading https://mirror.yandex.ru/mirrors/msys2/msys/x86_64/libtool-2.4.6-9-x86_64.pkg.tar.xz
[DEBUG] Downloading https://mirrors.tuna.tsinghua.edu.cn/msys2/msys/x86_64/libtool-2.4.6-9-x86_64.pkg.tar.xz
[DEBUG] Downloading https://mirrors.ustc.edu.cn/msys2/msys/x86_64/libtool-2.4.6-9-x86_64.pkg.tar.xz
[DEBUG] Downloading https://mirror.bit.edu.cn/msys2/msys/x86_64/libtool-2.4.6-9-x86_64.pkg.tar.xz
[DEBUG] Download failed -- retrying after 1000 ms.
[DEBUG] Download failed -- retrying after 2000 ms.
[DEBUG] Download failed -- retrying after 4000 ms.
[DEBUG] Downloading https://mirror.selfnet.de/msys2/msys/x86_64/libtool-2.4.6-9-x86_64.pkg.tar.xz
[DEBUG] Downloading https://mirrors.sjtug.sjtu.edu.cn/msys2/msys/x86_64/libtool-2.4.6-9-x86_64.pkg.tar.xz
Error: Failed to download from mirror set:
https://repo.msys2.org/msys/x86_64/libtool-2.4.6-9-x86_64.pkg.tar.xz: failed: status code 404
https://www2.futureware.at/~nickoe/msys2-mirror/msys/x86_64/libtool-2.4.6-9-x86_64.pkg.tar.xz: failed: status code 404
https://mirror.yandex.ru/mirrors/msys2/msys/x86_64/libtool-2.4.6-9-x86_64.pkg.tar.xz: failed: status code 404
https://mirrors.tuna.tsinghua.edu.cn/msys2/msys/x86_64/libtool-2.4.6-9-x86_64.pkg.tar.xz: failed: status code 404
https://mirrors.ustc.edu.cn/msys2/msys/x86_64/libtool-2.4.6-9-x86_64.pkg.tar.xz: failed: status code 404
https://mirror.bit.edu.cn/msys2/msys/x86_64/libtool-2.4.6-9-x86_64.pkg.tar.xz: WinHttpSendRequest() failed: 12007
https://mirror.bit.edu.cn/msys2/msys/x86_64/libtool-2.4.6-9-x86_64.pkg.tar.xz: WinHttpSendRequest() failed: 12007
https://mirror.bit.edu.cn/msys2/msys/x86_64/libtool-2.4.6-9-x86_64.pkg.tar.xz: WinHttpSendRequest() failed: 12007
https://mirror.bit.edu.cn/msys2/msys/x86_64/libtool-2.4.6-9-x86_64.pkg.tar.xz: WinHttpSendRequest() failed: 12007
https://mirror.selfnet.de/msys2/msys/x86_64/libtool-2.4.6-9-x86_64.pkg.tar.xz: failed: status code 404
https://mirrors.sjtug.sjtu.edu.cn/msys2/msys/x86_64/libtool-2.4.6-9-x86_64.pkg.tar.xz: failed: status code 404

[DEBUG] D:\a\_work\1\s\src\vcpkg\base\downloads.cpp(751):
[DEBUG] Time in subprocesses: 0 us
[DEBUG] Time in parsing JSON: 2 us
[DEBUG] Time in JSON reader: 0 us
[DEBUG] Time in filesystem: 3924 us
[DEBUG] Time in loading ports: 0 us
[DEBUG] Exiting after 15.7 s (15694859 us)

CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:84 (message):

      Failed to download file with error: 1
n0099 commented 1 year ago

https://github.com/microsoft/vcpkg/issues/28934#issuecomment-1382639973 https://github.com/microsoft/vcpkg/issues/28896#issuecomment-1384472561

stale[bot] commented 9 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.