Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pycrypto recipe is arm7 only #2457

Closed
RobertFlatt opened this issue May 27, 2021 · 1 comment
Closed

pycrypto recipe is arm7 only #2457

RobertFlatt opened this issue May 27, 2021 · 1 comment

Comments

@RobertFlatt
Copy link
Contributor

Checklist

  • [ x] the issue is indeed a bug and not a support request
  • [x ] issue doesn't already exist: https://github.com/kivy/python-for-android/issues
  • [ x] I have a short, runnable example that reproduces the issue
  • [x ] I reproduced the problem with the latest development version (p4a.branch = develop)
  • [ x] I used the grave accent (aka backticks) to format code or logs when appropriated

Versions

  • Python: 3.8.4
  • OS: WSL
  • Kivy: 2.0.0
  • Cython:
  • OpenJDK:

Description

Pycrypto recipe has a C compile error with android.arch = arm64-v8a but not with android.arch = armeabi-v7a

Error message is about --enable-shared but I suspect this is misdirection, because this option is used in 14 other recipes.

It looks like the architecture is hard coded https://github.com/kivy/python-for-android/blob/develop/pythonforandroid/recipes/pycrypto/__init__.py#L38

I tried '--host=' + arch.command_prefix, but this did not help. So much for guessing.

Logs

[INFO]:    Building pycrypto for arm64-v8a
[INFO]:    Crypto apparently isn't already in site-packages
[INFO]:    Configuring compiled components in pycrypto
[INFO]:    -> directory context /home/bobf/ex/pyrebase/.buildozer/android/platform/build-arm64-v8a/build/other_builds/pycrypto/arm64-v8a__ndk_target_21/pycrypto
[INFO]:    -> running configure --host=arm-eabi --prefix=/home/bobf/ex/pyrebase/.buildozer/a...(and 78 more)
           working: See `config.log' for more details                                                                  Exception in thread background thread for pid 11746:
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/home/bobf/.local/lib/python3.8/site-packages/sh.py", line 1662, in wrap
    fn(*args, **kwargs)
  File "/home/bobf/.local/lib/python3.8/site-packages/sh.py", line 2606, in background_thread
    handle_exit_code(exit_code)
  File "/home/bobf/.local/lib/python3.8/site-packages/sh.py", line 2304, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/bobf/.local/lib/python3.8/site-packages/sh.py", line 877, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_77:

  RAN: /home/bobf/ex/pyrebase/.buildozer/android/platform/build-arm64-v8a/build/other_builds/pycrypto/arm64-v8a__ndk_target_21/pycrypto/configure --host=arm-eabi --prefix=/home/bobf/ex/pyrebase/.buildozer/android/platform/build-arm64-v8a/build/python-installs/pyrebase --enable-shared

  STDOUT:
configure: WARNING: unrecognized options: --enable-shared
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-eabi-strip... aarch64-linux-android-strip --strip-unneeded
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make -j12 sets $(MAKE)... yes
checking for style of include used by make -j12... GNU
checking for arm-eabi-gcc... /home/bobf/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -I/home/bobf/ex/pyrebase/.buildozer/android/platform/build-arm64-v8a/build/other_builds/openssl/arm64-v8a__ndk_target_21/openssl1.1/include -I/home/bobf/ex/pyrebase/.buildozer/android/platform/build-arm64-v8a/build/other_builds/openssl/arm64-v8a__ndk_target_21/openssl1.1/include/internal -I/home/bobf/ex/pyrebase/.buildozer/android/platform/build-arm64-v8a/build/other_builds/openssl/arm64-v8a__ndk_target_21/openssl1.1/include/openssl
checking whether the C compiler works... no
configure: error: in `/home/bobf/ex/pyrebase/.buildozer/android/platform/build-arm64-v8a/build/other_builds/pycrypto/arm64-v8a__ndk_target_21/pycrypto':
configure: error: C compiler cannot create executables
See `config.log' for more details


  STDERR:

Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/bobf/ex/pyrebase/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1276, in <module>
    main()
  File "/home/bobf/ex/pyrebase/.buildozer/android/platform/python-for-android/pythonforandroid/entrypoints.py", line 18, in main
    ToolchainCL()
  File "/home/bobf/ex/pyrebase/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 725, in __init__
    getattr(self, command)(args)
  File "/home/bobf/ex/pyrebase/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 153, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/home/bobf/ex/pyrebase/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 212, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx,
  File "/home/bobf/ex/pyrebase/.buildozer/android/platform/python-for-android/pythonforandroid/build.py", line 580, in build_recipes
    recipe.build_arch(arch)
  File "/home/bobf/ex/pyrebase/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 1010, in build_arch
    self.build_compiled_components(arch)
  File "/home/bobf/ex/pyrebase/.buildozer/android/platform/python-for-android/pythonforandroid/recipes/pycrypto/__init__.py", line 38, in build_compiled_components
    shprint(configure, '--host=arm-eabi',
  File "/home/bobf/ex/pyrebase/.buildozer/android/platform/python-for-android/pythonforandroid/logger.py", line 167, in shprint
    for line in output:
  File "/home/bobf/.local/lib/python3.8/site-packages/sh.py", line 925, in next
    self.wait()
  File "/home/bobf/.local/lib/python3.8/site-packages/sh.py", line 849, in wait
    self.handle_command_exit_code(exit_code)
  File "/home/bobf/.local/lib/python3.8/site-packages/sh.py", line 877, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_77:

  RAN: /home/bobf/ex/pyrebase/.buildozer/android/platform/build-arm64-v8a/build/other_builds/pycrypto/arm64-v8a__ndk_target_21/pycrypto/configure --host=arm-eabi --prefix=/home/bobf/ex/pyrebase/.buildozer/android/platform/build-arm64-v8a/build/python-installs/pyrebase --enable-shared

  STDOUT:
configure: WARNING: unrecognized options: --enable-shared
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-eabi-strip... aarch64-linux-android-strip --strip-unneeded
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make -j12 sets $(MAKE)... yes
checking for style of include used by make -j12... GNU
checking for arm-eabi-gcc... /home/bobf/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -I/home/bobf/ex/pyrebase/.buildozer/android/platform/build-arm64-v8a/build/other_builds/openssl/arm64-v8a__ndk_target_21/openssl1.1/include -I/home/bobf/ex/pyrebase/.buildozer/android/platform/build-arm64-v8a/build/other_builds/openssl/arm64-v8a__ndk_target_21/openssl1.1/include/internal -I/home/bobf/ex/pyrebase/.buildozer/android/platform/build-arm64-v8a/build/other_builds/openssl/arm64-v8a__ndk_target_21/openssl1.1/include/openssl
checking whether the C compiler works... no
configure: error: in `/home/bobf/ex/pyrebase/.buildozer/android/platform/build-arm64-v8a/build/other_builds/pycrypto/arm64-v8a__ndk_target_21/pycrypto':
configure: error: C compiler cannot create executables
See `config.log' for more details


  STDERR:

# Command failed: /usr/bin/python3 -m pythonforandroid.toolchain create --dist_name=pyrebase --bootstrap=sdl2 --requirements=python3,kivy==2.0.0,pyrebase,requests,urllib3,chardet,idna,gcloud,oauth2client,requests-toolbelt,protobuf_cpp,python-jwt,pycrypto,httplib2,pyparsing,pyasn1,pyasn1_modules,rsa,jwcrypto,cryptography --arch arm64-v8a --copy-libs --color=always --storage-dir="/home/bobf/ex/pyrebase/.buildozer/android/platform/build-arm64-v8a" --ndk-api=21 --ignore-setup-py
# ENVIRONMENT:
#     SHELL = '/bin/bash'
#     WSL_DISTRO_NAME = 'Ubuntu-20.04'
#     NAME = 'DESK'
#     PWD = '/home/bobf/ex/pyrebase'
#     LOGNAME = 'bobf'
#     KIVY = '/mnt/c/users/bobf/documents/kivy'
#     UIMD = '/mnt/c/users/bobf/documents/pm/uimd'
#     HOME = '/home/bobf'
#     LANG = 'C.UTF-8'
#     WSL_INTEROP = '/run/WSL/7_interop'
#     LS_COLORS = 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:'
#     LESSCLOSE = '/usr/bin/lesspipe %s %s'
#     TERM = 'xterm-256color'
#     LESSOPEN = '| /usr/bin/lesspipe %s'
#     USER = 'bobf'
#     WIN = '/mnt/c/users/bobf'
#     SHLVL = '1'
#     WSLENV = ''
#     XDG_DATA_DIRS = '/usr/local/share:/usr/share:/var/lib/snapd/desktop'
#     PATH = '/home/bobf/.buildozer/android/platform/apache-ant-1.9.4/bin:/home/bobf/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/bobf/.local/bin/'
#     HOSTTYPE = 'x86_64'
#     OLDPWD = '/home/bobf/ex/pyrebase/p4a-recipes/pycrypto'
#     _ = '/home/bobf/.local/bin/buildozer'
#     PACKAGES_PATH = '/home/bobf/.buildozer/android/packages'
#     ANDROIDSDK = '/home/bobf/.buildozer/android/platform/android-sdk'
#     ANDROIDNDK = '/home/bobf/.buildozer/android/platform/android-ndk-r19c'
#     ANDROIDAPI = '27'
#     ANDROIDMINAPI = '21'
#
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2
@RobertFlatt
Copy link
Contributor Author

pycryptodome is a drop in replacement for pycrypto , works 32 and 64 bit.

Sorry for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant