Error in buildozer from deprecated distutils

94 views
Skip to first unread message

Hammed Agboluaje

unread,
May 24, 2023, 10:07:38 AM5/24/23
to Kivy users support
getting an error on the deprecated distutils when compiling for android, but its just warnings and I don't know why my bulldozer update and clean commands are failing. I know I have to use setuptools instead of distutils somewhere, but i don't know where.

The spec file is attached, and this below is the error bit of the log:

[INFO]:    Building compiled components in cffi
[INFO]:    -> directory context /Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/cffi/arm64-v8a__ndk_target_21/cffi
[DEBUG]:   -> running python3 setup.py clean --all
[DEBUG]:        /Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/cffi/arm64-v8a__ndk_target_21/cffi/setup.py:67: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
[DEBUG]:          from distutils.core import Distribution
[DEBUG]:        /Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/cffi/arm64-v8a__ndk_target_21/cffi/setup.py:68: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
[DEBUG]:          from distutils.sysconfig import get_config_vars
[DEBUG]:        running clean
[DEBUG]:        removing 'build/temp.macosx-13.3-x86_64-3.10' (and everything under it)
[DEBUG]:        'build/lib.macosx-13.3-x86_64-3.10' does not exist -- can't clean it
[DEBUG]:        'build/bdist.macosx-13.3-x86_64' does not exist -- can't clean it
[DEBUG]:        'build/scripts-3.10' does not exist -- can't clean it
[DEBUG]:        removing 'build'
[DEBUG]:   -> running python3 setup.py build_ext -v
[DEBUG]:        /Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/cffi/arm64-v8a__ndk_target_21/cffi/setup.py:67: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
[DEBUG]:          from distutils.core import Distribution
[DEBUG]:        /Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/cffi/arm64-v8a__ndk_target_21/cffi/setup.py:68: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
[DEBUG]:          from distutils.sysconfig import get_config_vars
[DEBUG]:        running build_ext
[DEBUG]:        building '_cffi_backend' extension
[DEBUG]:        creating build
[DEBUG]:        creating build/temp.macosx-13.3-x86_64-3.10
[DEBUG]:        creating build/temp.macosx-13.3-x86_64-3.10/c
[DEBUG]:        /Users/hamheadon/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -I/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/libffi/arm64-v8a__ndk_target_21/libffi/include -I/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include -DANDROID -I/Users/hamheadon/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include -I/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/python-installs/hndpack/arm64-v8a/include/python3.1 -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi -I/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/hostpython3/desktop/hostpython3/Include -I/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/hostpython3/desktop/hostpython3/native-build -c c/_cffi_backend.c -o build/temp.macosx-13.3-x86_64-3.10/c/_cffi_backend.o
[DEBUG]:        c/_cffi_backend.c:407:23: error: expression is not assignable
[DEBUG]:                Py_REFCNT(ct) = 43;
[DEBUG]:                ~~~~~~~~~~~~~ ^
[DEBUG]:        c/_cffi_backend.c:410:23: error: expression is not assignable
[DEBUG]:                Py_REFCNT(ct) = 0;
[DEBUG]:                ~~~~~~~~~~~~~ ^
[DEBUG]:        c/_cffi_backend.c:6136:5: warning: 'PyEval_InitThreads' is deprecated [-Wdeprecated-declarations]
[DEBUG]:            PyEval_InitThreads();
[DEBUG]:            ^
[DEBUG]:        /Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include/ceval.h:122:1: note: 'PyEval_InitThreads' has been explicitly marked deprecated here
[DEBUG]:        Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
[DEBUG]:        ^
[DEBUG]:        /Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
[DEBUG]:        #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
[DEBUG]:                                                             ^
[DEBUG]:        c/_cffi_backend.c:6196:9: warning: 'ffi_prep_closure' is deprecated [-Wdeprecated-declarations]
[DEBUG]:            if (ffi_prep_closure(closure, &cif_descr->cif,
[DEBUG]:                ^
[DEBUG]:        /Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/libffi/arm64-v8a__ndk_target_21/libffi/include/ffi.h:354:18: note: 'ffi_prep_closure' has been explicitly marked deprecated here
[DEBUG]:          __attribute__((deprecated))
[DEBUG]:                         ^
[DEBUG]:        2 warnings and 2 errors generated.
[DEBUG]:        error: command '/Users/hamheadon/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang' failed with exit code 1
Exception in thread background thread for pid 10515:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/sh.py", line 1641, in wrap
    fn(*rgs, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/sh.py", line 2569, in background_thread
    handle_exit_code(exit_code)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/sh.py", line 2269, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/sh.py", line 869, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1:

  RAN: /Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/hostpython3/desktop/hostpython3/native-build/python3 setup.py build_ext -v

  STDOUT:
/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/cffi/arm64-v8a__ndk_target_21/cffi/setup.py:67: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  from distutils.core import Distribution
/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/cffi/arm64-v8a__ndk_target_21/cffi/setup.py:68: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
  from distutils.sysconfig import get_config_vars
running build_ext
building '_cffi_backend' extension
creating build
creating build/temp.macosx-13.3-x86_64-3.10
creating build/temp.macosx-13.3-x86_64-3.10/c
/Users/hamheadon/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -I/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/libffi/arm64-v8a__ndk_target_21/libffi/include -I/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include -DANDROID -I/Users/hamheadon/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include -I/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/python-installs/hndpack/arm64-v8a/include/python3.1 -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi -I/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/hostpython3/desktop/hostpython3/Include -I/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/hostpython3/desktop/hostpython3/native-build -c c/_cffi_backend.c -o build/temp.macosx-13.3-x86_64-3.10/c/_cffi_backend.o
c/_cffi_backend.c:407:23: error: expression is not assignable
        Py_REFCNT(ct) = 43;
        ~~~~~~~~~~~~~ ^
c/_cffi_backend.c:410:23: error: expression is not assignable
        Py_REFCNT(ct) = 0;
        ~~~~~~~~~~~~~ ^
c/_cffi_backend.c:6136:5: warning: 'PyEval_InitThreads' is deprecated [-Wdeprecated-declarations]
    PyEval_InitThreads();
    ^
/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include/ceval.h:122:1: note: 'PyEval_InitThreads' has been explicitly marked deprecated here
Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
^
/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                     ^
c/_cffi_backend.c:6196:9: warning: 'ffi_prep_closure' is deprecated [-Wdeprecated-declarations]
    if (ffi_prep_closure(closure, &cif_descr->cif,
        ^
/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/libffi/arm64-v8a__ndk_target_21/libffi/include/ffi.h:354:18: note: 'ffi_prep_closure' has been explicitly marked deprecated here
  __attribute__((deprecated))
                 ^
2 warnings and 2 errors generated.
error: command '/Users/hamheadon/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang' failed with exit code 1


  STDERR:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1312, in <module>
    main()
  File "/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/python-for-android/pythonforandroid/entrypoints.py", line 18, in main
    ToolchainCL()
  File "/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 734, in __init__
    getattr(self, command)(args)
  File "/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 153, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 212, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx,
  File "/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/python-for-android/pythonforandroid/build.py", line 504, in build_recipes
    recipe.build_arch(arch)
  File "/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 983, in build_arch
    self.build_compiled_components(arch)
  File "/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 994, in build_compiled_components
    shprint(hostpython, 'setup.py', self.build_cmd, '-v',
  File "/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/python-for-android/pythonforandroid/logger.py", line 167, in shprint
    for line in output:
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/sh.py", line 915, in next
    self.wait()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/sh.py", line 845, in wait
    self.handle_command_exit_code(exit_code)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/sh.py", line 869, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1:

  RAN: /Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/hostpython3/desktop/hostpython3/native-build/python3 setup.py build_ext -v

  STDOUT:
/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/cffi/arm64-v8a__ndk_target_21/cffi/setup.py:67: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  from distutils.core import Distribution
/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/cffi/arm64-v8a__ndk_target_21/cffi/setup.py:68: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
  from distutils.sysconfig import get_config_vars
running build_ext
building '_cffi_backend' extension
creating build
creating build/temp.macosx-13.3-x86_64-3.10
creating build/temp.macosx-13.3-x86_64-3.10/c
/Users/hamheadon/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -I/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/libffi/arm64-v8a__ndk_target_21/libffi/include -I/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include -DANDROID -I/Users/hamheadon/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include -I/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/python-installs/hndpack/arm64-v8a/include/python3.1 -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi -I/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/hostpython3/desktop/hostpython3/Include -I/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/hostpython3/desktop/hostpython3/native-build -c c/_cffi_backend.c -o build/temp.macosx-13.3-x86_64-3.10/c/_cffi_backend.o
c/_cffi_backend.c:407:23: error: expression is not assignable
        Py_REFCNT(ct) = 43;
        ~~~~~~~~~~~~~ ^
c/_cffi_backend.c:410:23: error: expression is not assignable
        Py_REFCNT(ct) = 0;
        ~~~~~~~~~~~~~ ^
c/_cffi_backend.c:6136:5: warning: 'PyEval_InitThreads' is deprecated [-Wdeprecated-declarations]
    PyEval_InitThreads();
    ^
/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include/ceval.h:122:1: note: 'PyEval_InitThreads' has been explicitly marked deprecated here
Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
^
/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                     ^
c/_cffi_backend.c:6196:9: warning: 'ffi_prep_closure' is deprecated [-Wdeprecated-declarations]
    if (ffi_prep_closure(closure, &cif_descr->cif,
        ^
/Users/hamheadon/Desktop/PycharmProjects/third/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/other_builds/libffi/arm64-v8a__ndk_target_21/libffi/include/ffi.h:354:18: note: 'ffi_prep_closure' has been explicitly marked deprecated here
  __attribute__((deprecated))
                 ^
2 warnings and 2 errors generated.
error: command '/Users/hamheadon/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang' failed with exit code 1
buildozer.spec

Robert

unread,
May 24, 2023, 1:09:15 PM5/24/23
to Kivy users support
Reply all
Reply to author
Forward
0 new messages