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

cmake minimum version 3.22.2. ? #4093

Closed yxiang92128 closed 1 year ago

yxiang92128 commented 1 year ago

Query/Question I am having an issue compiling on SLES15SP4 which has the folowing cmake version: /home/jenkins/azure-sdk-for-cpp-azure-storage-blobs_12.6.2/build # cmake --version cmake version 3.20.4

But it is somehow trying to download and install cmake 3.22.2 and it failed (zlib-1.2.12 is not available on SLES15SP4) Is there a way to bypass this minimum version requirement for cmake or cmake 3.22.2 is a must have now? The key thing is that vcpkg somehow demands to have zlib-1.2.12 but the highest version on SLES15SP4 is zlib-1.2.11.

Which config file can I edit to bypass this check? I am sure that cmake version 3.20.4 should work.

I was able to build/compile with cmake 3.17.0 on SLES15SP2 so I am very confused how it would force the use of cmake 3.22.2 on SLES15SP4.

Thanks!

:/home/jenkins/azure-sdk-for-cpp-azure-storage-blobs_12.6.2/build # cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON 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 A suitable version of cmake was not found (required v3.22.2). Downloading portable cmake v3.22.2... Downloading cmake... https://github.com/Kitware/CMake/releases/download/v3.22.2/cmake-3.22.2-linux-x86_64.tar.gz -> /home/jenkins/azure-sdk-for-cpp-azure-storage-blobs_12.6.2/build/_deps/vcpkg-src/downloads/cmake-3.22.2linux-x86_64.tar.gz Extracting cmake... Detecting compiler hash for triplet x64-linux... The following packages will be built and installed: curl[core,non-http,openssl,ssl]:x64-linux -> 7.82.0 -- /home/jenkins/azure-sdk-for-cpp-azure-storage-blobs_12.6.2/build/deps/vcpkg-src/buildtrees/versioning/versions/curl/203696f71dd43fa55a1b1104570135bebf869819

[DEBUG] /mnt/vss/_work/1/s/src/vcpkg/base/downloads.cpp(741): [DEBUG] Time in subprocesses: 144301 us [DEBUG] Time in parsing JSON: 5 us [DEBUG] Time in JSON reader: 0 us [DEBUG] Time in filesystem: 114 us [DEBUG] Time in loading ports: 0 us [DEBUG] Exiting after 145.1 ms (141944 us)

CMake Error at /home/jenkins/azure-sdk-for-cpp-azure-storage-blobs_12.6.2/build/_deps/vcpkg-src/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): /home/jenkins/azure-sdk-for-cpp-azure-storage-blobs_12.6.2/build/_deps/vcpkg-src/scripts/cmake/vcpkg_download_distfile.cmake:309 (z_vcpkg_download_distfile_show_proxy_and_fail) /home/jenkins/azure-sdk-for-cpp-azure-storage-blobs_12.6.2/build/deps/vcpkg-src/buildtrees/versioning/versions/zlib/9c4edb1fabbd87dd236a200ba55eaf241cd8c8d0/portfile.cmake:3 (vcpkg_download_distfile) /home/jenkins/azure-sdk-for-cpp-azure-storage-blobs_12.6.2/build/_deps/vcpkg-src/scripts/ports.cmake:145 (include)

error: building zlib:x64-linux 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-linux -> 1.2.12 vcpkg-tool version: 2022-03-30-692785ac944e81417840c6de244fb3e18a4b35eb vcpkg-scripts version: f0aa678b7 2022-04-18 (7 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: /home/jenkins/azure-sdk-for-cpp-azure-storage-blobs_12.6.2/build/vcpkg-manifest-install.log Call Stack (most recent call first): /usr/share/cmake/Modules/CMakeDetermineSystem.cmake:123 (include) CMakeLists.txt:26 (project)

CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool. CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage -- Configuring incomplete, errors occurred! Why is this not a Bug or a feature Request? A clear explanation of why is this not a bug or a feature request?

Setup (please complete the following information if applicable):

Jinming-Hu commented 1 year ago

Hi @yxiang92128 , I don't think the failure is related to CMake version.

When you build from the source code, it automatically clone vcpkg to local and install all dependencies from there (including newer version of CMake and other dependencies like zlib). So the zlib version coming with your OS doesn't matter here.

The error happened when vpckg tried to download zlib 1.2.12 from zlib.net, which was deleted because of a security issue GHSA-cfmr-vrgj-vqwv

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 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (22) The requested URL returned error: 404

Latest version of vcpkg downloads zlib from GitHub not the zlib's website anymore. So if you do a clean build, the issue should go away.

ghost commented 1 year ago

Hi @yxiang92128. 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.

Jinming-Hu commented 1 year ago

@yxiang92128 Please let me know if you have any further questions

ghost commented 1 year ago

Hi @yxiang92128, 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.