awslabs / aws-crt-python

Python bindings for the AWS Common Runtime
Apache License 2.0
87 stars 43 forks source link

Target "LibCrypto::Crypto" not found #191

Closed rsbethke closed 4 years ago

rsbethke commented 4 years ago

I'm trying to install this module on linux and I've tried a few different docker images so far (ubuntu, amazonlinux,etc). On ubuntu I've installed libssl-dev. but still get a Target "LibCrypto::Crypto" not found.

I also see an error stating: CMake Error at CMakeLists.txt:191 (add_library): Target "s2n" links to target "LibCrypto::Crypto" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

The full error message is listed below:

Building wheels for collected packages: awscrt Building wheel for awscrt (setup.py) ... error ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-82_ntag4/awscrt/setup.py'"'"'; file='"'"'/tmp/pip-install-82_ntag4/awscrt/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-_fl4_n4h cwd: /tmp/pip-install-82_ntag4/awscrt/ Complete output (130 lines): running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.8 creating build/lib.linux-x86_64-3.8/awscrt copying awscrt/auth.py -> build/lib.linux-x86_64-3.8/awscrt copying awscrt/exceptions.py -> build/lib.linux-x86_64-3.8/awscrt copying awscrt/awsiot_mqtt_connection_builder.py -> build/lib.linux-x86_64-3.8/awscrt copying awscrt/io.py -> build/lib.linux-x86_64-3.8/awscrt copying awscrt/http.py -> build/lib.linux-x86_64-3.8/awscrt copying awscrt/init.py -> build/lib.linux-x86_64-3.8/awscrt copying awscrt/mqtt.py -> build/lib.linux-x86_64-3.8/awscrt copying awscrt/crypto.py -> build/lib.linux-x86_64-3.8/awscrt running build_ext cmake version 3.16.3

CMake suite maintained and supported by Kitware (kitware.com/cmake). --- Building dependency: s2n (RelWithDebInfo) --- cmake -DCMAKE_PREFIX_PATH=/tmp/pip-install-82_ntag4/awscrt/build/deps/install -DCMAKE_INSTALL_PREFIX=/tmp/pip-install-82_ntag4/awscrt/build/deps/install -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=OFF -DCMAKE_INCLUDE_PATH=\"/usr/include/python3.8\" -DLibCrypto_INCLUDE_DIR=/tmp/pip-install-82_ntag4/awscrt/build/deps/libcrypto/include -DLibCrypto_STATIC_LIBRARY=/tmp/pip-install-82_ntag4/awscrt/build/deps/libcrypto/lib/libcrypto.a /tmp/pip-install-82_ntag4/awscrt/crt/s2n -- The C compiler identification is GNU 9.3.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Looking for pthread.h -- Looking for pthread.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- Check if compiler accepts -pthread -- Check if compiler accepts -pthread - yes -- Found Threads: TRUE -- Attempting to try_compile PQ ASM -- The ASM compiler identification is GNU -- Found assembler: /usr/bin/cc -- PQ ASM try_compile succeeded - using optimized x86_64 assembly for PQ crypto -- Attempting to try_compile PQ ASM with ADX support -- PQ ASM try_compile with ADX support succeeded - using ASM code with ADX instructions -- Performing Test S2N_HAVE_EXECINFO -- Performing Test S2N_HAVE_EXECINFO - Success -- Found LibCrypto: /tmp/pip-install-82_ntag4/awscrt/build/deps/libcrypto/lib/libcrypto.a -- LibCrypto Include Dir: /tmp/pip-install-82_ntag4/awscrt/build/deps/libcrypto/include -- LibCrypto Shared Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so -- LibCrypto Static Lib: /tmp/pip-install-82_ntag4/awscrt/build/deps/libcrypto/lib/libcrypto.a -- Configuring done CMake Error at CMakeLists.txt:191 (add_library): Target "s2n" links to target "LibCrypto::Crypto" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:239 (target_include_directories): Error evaluating generator expression:

  $<TARGET_PROPERTY:LibCrypto::Crypto,INTERFACE_INCLUDE_DIRECTORIES>

Target "LibCrypto::Crypto" not found.

CMake Error at CMakeLists.txt:239 (target_include_directories): Error evaluating generator expression:

  $<TARGET_PROPERTY:LibCrypto::Crypto,INTERFACE_INCLUDE_DIRECTORIES>

Target "LibCrypto::Crypto" not found.

CMake Error at CMakeLists.txt:239 (target_include_directories): Error evaluating generator expression:

  $<TARGET_PROPERTY:LibCrypto::Crypto,INTERFACE_INCLUDE_DIRECTORIES>

Target "LibCrypto::Crypto" not found.

CMake Error at CMakeLists.txt:239 (target_include_directories): Error evaluating generator expression:

  $<TARGET_PROPERTY:LibCrypto::Crypto,INTERFACE_INCLUDE_DIRECTORIES>

Target "LibCrypto::Crypto" not found.

CMake Error at CMakeLists.txt:191 (add_library): Target "s2n" links to target "LibCrypto::Crypto" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

-- Generating done CMake Warning: Manually-specified variables were not used by the project:

  CMAKE_INCLUDE_PATH

CMake Generate step failed. Build files cannot be regenerated correctly. Traceback (most recent call last): File "", line 1, in File "/tmp/pip-install-82_ntag4/awscrt/setup.py", line 245, in setuptools.setup( File "/usr/lib/python3/dist-packages/setuptools/init.py", line 144, in setup return distutils.core.setup(**attrs) File "/usr/lib/python3.8/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/lib/python3.8/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/usr/lib/python3/dist-packages/wheel/bdist_wheel.py", line 223, in run self.run_command('build') File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/usr/lib/python3.8/distutils/command/build.py", line 135, in run self.run_command(cmd_name) File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/tmp/pip-install-82_ntag4/awscrt/setup.py", line 179, in run self._build_dependency(lib) File "/tmp/pip-install-82_ntag4/awscrt/setup.py", line 162, in _build_dependency subprocess.check_call(cmake_args) File "/usr/lib/python3.8/subprocess.py", line 364, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', '-DCMAKE_PREFIX_PATH=/tmp/pip-install-82_ntag4/awscrt/build/deps/install', '-DCMAKE_INSTALL_PREFIX=/tmp/pip-install-82_ntag4/awscrt/build/deps/install', '-DBUILD_SHARED_LIBS=OFF', '-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-DBUILD_TESTING=OFF', '-DCMAKE_INCLUDE_PATH="/usr/include/python3.8"', '-DLibCrypto_INCLUDE_DIR=/tmp/pip-install-82_ntag4/awscrt/build/deps/libcrypto/include', '-DLibCrypto_STATIC_LIBRARY=/tmp/pip-install-82_ntag4/awscrt/build/deps/libcrypto/lib/libcrypto.a', '/tmp/pip-install-82_ntag4/awscrt/crt/s2n']' returned non-zero exit status 1.

ERROR: Failed building wheel for awscrt

danpeeei commented 4 years ago

I had the same problem as @rsbethke when using Python3.8.0 in Ubuntu18.04

But, The problem did not ocuur when using Python3.7.5 or 3.6.9

marklombardi commented 4 years ago

I have the same issue running Python 3.5.3 on Open Embedded ARM Linux (Yocto)

awscrtpython-LibCrypto-NotFound.txt

11ange commented 4 years ago

Same here: Python 3.7.3 with Raspberry Pi OS (previously called Raspbian) Err awscrt.txt

bretambrose commented 4 years ago

Apologies and thanks for bringing this to our attention. We are currently working on a fix, but in the meantime, we suggest reverting to 0.9.1 of awscrt (if consuming it directly) or 1.5.0 of awsiotsdk.

graebm commented 4 years ago

This should be fixed in the latest release: 0.9.10

Versions 0.9.2-0.9.9 had issues with missing wheels for python 3.8 & 3.9 on Linux x86_64, and missing wheels for all python versions on Linux aarch64. When precompiled wheels are missing, pip attempts to compile the C extensions locally, which requires your machine to be set up in a very specific way, so you were seeing these failures.

Anyway, things should work now for the majority of linux distros. We are still working on Python 3.9 wheels for Mac and Windows though...

graebm commented 4 years ago

This should also be fixed in the latest awsiotsdk: 1.5.2 which now uses awscrt 0.9.10