question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

python3 + openssl compilation fail

See original GitHub issue

Versions

  • Python: Host Python 3.6.8, target Python 3.7.1
  • OS: Ubuntu 18.04
  • Kivy: 1.10.1
  • Cython: 0.28.6

Description

Compilation is failing if python3 and openssl are both in the recipe list, but python3 gets compiled first

Command:

# Command failed: /usr/bin/python3 -m pythonforandroid.toolchain create --dist_name=etheroll --bootstrap=sdl2 --requirements=android,cffi,openssl,python3==3.7.1 --ndk-api 27 --arch armeabi-v7a --copy-libs --local-recipes /home/andre/workspace/EtherollApp/src/python-for-android/recipes --color=always --storage-dir="/home/andre/workspace/EtherollApp/.buildozer/android/platform/build" --ndk-api=27

Logs

Console log:

configure: WARNING: unrecognized options: --with-openssl
checking build system type... x86_64-pc-linux-gnu
checking host system type... arm-unknown-linux-androideabi
checking for python3.6... python3.6
checking for python interpreter for cross build... python3.6
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... linux
checking for --without-gcc... no
checking for --with-icc... no
checking for arm-linux-androideabi-gcc... /home/andre/.buildozer/android/platform/android-ndk-r17c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-none-linux-androideabi -gcc-toolchain /home/andre/.buildozer/android/platform/android-ndk-r17c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64
checking whether the C compiler works... no
configure: error: in `/home/andre/workspace/EtherollApp/.buildozer/android/platform/build/build/other_builds/python3-libffi-openssl/armeabi-v7a__ndk_target_27/python3/android-build':
configure: error: C compiler cannot create executables
See `config.log' for more details

Relevant .buildozer/android/platform/build/build/other_builds/python3-libffi-openssl/armeabi-v7a__ndk_target_27/python3/android-build/config.log part:

/home/andre/.buildozer/android/platform/android-ndk-r17c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lcrypto1.1
/home/andre/.buildozer/android/platform/android-ndk-r17c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lssl1.1

And listing the directory .buildozer/android/platform/build/build/other_builds/openssl-python3/armeabi-v7a__ndk_target_27/openssl1.1 I couldn’t indeed find the shared libssl and libcrypto objects.

This is because python3 was compiled before openssl was. The fix should be fairly simple, basically in python3 recipe we need to dynamically add openssl to the depends list if the openssl recipe is present in the requirements list

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Jan 15, 2019

We discussed this here #1576 but I think python3 should always pull in openssl as a dependency unless some tiny option is set.

This could be achieved e.g. by renaming python3 to corepython3, and making a new python3 recipe that depends on both corepython3 and openssl - so the default of python3 would pull in all the deps like openssl, while people who want a tiny app can still use just corepython3 (or tinypython3 or however you want to name it)

1reaction
AndreMirascommented, Jan 14, 2019

Thanks for your feedback! As for the order thingy I didn’t know that one. The order I had it was: android,cffi,openssl,python3==3.7.1 and well the CI is seems to be running fine with: libffi,sdl2,pyjnius,kivy,python3,openssl,requests,sqlite3,setuptools I think it would be great if that was handled seamlessly by p4a recipes, just like pip is resolving dependency order himself seamlessly. In the meantime I’ll play with Docker to confirm and give more insight about it

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building Python 3.7.1 - SSL module failed - Stack Overflow
Compiling Python3. The key here is understanding that the path you define with --with-openssl= is where Python looks for /openssl/lib.
Read more >
[Python-Dev] compiled python3.10 is unable to find _ssl
I am having compilation issues again with python3.10 with ssl . The ./configure was invoked with ssl options and ssl modules seems to...
Read more >
Issue 34028: Python 3.7.0 wont compile with SSL Support 1.1 ...
when compiling Python 3.7.0 setup.py is reporting that the ssl module failed to compile due to missing support for X509_VERIFY_PARAM_set1_host() ...
Read more >
Python 3.x fails compilation against OpenSSL configured with ...
Python 3.x fails compilation against OpenSSL configured with SSLv3 support: "implicit declaration of function 'SSLv3_method'" #2181.
Read more >
Failed to install Python 3.10.6 with user installed OpenSSL
The compiled and installed Python cannot use the ssl module to install packages. I tried to clean everything and reinstall, both OpenSSL and ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found