b3b / able

Python for Android Bluetooth Low Energy package
MIT License
38 stars 18 forks source link

Error while building able_recipe wheel in buildozer #38

Open sodef opened 1 year ago

sodef commented 1 year ago

Hello, I would like to ask about the possible causes of the problem with build able_recipe in buildozer. I have done this several times so far without any problems, hence my question and request for help in locating the error, as even after reinstalling the virtual machine the problem persists. I added android and able_recipe to the requirements in buildozer.spec. Below you will find the log:

IF THIS FAILS, THE MODULES MAY NEED A RECIPE. A reason for this is often modules compiling native code that is unaware of Android cross-compilation and does not work without additional changes / workarounds.
[DEBUG]:   -> running bash -c venv/bin/pip install -v --target '/home/kupa/app/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/myapp/armeabi-v7a' --no-deps -r requirements.txt
[DEBUG]:    Ignoring "sys._home = value" override
[DEBUG]:    Using pip 23.1 from /home/kupa/app/.buildozer/android/platform/build-armeabi-v7a/build/venv/lib/python3.9/site-packages/pip (python 3.9)
[DEBUG]:    Collecting able_recipe (from -r requirements.txt (line 1))
[DEBUG]:      Using cached able_recipe-1.0.12.tar.gz (20 kB)
[DEBUG]:      Running command pip subprocess to install build dependencies
[DEBUG]:      Ignoring "sys._home = value" override
[DEBUG]:      Collecting setuptools>=40.8.0
[DEBUG]:        Using cached setuptools-67.6.1-py3-none-any.whl (1.1 MB)
[DEBUG]:      Collecting wheel
[DEBUG]:        Using cached wheel-0.40.0-py3-none-any.whl (64 kB)
[DEBUG]:      Installing collected packages: wheel, setuptools
[DEBUG]:      Successfully installed setuptools-67.6.1 wheel-0.40.0
[DEBUG]:      Installing build dependencies ... done
[DEBUG]:      Running command Getting requirements to build wheel
[DEBUG]:      Ignoring "sys._home = value" override
[DEBUG]:      /tmp/pip-build-env-az1vhz3f/overlay/lib/python3.9/site-packages/setuptools/__init__.py:259: SetuptoolsDeprecationWarning: The function `convert_path` is considered internal and not part of the public API.
[DEBUG]:      Its direct usage by 3rd-party packages is considered deprecated and the function
[DEBUG]:      may be removed in the future.
[DEBUG]:        warnings.warn(cleandoc(msg), SetuptoolsDeprecationWarning)
[DEBUG]:      running egg_info
[DEBUG]:      writing able_recipe.egg-info/PKG-INFO
[DEBUG]:      writing dependency_links to able_recipe.egg-info/dependency_links.txt
[DEBUG]:      writing top-level names to able_recipe.egg-info/top_level.txt
[DEBUG]:      reading manifest file 'able_recipe.egg-info/SOURCES.txt'
[DEBUG]:      reading manifest template 'MANIFEST.in'
[DEBUG]:      adding license file 'LICENSE'
[DEBUG]:      writing manifest file 'able_recipe.egg-info/SOURCES.txt'
[DEBUG]:      Getting requirements to build wheel ... done
[DEBUG]:      Running command Preparing metadata (pyproject.toml)
[DEBUG]:      Ignoring "sys._home = value" override
[DEBUG]:      /tmp/pip-build-env-az1vhz3f/overlay/lib/python3.9/site-packages/setuptools/__init__.py:259: SetuptoolsDeprecationWarning: The function `convert_path` is considered internal and not part of the public API.
[DEBUG]:      Its direct usage by 3rd-party packages is considered deprecated and the function
[DEBUG]:      may be removed in the future.
[DEBUG]:        warnings.warn(cleandoc(msg), SetuptoolsDeprecationWarning)
[DEBUG]:      running dist_info
[DEBUG]:      creating /tmp/pip-modern-metadata-rueqyx09/able_recipe.egg-info
[DEBUG]:      writing /tmp/pip-modern-metadata-rueqyx09/able_recipe.egg-info/PKG-INFO
[DEBUG]:      writing dependency_links to /tmp/pip-modern-metadata-rueqyx09/able_recipe.egg-info/dependency_links.txt
[DEBUG]:      writing top-level names to /tmp/pip-modern-metadata-rueqyx09/able_recipe.egg-info/top_level.txt
[DEBUG]:      writing manifest file '/tmp/pip-modern-metadata-rueqyx09/able_recipe.egg-info/SOURCES.txt'
[DEBUG]:      reading manifest file '/tmp/pip-modern-metadata-rueqyx09/able_recipe.egg-info/SOURCES.txt'
[DEBUG]:      reading manifest template 'MANIFEST.in'
[DEBUG]:      adding license file 'LICENSE'
[DEBUG]:      writing manifest file '/tmp/pip-modern-metadata-rueqyx09/able_recipe.egg-info/SOURCES.txt'
[DEBUG]:      creating '/tmp/pip-modern-metadata-rueqyx09/able_recipe-1.0.12.dist-info'
[DEBUG]:      Preparing metadata (pyproject.toml) ... done
[DEBUG]:    Collecting certifi (from -r requirements.txt (line 2))
[DEBUG]:      Using cached certifi-2022.12.7-py3-none-any.whl (155 kB)
[DEBUG]:    Building wheels for collected packages: able_recipe
[DEBUG]:      Running command Building wheel for able_recipe (pyproject.toml)
[DEBUG]:      Ignoring "sys._home = value" override
[DEBUG]:      /tmp/pip-build-env-az1vhz3f/overlay/lib/python3.9/site-packages/setuptools/__init__.py:259: SetuptoolsDeprecationWarning: The function `convert_path` is considered internal and not part of the public API.
[DEBUG]:      Its direct usage by 3rd-party packages is considered deprecated and the function
[DEBUG]:      may be removed in the future.
[DEBUG]:        warnings.warn(cleandoc(msg), SetuptoolsDeprecationWarning)
[DEBUG]:      running bdist_wheel
[DEBUG]:      running build
[DEBUG]:      running build_py
[DEBUG]:      creating build
[DEBUG]:      creating build/lib
[DEBUG]:      creating build/lib/able
[DEBUG]:      copying able/adapter.py -> build/lib/able
[DEBUG]:      copying able/queue.py -> build/lib/able
[DEBUG]:      copying able/advertising.py -> build/lib/able
[DEBUG]:      copying able/version.py -> build/lib/able
[DEBUG]:      copying able/structures.py -> build/lib/able
[DEBUG]:      copying able/scan_settings.py -> build/lib/able
[DEBUG]:      copying able/__init__.py -> build/lib/able
[DEBUG]:      copying able/permissions.py -> build/lib/able
[DEBUG]:      copying able/filters.py -> build/lib/able
[DEBUG]:      copying able/utils.py -> build/lib/able
[DEBUG]:      copying able/dispatcher.py -> build/lib/able
[DEBUG]:      creating build/lib/able/android
[DEBUG]:      copying able/android/__init__.py -> build/lib/able/android
[DEBUG]:      copying able/android/jni.py -> build/lib/able/android
[DEBUG]:      copying able/android/dispatcher.py -> build/lib/able/android
[DEBUG]:      installing to build/bdist.linux-x86_64/wheel
[DEBUG]:      running install
[DEBUG]:      Traceback (most recent call last):
[DEBUG]:        File "/home/kupa/app/.buildozer/android/platform/build-armeabi-v7a/build/venv/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
[DEBUG]:          main()
[DEBUG]:        File "/home/kupa/app/.buildozer/android/platform/build-armeabi-v7a/build/venv/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
[DEBUG]:          json_out['return_val'] = hook(**hook_input['kwargs'])
[DEBUG]:        File "/home/kupa/app/.buildozer/android/platform/build-armeabi-v7a/build/venv/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
[DEBUG]:          return _build_backend().build_wheel(wheel_directory, config_settings,
[DEBUG]:        File "/tmp/pip-build-env-az1vhz3f/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 413, in build_wheel
[DEBUG]:          return self._build_with_temp_dir(['bdist_wheel'], '.whl',
[DEBUG]:        File "/tmp/pip-build-env-az1vhz3f/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 398, in _build_with_temp_dir
[DEBUG]:          self.run_setup()
[DEBUG]:        File "/tmp/pip-build-env-az1vhz3f/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 484, in run_setup
[DEBUG]:          super(_BuildMetaLegacyBackend,
[DEBUG]:        File "/tmp/pip-build-env-az1vhz3f/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 335, in run_setup
[DEBUG]:          exec(code, locals())
[DEBUG]:        File "<string>", line 90, in <module>
[DEBUG]:        File "/tmp/pip-build-env-az1vhz3f/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 108, in setup
[DEBUG]:          return distutils.core.setup(**attrs)
[DEBUG]:        File "/tmp/pip-build-env-az1vhz3f/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
[DEBUG]:          return run_commands(dist)
[DEBUG]:        File "/tmp/pip-build-env-az1vhz3f/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
[DEBUG]:          dist.run_commands()
[DEBUG]:        File "/tmp/pip-build-env-az1vhz3f/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
[DEBUG]:          self.run_command(cmd)
[DEBUG]:        File "/tmp/pip-build-env-az1vhz3f/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1221, in run_command
[DEBUG]:          super().run_command(command)
[DEBUG]:        File "/tmp/pip-build-env-az1vhz3f/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
[DEBUG]:          cmd_obj.run()
[DEBUG]:        File "/tmp/pip-build-env-az1vhz3f/overlay/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 378, in run
[DEBUG]:          self.run_command("install")
[DEBUG]:        File "/tmp/pip-build-env-az1vhz3f/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
[DEBUG]:          self.distribution.run_command(command)
[DEBUG]:        File "/tmp/pip-build-env-az1vhz3f/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1221, in run_command
[DEBUG]:          super().run_command(command)
[DEBUG]:        File "/tmp/pip-build-env-az1vhz3f/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
[DEBUG]:          cmd_obj.run()
[DEBUG]:        File "<string>", line 76, in run
[DEBUG]:        File "<string>", line 20, in javaclass_dir
[DEBUG]:        File "<string>", line 44, in build_dir
[DEBUG]:        File "<string>", line 51, in python_installs_dir
[DEBUG]:      Exception: Python installs directory is not found. Please report issue to: https://github.com/b3b/able/issues
[DEBUG]:      error: subprocess-exited-with-error
[DEBUG]:    
[DEBUG]:      × Building wheel for able_recipe (pyproject.toml) did not run successfully.
[DEBUG]:      │ exit code: 1
[DEBUG]:      ╰─> See above for output.
[DEBUG]:    
[DEBUG]:      note: This error originates from a subprocess, and is likely not a problem with pip.
[DEBUG]:      full command: /home/kupa/app/.buildozer/android/platform/build-armeabi-v7a/build/venv/bin/python /home/kupa/app/.buildozer/android/platform/build-armeabi-v7a/build/venv/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /tmp/tmp3iqynll2
[DEBUG]:      cwd: /tmp/pip-install-ujgrc__d/able-recipe_1dac39e59d4d4a2588765a8ed7ece7cc
[DEBUG]:      Building wheel for able_recipe (pyproject.toml) ... error
[DEBUG]:      ERROR: Failed building wheel for able_recipe
[DEBUG]:    Failed to build able_recipe
[DEBUG]:    ERROR: Could not build wheels for able_recipe, which is required to install pyproject.toml-based projects
sodef commented 1 year ago

A small update, the problem with building the application was due to the latest update of the pip module. After reverting to the previous version, the application was successfully built.

Rowataro commented 1 year ago

How did you revert to a previous version?

b3b commented 1 year ago

Hello @sodef, @Rowataro, Thank you for bringing this issue, and for providing an explanation and logs.

It appears that the issue is occurring when pip isolated environment is enabled, the directory to install JAVA files is being searched incorrectly in this case.

Rowataro commented 1 year ago

What is the fix for this issue?

b3b commented 1 year ago

@Rowataro , I am currently testing the fix and will upload the new version soon.

b3b commented 1 year ago

Fixed in 1.0.13 .