Azure / azure-sdk-for-cpp

This repository is for active development of the Azure SDK for C++. For consumers of the SDK we recommend visiting our versioned developer docs at https://azure.github.io/azure-sdk-for-cpp.
MIT License
181 stars 127 forks source link

azure-core_1.7.2 fails to build because of not existing reference to zlib-1.2.12 #4039

Closed rrusinov closed 2 years ago

rrusinov commented 2 years ago

Describe the bug Building azure-core from source fails. It tries to download zlib-1.2.12, but it doesn't exists on zlib.net.

Exception or Stack Trace Add the exception log and stack trace if available

To Reproduce Steps to reproduce the behavior:

git clone --recursive -b azure-core_1.7.2 https://github.com/Azure/azure-sdk-for-cpp
cd azure-sdk-for-cpp
mkdir build && cd build
cmake ../

resulting:

No transport adapter was selected, using libcurl as the default option for POSIX.
-- Bootstrapping vcpkg before install
-- Bootstrapping vcpkg before install - done
-- Running vcpkg install
Detecting compiler hash for triplet x64-osx...
The following packages will be built and installed:
    curl[core,non-http,sectransp,ssl]:x64-osx -> 7.82.0 -- /Users/rr/tmp/azure-sdk-for-cpp/build/_deps/vcpkg-src/buildtrees/versioning_/versions/curl/203696f71dd43fa55a1b1104570135bebf869819
  * libiconv[core]:x64-osx -> 1.16#13 -- /Users/rr/tmp/azure-sdk-for-cpp/build/_deps/vcpkg-src/buildtrees/versioning_/versions/libiconv/cc4f1edf5a444934d4a757420a6cd3fed596e1d5
  * liblzma[core]:x64-osx -> 5.2.5#5 -- /Users/rr/tmp/azure-sdk-for-cpp/build/_deps/vcpkg-src/buildtrees/versioning_/versions/liblzma/18b7cbd0972b536a6bd4c0ef0f41dce9c3f047ac
    libxml2[core]:x64-osx -> 2.9.12#5 -- /Users/rr/tmp/azure-sdk-for-cpp/build/_deps/vcpkg-src/buildtrees/versioning_/versions/libxml2/582189632eff9dc4ba2ef262a853c339d2838bd9
  * nlohmann-json[core]:x64-osx -> 3.10.5#2 -- /Users/rr/tmp/azure-sdk-for-cpp/build/_deps/vcpkg-src/buildtrees/versioning_/versions/nlohmann-json/becf6a86f7e28342840fc807840c68b133c6fad8
    openssl[core]:x64-osx -> 3.0.2#2 -- /Users/rr/tmp/azure-sdk-for-cpp/build/_deps/vcpkg-src/buildtrees/versioning_/versions/openssl/66e7ff434d21a4fc00cab9bbe6167db295ffefd3
    opentelemetry-cpp[core]:x64-osx -> 1.3.0 -- /Users/rr/tmp/azure-sdk-for-cpp/build/_deps/vcpkg-src/buildtrees/versioning_/versions/opentelemetry-cpp/0ab7ef25acedde2552479fda46f92716afa53c98
  * vcpkg-cmake[core]:x64-osx -> 2022-04-07 -- /Users/rr/tmp/azure-sdk-for-cpp/build/_deps/vcpkg-src/buildtrees/versioning_/versions/vcpkg-cmake/3dcb01563c0de941013579456d19ce5b0bd08a6e
  * vcpkg-cmake-config[core]:x64-osx -> 2022-02-06 -- /Users/rr/tmp/azure-sdk-for-cpp/build/_deps/vcpkg-src/buildtrees/versioning_/versions/vcpkg-cmake-config/24dc7dfc704406e9f745f033643dc25f56e4ca18
  * zlib[core]:x64-osx -> 1.2.12 -- /Users/rr/tmp/azure-sdk-for-cpp/build/_deps/vcpkg-src/buildtrees/versioning_/versions/zlib/9c4edb1fabbd87dd236a200ba55eaf241cd8c8d0
Additional packages (*) will be modified to complete this operation.
Restored 0 packages from /Users/rr/.cache/vcpkg/archives in 32.4 us. Use --debug to see more details.
Starting package 1/10: zlib:x64-osx
Building package zlib[core]:x64-osx...
-- Installing port from location: /Users/rr/tmp/azure-sdk-for-cpp/build/_deps/vcpkg-src/buildtrees/versioning_/versions/zlib/9c4edb1fabbd87dd236a200ba55eaf241cd8c8d0
-- Downloading https://www.zlib.net/zlib-1.2.12.tar.gz -> zlib1212.tar.gz...
[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] 62221: popen(curl --fail -L https://www.zlib.net/zlib-1.2.12.tar.gz --create-dirs --output /Users/rr/tmp/azure-sdk-for-cpp/build/_deps/vcpkg-src/downloads/zlib1212.tar.gz.62221.part 2>&1)
[DEBUG] 62221: cmd_execute_and_stream_data() returned 22 after   557144 us
Error: Failed to download from mirror set:
https://www.zlib.net/zlib-1.2.12.tar.gz:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0   315    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404

[DEBUG] /Users/runner/work/1/s/src/vcpkg/base/downloads.cpp(741): 
[DEBUG] Time in subprocesses: 589736 us
[DEBUG] Time in parsing JSON: 14 us
[DEBUG] Time in JSON reader: 0 us
[DEBUG] Time in filesystem: 474 us
[DEBUG] Time in loading ports: 0 us
[DEBUG] Exiting after 592.7 ms (559588 us)

CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:84 (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:309 (z_vcpkg_download_distfile_show_proxy_and_fail)
  buildtrees/versioning_/versions/zlib/9c4edb1fabbd87dd236a200ba55eaf241cd8c8d0/portfile.cmake:3 (vcpkg_download_distfile)
  scripts/ports.cmake:145 (include)

error: building zlib:x64-osx failed with: BUILD_FAILED
Please ensure you're using the latest portfiles 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
including:
  package: zlib[core]:x64-osx -> 1.2.12
    vcpkg-tool version: 2022-03-30-692785ac944e81417840c6de244fb3e18a4b35eb
    vcpkg-scripts version: f0aa678b7 2022-04-18 (6 months ago)

Additionally, attach any relevant sections from the log files above.
-- Running vcpkg install - failed
CMake Error at build/_deps/vcpkg-src/scripts/buildsystems/vcpkg.cmake:850 (message):
  vcpkg install failed.  See logs for more information:
  /Users/rr/tmp/azure-sdk-for-cpp/build/vcpkg-manifest-install.log
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.24.1/share/cmake/Modules/CMakeDetermineSystem.cmake:124 (include)
  CMakeLists.txt:26 (project)

Code Snippet Add the code snippet that causes the issue.

Expected behavior Successfully build without any issues.

Screenshots If applicable, add screenshots to help explain your problem.

Setup (please complete the following information):

Additional context Add any other context about the problem here.

Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

LarryOsterman commented 2 years ago

The Zlib team pulled their 1.2.12 release in favor of Zlib 1.2.12#2 to fix a security bug and prevent the further distribution of components which depend on the insecure version of Zlib. The Azure SDK does not directly consume Zlib but downstream components of the Azure SDK consume zlib, thus the Azure SDK is affected.

To resolve the issue, there are several possible solutions:

  1. Update your vcpkg baseline to the current baseline - the version of Zlib in the current vcpkg baseline has the required security fix.
  2. Add a vcpkg version override to your vcpkg.json file to reference the fixed version of zlib:
  "overrides": [
    {
      "name": "zlib",
      "version": "1.2.12#2"
    }
  ]

Note that this will require that your version of vcpkg be updated to a recent version.

ghost commented 2 years ago

Hi @rrusinov. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “/unresolve” to remove the “issue-addressed” label and continue the conversation.

ghost commented 2 years ago

Hi @rrusinov, since you haven’t asked that we “/unresolve” the issue, we’ll close this out. If you believe further discussion is needed, please add a comment “/unresolve” to reopen the issue.