meganz / sdk

MEGA C++ SDK
BSD 2-Clause "Simplified" License
1.32k stars 504 forks source link

An error occurred related to downloading zlib #2627

Closed wwjddbss126 closed 1 year ago

wwjddbss126 commented 1 year ago

An error occurred related to downloading zlib, it seems like old zlib version url is down. Build failed with:

[DEBUG] Downloading https://www.zlib.net/zlib-1.2.12.tar.gz Error: Failed to download from mirror set: https://www.zlib.net/zlib-1.2.12.tar.gz: failed: status code 404

[DEBUG] D:\a\_work\1\s\src\vcpkg\base\downloads.cpp(766):
[DEBUG] Time in subprocesses: 0 us
[DEBUG] Time in parsing JSON: 3 us
[DEBUG] Time in JSON reader: 0 us
[DEBUG] Time in filesystem: 135 us
[DEBUG] Time in loading ports: 0 us
[DEBUG] Exiting after 727.4 ms (727165 us)

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

      Failed to download file with error: 1
      If you use a proxy, please check your proxy setting. Possible causes are:

      1. You are actually using an HTTP proxy, but setting HTTPS_PROXY variable
         to `https://address:port`. This is not correct, because `https://` prefix
         claims the proxy is an HTTPS proxy, while your proxy (v2ray, shadowsocksr
         , etc..) is an HTTP proxy. Try setting `http://address:port` to both
         HTTP_PROXY and HTTPS_PROXY instead.

      2. You are using Fiddler. Currently a bug (https://github.com/microsoft/vcpkg/issues/17752)
         will set HTTPS_PROXY to `https://fiddler_address:port` which lead to problem 1 above.
         Workaround is open Windows 10 Settings App, and search for Proxy Configuration page,
         Change `http=address:port;https=address:port` to `address`, and fill the port number.

      3. Your proxy's remote server is out of service.

      In future vcpkg releases, if you are using Windows, you no longer need to set
      HTTP(S)_PROXY environment variables. Vcpkg will simply apply Windows IE Proxy
      Settings set by your proxy software. See (https://github.com/microsoft/vcpkg-tool/pull/49)
      and (https://github.com/microsoft/vcpkg-tool/pull/77)

      Otherwise, please submit an issue at https://github.com/Microsoft/vcpkg/issues

  Call Stack (most recent call first):
    scripts/cmake/vcpkg_download_distfile.cmake:273 (z_vcpkg_download_distfile_show_proxy_and_fail)
    ports/zlib/portfile.cmake:3 (vcpkg_download_distfile)
    scripts/ports.cmake:147 (include)

error: building zlib:x64-windows-mega failed with: BUILD_FAILED
error: Please ensure you're using the latest port files with `git pull` and `vcpkg update`.
Then check for known issues at:
    https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+zlib
You can submit a new issue at:
    https://github.com/microsoft/vcpkg/issues/new?template=report-package-build-failure.md&title=[zlib]+Build+error
Include '[zlib] Build error' in your bug report title, the following version information in your bug description, and attach any relevant failure logs from above.
    vcpkg-tool version: 2022-10-12-b586c2752f75bcc3f6a243749e9a0d94d0d93ccd
    vcpkg-scripts version: 06b5f4a76 2022-10-16 (4 hours ago)

Please use the prefilled template from J:\mybuild\3rdparty_sdk\vcpkg\installed\vcpkg\issue_body.md when reporting your issue.
Command failed with result code 1. Command was: vcpkg install --triplet x64-windows-mega curl
CMake Error at build_from_scratch.cmake:93 (message):
  Execute_process command had nonzero exit code 1 with error
Call Stack (most recent call first):
  build_from_scratch.cmake:141 (execute_checked_command)
oviradoi commented 1 year ago

This can be fixed by modifying the file contrib/cmake/preferred-ports-sdk.txt

You need to replace zlib/9b064ff07b987c8f213fdbf4358122fd4fe38ef1 with zlib/e0a9559a9b24af116388eae242d675bf9fde025c

This will make the sdk use the newer version of zlib 1.2.13 and the download will work.

wwjddbss126 commented 1 year ago

Thanks a lot! It seems to have been resolved.