aws-sdk-cpp
aws-sdk-cpp copied to clipboard
Cmake configuration error "INTERFACE_LIBRARY targets may only have whitelisted properties. The property "LINK_LIBRARIES_ALL" is not allowed."
Confirm by changing [ ] to [x] below to ensure that it's a bug:
- [x] I've gone though Developer Guide and API reference
- [x] I've searched for previous similar issues and didn't find any solution
Describe the bug Run Cmake configuration failed with error:
CMake Error at cmake/dependencies.cmake:15 (get_property):
INTERFACE_LIBRARY targets may only have whitelisted properties. The
property "LINK_LIBRARIES_ALL" is not allowed.
SDK version number 1.9.160
Platform/OS/Hardware/Device What are you running the sdk on? Linux x86_64
To Reproduce (observed behavior) Steps to reproduce the behavior (please share code) The goal is build only s3-crt on custom toolchain Run Cmake in out of source directory:
cmake -G Ninja -DCMAKE_MAKE_PROGRAM=/devroot/tool/ninja -DCMAKE_TOOLCHAIN_FILE=/devroot/3rdparty/version.cmake -DCMAKE_INSTALL_PREFIX=/devroot/3rdparty/build_4.5/linux-llvm-x86_64/lib/.. -DCMAKE_PREFIX_PATH=/devroot/3rdparty/build_4.5/linux-llvm-x86_64/lib/.. -DCMAKE_AR:PATH=x86_64-linux-gnu-ar -DCMAKE_RANLIB:PATH=x86_64-linux-gnu-ranlib -DCMAKE_RC_COMPILER:PATH=x86_64-linux-gnu-windres -DBUILD_TESTING=OFF -DENABLE_TESTING=OFF -DCPP_STANDARD=20 -DBUILD_SHARED_LIBS=OFF -DFORCE_SHARED_CRT=OFF -DCMAKE_INSTALL_PREFIX=/devroot/3rdparty/build_4.5/linux-llvm-x86_64/lib/.. -DCMAKE_PREFIX_PATH=/devroot/3rdparty/build_4.5/linux-llvm-x86_64/lib/.. -DBUILD_ONLY=s3-crt -DENABLE_UNITY_BUILD=ON -DBUILD_DEPS=ON -DFORCE_CURL=ON -DENABLE_CURL_LOGGING=OFF -DANDROID_BUILD_CURL=OFF -DANDROID_BUILD_OPENSSL=OFF -DANDROID_BUILD_ZLIB=OFF -DCUSTOM_MEMORY_MANAGEMENT=OFF /devroot/3rdparty/aws-sdk-cpp
Expected behavior Successful configuration
Logs/output
-- TARGET_ARCH not specified; inferring host OS to be platform compilation target
-- Building AWS libraries as static objects
-- Generating linux build config
-- Building project version: 1.9.160
-- The CXX compiler identification is Clang 11.0.0
-- Check for working CXX compiler: /devroot/3rdparty/build_4.5/linux-llvm-x86_64/bin/x86_64-linux-gnu-clang++
-- Check for working CXX compiler: /devroot/3rdparty/build_4.5/linux-llvm-x86_64/bin/x86_64-linux-gnu-clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ZLIB: /devroot/3rdparty/build_4.5/linux-llvm-x86_64/lib/libz.so (found version "1.2.11")
-- Zlib library: /devroot/3rdparty/build_4.5/linux-llvm-x86_64/lib/libz.so
-- Encryption: Openssl
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found OpenSSL: /devroot/3rdparty/build_4.5/linux-llvm-x86_64/lib/libcrypto.a (found version "1.1.1d")
-- Openssl include directory: /devroot/3rdparty/build_4.5/linux-llvm-x86_64/include
-- Openssl library: /devroot/3rdparty/build_4.5/linux-llvm-x86_64/lib/libssl.a;/devroot/3rdparty/build_4.5/linux-llvm-x86_64/lib/libcrypto.a;-lpthread;dl
-- Http client: Curl
-- Found CURL: /devroot/3rdparty/build_4.5/linux-llvm-x86_64/lib/libcurl.a (found version "7.65.3")
-- Curl include directory: /devroot/3rdparty/build_4.5/linux-llvm-x86_64/include
-- Curl library: /devroot/3rdparty/build_4.5/linux-llvm-x86_64/lib/libcurl.a
-- Performing Test HAVE_ATOMICS_WITHOUT_LIBATOMIC
-- Performing Test HAVE_ATOMICS_WITHOUT_LIBATOMIC - Success
-- The C compiler identification is Clang 11.0.0
-- Check for working C compiler: /devroot/3rdparty/build_4.5/linux-llvm-x86_64/bin/x86_64-linux-gnu-clang
-- Check for working C compiler: /devroot/3rdparty/build_4.5/linux-llvm-x86_64/bin/x86_64-linux-gnu-clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- AWS CRT C++ v0.17.1
CMake Warning (dev) at crt/aws-crt-cpp/crt/aws-c-common/CMakeLists.txt:5 (option):
Policy CMP0077 is not set: option() honors normal variables. Run "cmake
--help-policy CMP0077" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.
For compatibility with older versions of CMake, option is clearing the
normal variable 'STATIC_CRT'.
This warning is for project developers. Use -Wno-dev to suppress it.
-- CMake 3.16.3
-- Performing Test AWS_HAVE_GCC_OVERFLOW_MATH_EXTENSIONS
-- Performing Test AWS_HAVE_GCC_OVERFLOW_MATH_EXTENSIONS - Success
-- Performing Test AWS_HAVE_MSVC_MULX
-- Performing Test AWS_HAVE_MSVC_MULX - Failed
-- Performing Test AWS_HAVE_WINAPI_DESKTOP
-- Performing Test AWS_HAVE_WINAPI_DESKTOP - Failed
-- Performing Test AWS_ARCH_INTEL
-- Performing Test AWS_ARCH_INTEL - Success
-- Performing Test AWS_ARCH_ARM64
-- Performing Test AWS_ARCH_ARM64 - Failed
-- Performing Test AWS_ARCH_ARM32
-- Performing Test AWS_ARCH_ARM32 - Failed
-- Performing Test AWS_HAVE_GCC_INLINE_ASM
-- Performing Test AWS_HAVE_GCC_INLINE_ASM - Success
-- Performing Test AWS_HAVE_AUXV
-- Performing Test AWS_HAVE_AUXV - Failed
-- Performing Test AWS_HAVE_EXECINFO
-- Performing Test AWS_HAVE_EXECINFO - Success
-- Performing Test HAVE_M_AVX2_FLAG
-- Performing Test HAVE_M_AVX2_FLAG - Success
-- Performing Test HAVE_AVX2_INTRINSICS
-- Performing Test HAVE_AVX2_INTRINSICS - Success
-- Performing Test HAVE_MM256_EXTRACT_EPI64
-- Performing Test HAVE_MM256_EXTRACT_EPI64 - Success
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Performing Test HAS_FPIC_FLAG
-- Performing Test HAS_FPIC_FLAG - Success
-- Performing Test HAS_MOUTLINE_ATOMICS
-- Performing Test HAS_MOUTLINE_ATOMICS - Failed
-- Performing Test HAS_64BIT_FILE_OFFSET_BY_DEFAULT
-- Performing Test HAS_64BIT_FILE_OFFSET_BY_DEFAULT - Success
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stdbool.h
-- Looking for stdbool.h - found
-- Performing Test HAS_WGNU
-- Performing Test HAS_WGNU - Success
-- Performing Test NO_GNU_EXPR
-- Performing Test NO_GNU_EXPR - Success
-- Performing Test HAVE_SYSCONF
-- Performing Test HAVE_SYSCONF - Success
-- Looking for pthread_attr_setaffinity_np
-- Looking for pthread_attr_setaffinity_np - found
-- Performing Test HAS_SANITIZERS
-- Performing Test HAS_SANITIZERS - Success
-- attempting to use sanitizer list address;undefined
-- Building SIMD base64 decoder
-- Packaging currently only supported on Fedora.
-- Detected CMAKE_SYSTEM_PROCESSOR as x86_64
-- Detected 64-Bit system
-- The ASM compiler identification is Clang
-- Found assembler: /devroot/3rdparty/build_4.5/linux-llvm-x86_64/bin/x86_64-linux-gnu-clang
-- Enabling SIKEP434R3 assembly code
-- Enabling BIKE_R3 x86_64 optimizations
-- Enabling Kyber_R3 x86_64 optimizations
-- Support for ADX assembly instructions detected
-- Found LibCrypto: /devroot/3rdparty/build_4.5/linux-llvm-x86_64/lib/libcrypto.a
-- LibCrypto Include Dir: /devroot/3rdparty/build_4.5/linux-llvm-x86_64/include
-- LibCrypto Shared Lib: /devroot/3rdparty/build_4.5/linux-llvm-x86_64/lib/libcrypto.a
-- LibCrypto Static Lib: /devroot/3rdparty/build_4.5/linux-llvm-x86_64/lib/libcrypto.a
-- attempting to use sanitizer list address;undefined
-- Using libcrypto from system: /devroot/3rdparty/build_4.5/linux-llvm-x86_64/lib/libcrypto.a
-- attempting to use sanitizer list address;undefined
-- attempting to use sanitizer list address;undefined
-- attempting to use sanitizer list address;undefined
-- attempting to use sanitizer list address;undefined
-- attempting to use sanitizer list address;undefined
-- attempting to use sanitizer list address;undefined
-- attempting to use sanitizer list address;undefined
-- attempting to use sanitizer list address;undefined
-- Add s3-crt:s3 to C2J_SPECIAL_NAME_LIST
-- Considering s3-crt
-- Looking for pathconf
-- Looking for pathconf - found
-- Looking for umask
-- Looking for umask - found
-- Updating version info to 1.9.160
-- Custom memory management disabled
-- Performing Test CURL_HAS_H2
-- Performing Test CURL_HAS_H2 - Failed
-- Performing Test CURL_HAS_TLS_PROXY
-- Performing Test CURL_HAS_TLS_PROXY - Failed
CMake Error at cmake/dependencies.cmake:15 (get_property):
INTERFACE_LIBRARY targets may only have whitelisted properties. The
property "LINK_LIBRARIES_ALL" is not allowed.
Call Stack (most recent call first):
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:61 (compute_links)
cmake/sdks.cmake:253 (sort_links)
CMakeLists.txt:280 (add_sdks)
CMake Error at cmake/dependencies.cmake:20 (set_property):
INTERFACE_LIBRARY targets may only have whitelisted properties. The
property "LINK_LIBRARIES_ALL" is not allowed.
Call Stack (most recent call first):
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:61 (compute_links)
cmake/sdks.cmake:253 (sort_links)
CMakeLists.txt:280 (add_sdks)
CMake Error at cmake/dependencies.cmake:25 (get_target_property):
INTERFACE_LIBRARY targets may only have whitelisted properties. The
property "LINK_LIBRARIES" is not allowed.
Call Stack (most recent call first):
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:61 (compute_links)
cmake/sdks.cmake:253 (sort_links)
CMakeLists.txt:280 (add_sdks)
CMake Error at cmake/dependencies.cmake:35 (get_target_property):
INTERFACE_LIBRARY targets may only have whitelisted properties. The
property "LINK_LIBRARIES_ALL" is not allowed.
Call Stack (most recent call first):
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:61 (compute_links)
cmake/sdks.cmake:253 (sort_links)
CMakeLists.txt:280 (add_sdks)
CMake Error at cmake/dependencies.cmake:15 (get_property):
INTERFACE_LIBRARY targets may only have whitelisted properties. The
property "LINK_LIBRARIES_ALL" is not allowed.
Call Stack (most recent call first):
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:61 (compute_links)
cmake/sdks.cmake:253 (sort_links)
CMakeLists.txt:280 (add_sdks)
CMake Error at cmake/dependencies.cmake:20 (set_property):
INTERFACE_LIBRARY targets may only have whitelisted properties. The
property "LINK_LIBRARIES_ALL" is not allowed.
Call Stack (most recent call first):
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:61 (compute_links)
cmake/sdks.cmake:253 (sort_links)
CMakeLists.txt:280 (add_sdks)
CMake Error at cmake/dependencies.cmake:25 (get_target_property):
INTERFACE_LIBRARY targets may only have whitelisted properties. The
property "LINK_LIBRARIES" is not allowed.
Call Stack (most recent call first):
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:61 (compute_links)
cmake/sdks.cmake:253 (sort_links)
CMakeLists.txt:280 (add_sdks)
CMake Error at cmake/dependencies.cmake:35 (get_target_property):
INTERFACE_LIBRARY targets may only have whitelisted properties. The
property "LINK_LIBRARIES_ALL" is not allowed.
Call Stack (most recent call first):
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:34 (compute_links)
cmake/dependencies.cmake:61 (compute_links)
cmake/sdks.cmake:253 (sort_links)
CMakeLists.txt:280 (add_sdks)
-- Configuring incomplete, errors occurred!
See also "/devroot/3rdparty/build_tmp/CMakeFiles/CMakeOutput.log".
See also "/devroot/3rdparty/build_tmp/CMakeFiles/CMakeError.log".
make[1]: *** [3rdparty.mk:211: aws-sdk] Error 1
make[1]: Leaving directory '/devroot/develop/src'
make: *** [3rdparty.mk:842: linux-llvm-x86_64-aws-sdk] Error 2
Hi @slonm ,
I am not able to reproduce this on my side... but I do see in your logs that you have an old version of the crt dependencies -- AWS CRT C++ v0.17.1 Could you try updating that and tell me if you still see this issue?
Hi @KaibaLopez , Not quite understand you. I cloned repo like described in https://github.com/aws/aws-sdk-cpp
git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp
Also I see last commit message on crt directory 'Upgrading CRT to version v0.17.1'
What should i do for upgrade CRT and what version should be?
sorry yea you're right, it's just that on your cmake logs it shows:
...
-- AWS CRT C++ v0.17.1
Where mine shows:
...
-- AWS CRT C++ 1.9.21-178-gd558014c3b
Can you try running this in the aws-sdk-cpp/ folder just in case tho:
git submodule update --init --recursive
But yea, I have not seen this kind of error before so I'm a bit lost as to what the root cause could be, I am using the same clang version as the one showing on your logs and though my cmake version is a newer one (3.22), I don't think that would cause this... Is there anything else you think that I could try in order to reproduce this? Anything especial about your environment ? What happens if you simplify your cmake arguments? Do you still get the same errors if you don't set things rc_compiler/CMAKE_AR/RANLIB ?
git submodule update --init --recursive
makes no changes and AWS CRT C++ left v0.17.1 in the cmake output.
I've upgraded Cmake up to 3.22.1 and issue is gone.
I suggest bump required Cmake version in project configuration
Apparently Threads::Threads is an interface library on some system. I encountered the same error with CMake 3.10.2, and applying the following patch fixed the issue.
diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake
index 30c665341f..ac8a15a2be 100644
--- a/cmake/dependencies.cmake
+++ b/cmake/dependencies.cmake
@@ -30,6 +30,17 @@ function(compute_links lib)
# For each direct link append it and its links
foreach(link ${links})
if(TARGET ${link}) # Collect only target links
+ get_target_property(link_type ${link} TYPE)
+ if(link_type STREQUAL "INTERFACE_LIBRARY")
+ # A custom property LINK_LIBRARIES_ALL can't be set to INTERFACE libraries.
+ # We have to allow Threads::Threads, which might be an interface library.
+ if(link STREQUAL "Threads::Threads")
+ continue()
+ elseif()
+ message(STATUS "Library '${lib}' uses link '${link}'.")
+ message(FATAL_ERROR "Algorithm doesn't work with interface libraries.")
+ endif()
+ endif()
compute_links(${link})
get_target_property(link_links_all ${link} LINK_LIBRARIES_ALL)
set_property(TARGET ${lib} APPEND PROPERTY
If my patch seems OK, I'm ready to send a PR.
Well. If "A custom property LINK_LIBRARIES_ALL can't be set to INTERFACE libraries." then what for check especially Threads::Threads?
I think makes sense ignore depencies for all INTERFACE libraries
I thought it's too permissive to ignore all INTERFACE libs.
I'm reasonably confident that Thread::Thread can be ignored, but not sure for other libs. If some INTERFACE libs slipped in as deps in future, then the libs they depends on wouldn't be collected. Such a situation may cause an intricate error.
I don't sure but looks like the problem with version of crt can be connected with running cmake out ouf source directory (when cmake build dir is not subdirectory of aws-sdk-cpp directory). In aws-sdk-cpp/crt/aws-crt-cpp/CMakeLists.txt we can see the next code:
if (NOT DEFINED AWS_CRT_CPP_VERSION)
set(AWS_CRT_CPP_VERSION "v0.17.1")
# Try to determine the current git tag and use that as the version
execute_process(COMMAND git describe --tags
RESULT_VARIABLE GIT_EXIT_CODE
OUTPUT_VARIABLE GIT_TAG
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
if (NOT GIT_EXIT_CODE)
set(AWS_CRT_CPP_VERSION ${GIT_TAG})
endif()
endif()
If comment out ERROR_QUIET I get the following error message:
fatal: Not a git repository (or any parent up to mount point /src/cmake-build)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
If add to execute_process parameter WORKING_DIRECTORY "/src/aws-sdk-cpp" it work for me. So looks like there is problem with running cmake out of source directory.
But also looks like OP's error not connected with crt version. In my case it connected to absents of openssl-devel and libcurl-devel on builder. If I run cmake configuration, get error Could not find openssl than install openssl and libcurl and rerun cmake configuration without deleting cmake chache (I delete all files in cmake build dir) this leads to error:
CMake Error at cmake/dependencies.cmake:20 (set_property):
INTERFACE_LIBRARY targets may only have whitelisted properties. The
property "LINK_LIBRARIES_ALL" is not allowed.
Hope it helps someone.
Apparently Threads::Threads is an interface library on some system. I encountered the same error with CMake 3.10.2, and applying the following patch fixed the issue.
diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake index 30c665341f..ac8a15a2be 100644 --- a/cmake/dependencies.cmake +++ b/cmake/dependencies.cmake @@ -30,6 +30,17 @@ function(compute_links lib) # For each direct link append it and its links foreach(link ${links}) if(TARGET ${link}) # Collect only target links + get_target_property(link_type ${link} TYPE) + if(link_type STREQUAL "INTERFACE_LIBRARY") + # A custom property LINK_LIBRARIES_ALL can't be set to INTERFACE libraries. + # We have to allow Threads::Threads, which might be an interface library. + if(link STREQUAL "Threads::Threads") + continue() + elseif() + message(STATUS "Library '${lib}' uses link '${link}'.") + message(FATAL_ERROR "Algorithm doesn't work with interface libraries.") + endif() + endif() compute_links(${link}) get_target_property(link_links_all ${link} LINK_LIBRARIES_ALL) set_property(TARGET ${lib} APPEND PROPERTYIf my patch seems OK, I'm ready to send a PR.
I can confirm, it works over CentOS7. I'm using v1.9.234
I thought it's too permissive to ignore all INTERFACE libs.
I'm reasonably confident that Thread::Thread can be ignored, but not sure for other libs. If some INTERFACE libs slipped in as deps in future, then the libs they depends on wouldn't be collected. Such a situation may cause an intricate error.
Apparently Threads::Threads is an interface library on some system. I encountered the same error with CMake 3.10.2, and applying the following patch fixed the issue.
diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake index 30c665341f..ac8a15a2be 100644 --- a/cmake/dependencies.cmake +++ b/cmake/dependencies.cmake @@ -30,6 +30,17 @@ function(compute_links lib) # For each direct link append it and its links foreach(link ${links}) if(TARGET ${link}) # Collect only target links + get_target_property(link_type ${link} TYPE) + if(link_type STREQUAL "INTERFACE_LIBRARY") + # A custom property LINK_LIBRARIES_ALL can't be set to INTERFACE libraries. + # We have to allow Threads::Threads, which might be an interface library. + if(link STREQUAL "Threads::Threads") + continue() + elseif() + message(STATUS "Library '${lib}' uses link '${link}'.") + message(FATAL_ERROR "Algorithm doesn't work with interface libraries.") + endif() + endif() compute_links(${link}) get_target_property(link_links_all ${link} LINK_LIBRARIES_ALL) set_property(TARGET ${lib} APPEND PROPERTYIf my patch seems OK, I'm ready to send a PR.
It works for me on CentOS7 (container env).
Is anyone still having problems with this?
Greetings! It looks like this issue hasn’t been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one.