microsoft / vcpkg

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

[cpprestsdk] build failure #11807

Closed rib2bit closed 4 years ago

rib2bit commented 4 years ago

Host Environment

To Reproduce Steps to reproduce the behavior: ./vcpkg install cpprestsdk

Failure logs

Computing installation plan...
The following packages will be built and installed:
    cpprestsdk[compression,core,default-features]:x64-osx
Starting package 1/1: cpprestsdk:x64-osx
Building package cpprestsdk[compression,core,default-features]:x64-osx...
-- Using cached /Users/hoge/vcpkg/downloads/Microsoft-cpprestsdk-v2.10.16.tar.gz
-- Using source at /Users/hoge/vcpkg/buildtrees/cpprestsdk/src/v2.10.16-35b281201d
-- Configuring x64-osx-dbg
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:72 (message):
    Command failed: /Users/hoge/vcpkg/downloads/tools/cmake-3.17.2-osx/cmake-3.17.2-Darwin-x86_64/CMake.app/Contents/bin/cmake /Users/hoge/vcpkg/buildtrees/cpprestsdk/src/v2.10.16-35b281201d/Release -DWEBSOCKETPP_CONFIG=/Users/hoge/vcpkg/installed/x64-osx/share/websocketpp -DWEBSOCKETPP_CONFIG_VERSION=/Users/hoge/vcpkg/installed/x64-osx/share/websocketpp -DCPPREST_EXCLUDE_BROTLI=ON -DCPPREST_EXCLUDE_COMPRESSION=OFF -DCPPREST_EXCLUDE_WEBSOCKETS=ON -DBUILD_TESTS=OFF -DBUILD_SAMPLES=OFF -DCPPREST_EXPORT_DIR=share/cpprestsdk -DWERROR=OFF -DPKG_CONFIG_EXECUTABLE=FALSE -DCMAKE_MAKE_PROGRAM=/Users/hoge/vcpkg/downloads/tools/ninja-1.10.0-osx/ninja -DCMAKE_SYSTEM_NAME=Darwin -DBUILD_SHARED_LIBS=OFF -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=/Users/hoge/vcpkg/scripts/toolchains/osx.cmake -DVCPKG_TARGET_TRIPLET=x64-osx -DVCPKG_SET_CHARSET_FLAG=ON -DVCPKG_PLATFORM_TOOLSET=external -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE -DCMAKE_VERBOSE_MAKEFILE=ON -DVCPKG_APPLOCAL_DEPS=OFF -DCMAKE_TOOLCHAIN_FILE=/Users/hoge/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON -DVCPKG_CXX_FLAGS= -DVCPKG_CXX_FLAGS_RELEASE= -DVCPKG_CXX_FLAGS_DEBUG= -DVCPKG_C_FLAGS= -DVCPKG_C_FLAGS_RELEASE= -DVCPKG_C_FLAGS_DEBUG= -DVCPKG_CRT_LINKAGE=dynamic -DVCPKG_LINKER_FLAGS= -DVCPKG_TARGET_ARCHITECTURE=x64 -DCMAKE_INSTALL_LIBDIR:STRING=lib -DCMAKE_INSTALL_BINDIR:STRING=bin -D_VCPKG_ROOT_DIR=/Users/hoge/vcpkg -D_VCPKG_INSTALLED_DIR=/Users/hoge/vcpkg/installed -DCPPREST_INSTALL_HEADERS=OFF -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/Users/hoge/vcpkg/packages/cpprestsdk_x64-osx/debug
    Working Directory: /Users/hoge/vcpkg/buildtrees/cpprestsdk/x64-osx-dbg
    Error code: 1
    See logs for more information:
      /Users/hoge/vcpkg/buildtrees/cpprestsdk/config-x64-osx-dbg-out.log
      /Users/hoge/vcpkg/buildtrees/cpprestsdk/config-x64-osx-dbg-err.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_configure_cmake.cmake:308 (vcpkg_execute_required_process)
  ports/cpprestsdk/portfile.cmake:25 (vcpkg_configure_cmake)
  scripts/ports.cmake:76 (include)

Error: Building package cpprestsdk:x64-osx 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: cpprestsdk:x64-osx
  Vcpkg version: 2020.02.04-unknownhash

Additionally, attach any relevant sections from the log files above.

config-x64-osx-dbg-out.log

-- The C compiler identification is AppleClang 11.0.3.11030032
-- The CXX compiler identification is AppleClang 11.0.3.11030032
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Looking for include file xlocale.h
-- Looking for include file xlocale.h - found
-- Found ZLIB: /Users/hoge/vcpkg/installed/x64-osx/debug/lib/libz.a (found version "1.2.11")
-- Found Boost: /Users/hoge/vcpkg/installed/x64-osx/include (found version "1.73.0") found components: random system thread filesystem chrono atomic date_time regex
-- OPENSSL_ROOT_DIR =
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- Checking for one of the modules 'openssl'
-- Found OpenSSL: /Users/hoge/vcpkg/installed/x64-osx/debug/lib/libcrypto.a (found suitable version "1.1.1d", minimum required is "1.0.0")
-- Performing Test _SSL_LEAK_SUPPRESS_AVAILABLE
-- Performing Test _SSL_LEAK_SUPPRESS_AVAILABLE - Failed
-- Configuring incomplete, errors occurred!
See also "/Users/hoge/vcpkg/buildtrees/cpprestsdk/x64-osx-dbg/CMakeFiles/CMakeOutput.log".
See also "/Users/hoge/vcpkg/buildtrees/cpprestsdk/x64-osx-dbg/CMakeFiles/CMakeError.log".

CMakeError.log

Performing C++ SOURCE FILE Test _SSL_LEAK_SUPPRESS_AVAILABLE failed with the following output:
Change Dir: /Users/hoge/vcpkg/buildtrees/cpprestsdk/x64-osx-dbg/CMakeFiles/CMakeTmp

Run Build Command(s):/Users/hoge/vcpkg/downloads/tools/ninja-1.10.0-osx/ninja cmTC_fe2ef && [1/2] Building CXX object CMakeFiles/cmTC_fe2ef.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_fe2ef.dir/src.cxx.o
/Library/Developer/CommandLineTools/usr/bin/c++   -I/Users/hoge/vcpkg/installed/x64-osx/include -fPIC -stdlib=libc++ -Wno-return-type-c-linkage -Wno-unneeded-internal-declaration -std=c++11 -fno-strict-aliasing -D_SSL_LEAK_SUPPRESS_AVAILABLE -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -o CMakeFiles/cmTC_fe2ef.dir/src.cxx.o -c src.cxx
src.cxx:5:9: error: expected unqualified-id
      ::SSL_COMP_free_compression_methods();
        ^
/Users/hoge/vcpkg/installed/x64-osx/include/openssl/ssl.h:2087:47: note: expanded from macro 'SSL_COMP_free_compression_methods'
#  define SSL_COMP_free_compression_methods() while(0) continue
                                              ^
1 error generated.
ninja: build stopped: subcommand failed.

Source file was:

      #include <openssl/ssl.h>
      int main()
      {
      ::SSL_COMP_free_compression_methods();
      }

Additional context

% ./vcpkg list
boost-accumulators:x64-osx                         1.73.0           Boost accumulators module
boost-algorithm:x64-osx                            1.73.0           Boost algorithm module
boost-align:x64-osx                                1.73.0           Boost align module
boost-any:x64-osx                                  1.73.0           Boost any module
boost-array:x64-osx                                1.73.0           Boost array module
boost-asio:x64-osx                                 1.73.0           Boost asio module
boost-assert:x64-osx                               1.73.0           Boost assert module
boost-assign:x64-osx                               1.73.0           Boost assign module
boost-atomic:x64-osx                               1.73.0           Boost atomic module
boost-beast:x64-osx                                1.73.0           Boost beast module
boost-bimap:x64-osx                                1.73.0           Boost bimap module
boost-bind:x64-osx                                 1.73.0           Boost bind module
boost-build:x64-osx                                1.73.0-1         Boost.Build
boost-callable-traits:x64-osx                      1.73.0           Boost callable_traits module
boost-chrono:x64-osx                               1.73.0           Boost chrono module
boost-circular-buffer:x64-osx                      1.73.0           Boost circular_buffer module
boost-compatibility:x64-osx                        1.73.0           Boost compatibility module
boost-compute:x64-osx                              1.73.0           Boost compute module
boost-concept-check:x64-osx                        1.73.0           Boost concept_check module
boost-config:x64-osx                               1.73.0           Boost config module
boost-container-hash:x64-osx                       1.73.0           Boost container_hash module
boost-container:x64-osx                            1.73.0           Boost container module
boost-context:x64-osx                              1.73.0-1         Boost context module
boost-contract:x64-osx                             1.73.0           Boost contract module
boost-conversion:x64-osx                           1.73.0           Boost conversion module
boost-convert:x64-osx                              1.73.0           Boost convert module
boost-core:x64-osx                                 1.73.0           Boost core module
boost-coroutine2:x64-osx                           1.73.0           Boost coroutine2 module
boost-coroutine:x64-osx                            1.73.0           Boost coroutine module
boost-crc:x64-osx                                  1.73.0           Boost crc module
boost-date-time:x64-osx                            1.73.0           Boost date_time module
boost-detail:x64-osx                               1.73.0           Boost detail module
boost-dll:x64-osx                                  1.73.0           Boost dll module
boost-dynamic-bitset:x64-osx                       1.73.0           Boost dynamic_bitset module
boost-endian:x64-osx                               1.73.0           Boost endian module
boost-exception:x64-osx                            1.73.0           Boost exception module
boost-filesystem:x64-osx                           1.73.0           Boost filesystem module
boost-flyweight:x64-osx                            1.73.0           Boost flyweight module
boost-foreach:x64-osx                              1.73.0           Boost foreach module
boost-format:x64-osx                               1.73.0           Boost format module
boost-function-types:x64-osx                       1.73.0           Boost function_types module
boost-function:x64-osx                             1.73.0           Boost function module
boost-functional:x64-osx                           1.73.0           Boost functional module
boost-fusion:x64-osx                               1.73.0           Boost fusion module
boost-geometry:x64-osx                             1.73.0           Boost geometry module
boost-gil:x64-osx                                  1.73.0           Boost gil module
boost-graph-parallel:x64-osx                       1.73.0           Boost graph_parallel module
boost-graph:x64-osx                                1.73.0           Boost graph module
boost-hana:x64-osx                                 1.73.0           Boost hana module
boost-heap:x64-osx                                 1.73.0           Boost heap module
boost-histogram:x64-osx                            1.73.0           Boost histogram module
boost-hof:x64-osx                                  1.73.0           Boost hof module
boost-icl:x64-osx                                  1.73.0           Boost icl module
boost-integer:x64-osx                              1.73.0           Boost integer module
boost-interprocess:x64-osx                         1.73.0           Boost interprocess module
boost-interval:x64-osx                             1.73.0           Boost interval module
boost-intrusive:x64-osx                            1.73.0           Boost intrusive module
boost-io:x64-osx                                   1.73.0           Boost io module
boost-iostreams:x64-osx                            1.73.0           Boost iostreams module
boost-iterator:x64-osx                             1.73.0           Boost iterator module
boost-lambda:x64-osx                               1.73.0           Boost lambda module
boost-lexical-cast:x64-osx                         1.73.0           Boost lexical_cast module
boost-local-function:x64-osx                       1.73.0           Boost local_function module
boost-locale:x64-osx                               1.73.0           Boost locale module
boost-lockfree:x64-osx                             1.73.0           Boost lockfree module
boost-log:x64-osx                                  1.73.0           Boost log module
boost-logic:x64-osx                                1.73.0           Boost logic module
boost-math:x64-osx                                 1.73.0           Boost math module
boost-metaparse:x64-osx                            1.73.0           Boost metaparse module
boost-modular-build-helper:x64-osx                 1.73.0-1
boost-move:x64-osx                                 1.73.0           Boost move module
boost-mp11:x64-osx                                 1.73.0           Boost mp11 module
boost-mpl:x64-osx                                  1.73.0           Boost mpl module
boost-msm:x64-osx                                  1.73.0           Boost msm module
boost-multi-array:x64-osx                          1.73.0           Boost multi_array module
boost-multi-index:x64-osx                          1.73.0           Boost multi_index module
boost-multiprecision:x64-osx                       1.73.0           Boost multiprecision module
boost-nowide:x64-osx                               1.73.0           Boost nowide module
boost-numeric-conversion:x64-osx                   1.73.0           Boost numeric_conversion module
boost-odeint:x64-osx                               1.73.0           Boost odeint module
boost-optional:x64-osx                             1.73.0           Boost optional module
boost-outcome:x64-osx                              1.73.0           Boost outcome module
boost-parameter-python:x64-osx                     1.73.0           Boost parameter_python module
boost-parameter:x64-osx                            1.73.0           Boost parameter module
boost-phoenix:x64-osx                              1.73.0           Boost phoenix module
boost-poly-collection:x64-osx                      1.73.0           Boost poly_collection module
boost-polygon:x64-osx                              1.73.0           Boost polygon module
boost-pool:x64-osx                                 1.73.0           Boost pool module
boost-predef:x64-osx                               1.73.0           Boost predef module
boost-preprocessor:x64-osx                         1.73.0           Boost preprocessor module
boost-process:x64-osx                              1.73.0           Boost process module
boost-program-options:x64-osx                      1.73.0           Boost program_options module
boost-property-map:x64-osx                         1.73.0           Boost property_map module
boost-property-tree:x64-osx                        1.73.0           Boost property_tree module
boost-proto:x64-osx                                1.73.0           Boost proto module
boost-ptr-container:x64-osx                        1.73.0           Boost ptr_container module
boost-python:x64-osx                               1.73.0           Boost python module
boost-qvm:x64-osx                                  1.73.0           Boost qvm module
boost-random:x64-osx                               1.73.0           Boost random module
boost-range:x64-osx                                1.73.0           Boost range module
boost-ratio:x64-osx                                1.73.0           Boost ratio module
boost-rational:x64-osx                             1.73.0           Boost rational module
boost-regex:x64-osx                                1.73.0           Boost regex module
boost-safe-numerics:x64-osx                        1.73.0           Boost safe_numerics module
boost-scope-exit:x64-osx                           1.73.0           Boost scope_exit module
boost-serialization:x64-osx                        1.73.0           Boost serialization module
boost-signals2:x64-osx                             1.73.0           Boost signals2 module
boost-smart-ptr:x64-osx                            1.73.0           Boost smart_ptr module
boost-sort:x64-osx                                 1.73.0           Boost sort module
boost-spirit:x64-osx                               1.73.0           Boost spirit module
boost-stacktrace:x64-osx                           1.73.0           Boost stacktrace module
boost-statechart:x64-osx                           1.73.0           Boost statechart module
boost-static-assert:x64-osx                        1.73.0           Boost static_assert module
boost-static-string:x64-osx                        1.73.0           Boost static_string module
boost-system:x64-osx                               1.73.0           Boost system module
boost-test:x64-osx                                 1.73.0           Boost test module
boost-thread:x64-osx                               1.73.0           Boost thread module
boost-throw-exception:x64-osx                      1.73.0           Boost throw_exception module
boost-timer:x64-osx                                1.73.0           Boost timer module
boost-tokenizer:x64-osx                            1.73.0           Boost tokenizer module
boost-tti:x64-osx                                  1.73.0           Boost tti module
boost-tuple:x64-osx                                1.73.0           Boost tuple module
boost-type-erasure:x64-osx                         1.73.0           Boost type_erasure module
boost-type-index:x64-osx                           1.73.0           Boost type_index module
boost-type-traits:x64-osx                          1.73.0           Boost type_traits module
boost-typeof:x64-osx                               1.73.0           Boost typeof module
boost-ublas:x64-osx                                1.73.0           Boost ublas module
boost-units:x64-osx                                1.73.0           Boost units module
boost-unordered:x64-osx                            1.73.0           Boost unordered module
boost-utility:x64-osx                              1.73.0           Boost utility module
boost-uuid:x64-osx                                 1.73.0           Boost uuid module
boost-variant2:x64-osx                             1.73.0           Boost variant2 module
boost-variant:x64-osx                              1.73.0           Boost variant module
boost-vcpkg-helpers:x64-osx                        7                a set of vcpkg-internal scripts used to modulari...
boost-vmd:x64-osx                                  1.73.0           Boost vmd module
boost-wave:x64-osx                                 1.73.0           Boost wave module
boost-winapi:x64-osx                               1.73.0           Boost winapi module
boost-xpressive:x64-osx                            1.73.0           Boost xpressive module
boost-yap:x64-osx                                  1.73.0           Boost yap module
boost:x64-osx                                      1.73.0           Peer-reviewed portable C++ source libraries
bzip2:x64-osx                                      1.0.6-5          High-quality data compressor.
libffi:x64-osx                                     3.3-2            Portable, high level programming interface to va...
libiconv:x64-osx                                   1.16-3           GNU Unicode text conversion
liblzma:x64-osx                                    5.2.4-5          Compression library with an API similar to that ...
openssl-unix:x64-osx                               1.1.1d-3         OpenSSL is an open source project that provides ...
openssl:x64-osx                                    1.1.1d           OpenSSL is an open source project that provides ...
python3:x64-osx                                    3.7.3-3          The Python programming language as an embeddable...
zlib:x64-osx                                       1.2.11-6         A compression library
zstd:x64-osx                                       1.4.4-1          Zstandard - Fast real-time compression algorithm
rib2bit commented 4 years ago

I found this problem is related to this: https://github.com/microsoft/cpprestsdk/pull/1439

JackBoosY commented 4 years ago

Hi @rib2bit, thanks for reporting this issue! I can't reproduce this issue on my machine, could you provide failure log /Users/hoge/vcpkg/buildtrees/cpprestsdk/config-x64-osx-dbg-err.log?

Thanks.

rib2bit commented 4 years ago

@JackBoosY Here is config-x64-osx-dbg-err.log

-- Setting clang options
CMake Error at cmake/cpprest_find_openssl.cmake:40 (list):
  list GET given empty list
Call Stack (most recent call first):
  src/CMakeLists.txt:130 (cpprest_find_openssl)

It seems that cpprest_find_openssl.cmake expects openssl is installed with homebrew for macOS, but my environment does not have that.

I finally resolved this problem with the patch:
https://github.com/microsoft/cpprestsdk/pull/1439/commits/ccd74e1b62fcffa3c7ac37fc90152433b20baf2f

Thanks.

albyho commented 2 years ago

cmake -G Ninja ../Release -DCMAKE_BUILD_TYPE=Debug -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl@1.1 -DOPENSSL_INCLUDE_DIR=/opt/homebrew/opt/openssl@1.1/include