Skip to content

[ERROR] Building cffi for armeabi-v7a #2161

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

Closed
allasca opened this issue Apr 29, 2020 · 2 comments
Closed

[ERROR] Building cffi for armeabi-v7a #2161

allasca opened this issue Apr 29, 2020 · 2 comments

Comments

@allasca
Copy link

allasca commented Apr 29, 2020

Versions

  • Python: 3.8.2
  • OS: ubuntu 20.04
  • Kivy: 1.10.1
  • Cython: 0.29.17

Description

build failed when Building cffi for armeabi-v7a

buildozer.spec

Command:

p4a apk --private $HOME/app --package=id.allasca.app --name "App" --version 0.1 --bootstrap=sdl2 --requirements=python3,kivy,kivymd,pycryptodome,colorama,random,json,requests,time,socketio,ssl,websocket,codecs,queue,threading --orientation "portait" --permission INTERNET --presplash-color "white" --wakelock --blacklist-requirements=sqlite3 --sdk_dir "$HOME/Android/android-sdk" --ndk_dir "$HOME/.buildozer/android/platform/android-ndk-r21b" --android_api 28 --ndk-api 21

Spec file:

// REPLACE ME: Paste your buildozer.spec file here

Logs

[INFO]:    Building cffi for armeabi-v7a
[INFO]:    cffi apparently isn't already in site-packages
[INFO]:    Building compiled components in cffi
[INFO]:    -> directory context /home/allasca/.local/share/python-for-android/build/other_builds/cffi-python3/armeabi-v7a__ndk_target_21/cffi
[INFO]:    -> running python3 setup.py clean --all
[INFO]:    -> running python3 setup.py build_ext -v                            
           working: error: command '/usr/bin/ccache' failed with exit status 1 Exception in thread background thread for pid 60072:
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/allasca/.local/lib/python3.8/site-packages/sh.py", line 1540, in wrap
    fn(*args, **kwargs)
  File "/home/allasca/.local/lib/python3.8/site-packages/sh.py", line 2459, in background_thread
    handle_exit_code(exit_code)
  File "/home/allasca/.local/lib/python3.8/site-packages/sh.py", line 2157, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/allasca/.local/lib/python3.8/site-packages/sh.py", line 815, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /home/allasca/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3/native-build/python3 setup.py build_ext -v

  STDOUT:
running build_ext
building '_cffi_backend' extension
creating build
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/c
/usr/bin/ccache /home/allasca/.buildozer/android/platform/android-ndk-r21b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -I/home/allasca/.local/share/python-for-android/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/include -I/home/allasca/.local/share/python-for-android/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include -DANDROID -D__ANDROID_API__=21 -I/home/allasca/.buildozer/android/platform/android-ndk-r21b/sysroot/usr/include/arm-linux-androideabi -I/home/allasca/.local/share/python-for-android/build/python-installs/unnamed_dist_1/include/python3.8 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/home/allasca/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3/Include -I/home/allasca/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3/native-build -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.8/c/_cffi_backend.o
c/_cffi_backend.c:4197:31: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        *p_printable_filename = PyText_AsUTF8(s);
                              ^ ~~~~~~~~~~~~~~~~
c/_cffi_backend.c:5911:9: warning: 'ffi_prep_closure' is deprecated [-Wdeprecated-declarations]
    if (ffi_prep_closure(closure, &cif_descr->cif,
        ^
/home/allasca/.local/share/python-for-android/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/include/ffi.h:339:18: note: 'ffi_prep_closure' has been explicitly marked deprecated here
  __attribute__((deprecated))
                 ^
In file included from c/_cffi_backend.c:7370:
In file included from c/cffi1_module.c:20:
c/call_python.c:20:30: error: incomplete definition of type 'struct _is'
    builtins = tstate->interp->builtins;
               ~~~~~~~~~~~~~~^
/home/allasca/.local/share/python-for-android/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include/pystate.h:20:8: note: forward declaration of 'struct _is'
struct _is;
       ^
In file included from c/_cffi_backend.c:7370:
In file included from c/cffi1_module.c:20:
c/call_python.c:160:39: error: incomplete definition of type 'struct _is'
    new1 = PyThreadState_GET()->interp->modules;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/home/allasca/.local/share/python-for-android/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include/pystate.h:20:8: note: forward declaration of 'struct _is'
struct _is;
       ^
In file included from c/_cffi_backend.c:7370:
In file included from c/cffi1_module.c:20:
c/call_python.c:249:63: error: incomplete definition of type 'struct _is'
        if (externpy->reserved1 != PyThreadState_GET()->interp->modules) {
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/home/allasca/.local/share/python-for-android/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include/pystate.h:20:8: note: forward declaration of 'struct _is'
struct _is;
       ^
2 warnings and 3 errors generated.
error: command '/usr/bin/ccache' failed with exit status 1


  STDERR:

Traceback (most recent call last):                                             
  File "/home/allasca/.local/bin/p4a", line 8, in <module>
    sys.exit(main())
  File "/home/allasca/.local/lib/python3.8/site-packages/pythonforandroid/entrypoints.py", line 18, in main
    ToolchainCL()
  File "/home/allasca/.local/lib/python3.8/site-packages/pythonforandroid/toolchain.py", line 671, in __init__
    getattr(self, args.subparser_name.replace('-', '_'))(args)
  File "/home/allasca/.local/lib/python3.8/site-packages/pythonforandroid/toolchain.py", line 155, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/home/allasca/.local/lib/python3.8/site-packages/pythonforandroid/toolchain.py", line 206, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx,
  File "/home/allasca/.local/lib/python3.8/site-packages/pythonforandroid/build.py", line 580, in build_recipes
    recipe.build_arch(arch)
  File "/home/allasca/.local/lib/python3.8/site-packages/pythonforandroid/recipe.py", line 1009, in build_arch
    self.build_compiled_components(arch)
  File "/home/allasca/.local/lib/python3.8/site-packages/pythonforandroid/recipe.py", line 1020, in build_compiled_components
    shprint(hostpython, 'setup.py', self.build_cmd, '-v',
  File "/home/allasca/.local/lib/python3.8/site-packages/pythonforandroid/logger.py", line 180, in shprint
    for line in output:
  File "/home/allasca/.local/lib/python3.8/site-packages/sh.py", line 863, in next
    self.wait()
  File "/home/allasca/.local/lib/python3.8/site-packages/sh.py", line 792, in wait
    self.handle_command_exit_code(exit_code)
  File "/home/allasca/.local/lib/python3.8/site-packages/sh.py", line 815, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /home/allasca/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3/native-build/python3 setup.py build_ext -v

  STDOUT:
running build_ext
building '_cffi_backend' extension
creating build
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/c
/usr/bin/ccache /home/allasca/.buildozer/android/platform/android-ndk-r21b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -I/home/allasca/.local/share/python-for-android/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/include -I/home/allasca/.local/share/python-for-android/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include -DANDROID -D__ANDROID_API__=21 -I/home/allasca/.buildozer/android/platform/android-ndk-r21b/sysroot/usr/include/arm-linux-androideabi -I/home/allasca/.local/share/python-for-android/build/python-installs/unnamed_dist_1/include/python3.8 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/home/allasca/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3/Include -I/home/allasca/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3/native-build -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.8/c/_cffi_backend.o
c/_cffi_backend.c:4197:31: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        *p_printable_filename = PyText_AsUTF8(s);
                              ^ ~~~~~~~~~~~~~~~~
c/_cffi_backend.c:5911:9: warning: 'ffi_prep_closure' is deprecated [-Wdeprecated-declarations]
    if (ffi_prep_closure(closure, &cif_descr->cif,
        ^
/home/allasca/.local/share/python-for-android/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/include/ffi.h:339:18: note: 'ffi_prep_closure' has been explicitly marked deprecated here
  __attribute__((deprecated))
                 ^
In file included from c/_cffi_backend.c:7370:
In file included from c/cffi1_module.c:20:
c/call_python.c:20:30: error: incomplete definition of type 'struct _is'
    builtins = tstate->interp->builtins;
               ~~~~~~~~~~~~~~^
/home/allasca/.local/share/python-for-android/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include/pystate.h:20:8: note: forward declaration of 'struct _is'
struct _is;
       ^
In file included from c/_cffi_backend.c:7370:
In file included from c/cffi1_module.c:20:
c/call_python.c:160:39: error: incomplete definition of type 'struct _is'
    new1 = PyThreadState_GET()->interp->modules;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/home/allasca/.local/share/python-for-android/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include/pystate.h:20:8: note: forward declaration of 'struct _is'
struct _is;
       ^
In file included from c/_cffi_backend.c:7370:
In file included from c/cffi1_module.c:20:
c/call_python.c:249:63: error: incomplete definition of type 'struct _is'
        if (externpy->reserved1 != PyThreadState_GET()->interp->modules) {
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/home/allasca/.local/share/python-for-android/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include/pystate.h:20:8: note: forward declaration of 'struct _is'
struct _is;
       ^
2 warnings and 3 errors generated.
error: command '/usr/bin/ccache' failed with exit status 1


  STDERR:

allasca@ubuntu:~$ 

@allasca
Copy link
Author

allasca commented Apr 29, 2020

fix.
adding:
requirements=cffi==1.13.2,etc,etc

@allasca allasca closed this as completed Apr 29, 2020
@4ndrii
Copy link

4ndrii commented Jul 20, 2023

sudo apt-get install autoconf
sudo apt-get install libtool

mungkin ini dapat memecahkan masalah anda

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

2 participants