python3 + openssl compilation fail
See original GitHub issueVersions
- 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:
- Created 5 years ago
- Comments:10 (7 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
tocorepython3
, and making a newpython3
recipe that depends on bothcorepython3
andopenssl
- so the default ofpython3
would pull in all the deps likeopenssl
, while people who want a tiny app can still use justcorepython3
(ortinypython3
or however you want to name it)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