You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
p4a apk failing for project with setup.py because arch string is being passed into a method that's expecting the arch object. Below is the build output
[INFO]: Populating venv's site-packages with ctx.get_site_packages_dir()...
INFO:p4a:[INFO]: Populating venv's site-packages with ctx.get_site_packages_dir()...
Traceback (most recent call last):
File "/home/pimmaneni/.local/bin/p4a", line 8, in
sys.exit(main())
File "/home/pimmaneni/.local/lib/python3.10/site-packages/pythonforandroid/entrypoints.py", line 18, in main
ToolchainCL()
File "/home/pimmaneni/.local/lib/python3.10/site-packages/pythonforandroid/toolchain.py", line 685, in init
getattr(self, command)(args)
File "/home/pimmaneni/.local/lib/python3.10/site-packages/pythonforandroid/toolchain.py", line 104, in wrapper_func
build_dist_from_args(ctx, dist, args)
File "/home/pimmaneni/.local/lib/python3.10/site-packages/pythonforandroid/toolchain.py", line 163, in build_dist_from_args
build_recipes(build_order, python_modules, ctx,
File "/home/pimmaneni/.local/lib/python3.10/site-packages/pythonforandroid/build.py", line 528, in build_recipes
run_pymodules_install(
File "/home/pimmaneni/.local/lib/python3.10/site-packages/pythonforandroid/build.py", line 767, in run_pymodules_install
run_setuppy_install(ctx, project_dir, env, arch.arch)
File "/home/pimmaneni/.local/lib/python3.10/site-packages/pythonforandroid/build.py", line 579, in run_setuppy_install
os.path.abspath(ctx.get_site_packages_dir(arch))
File "/home/pimmaneni/.local/lib/python3.10/site-packages/pythonforandroid/build.py", line 424, in get_site_packages_dir
return self.get_python_install_dir(arch.arch)
AttributeError: 'str' object has no attribute 'arch'
Thanks for the report and the fix.
We must have a bug somewhere else then because I think it should really be a Arch object and not the string.
We need to look this up higher in the stack, like why is the Context.archs list is being fed with strings rather than Arch objects at some points. Because in other scenarios I think it does receive the right Arch object, so I think the fix you're proposing currently would break something else.
We miss a lot of type hint across the project too that doesn't help with debugging/maintaining these types of issues
Edit:
My bad I think I'm getting confused, give me some time to go through some testing.
Could you also provide a minimal reproduction scenario to help debugging the issue?
Took a deeper look and yes you're definitely right with that change. Will run through few more tests and merge later.
Thanks for the heads up and the fix again. After merging I'll probably update some unit tests and add some type hints
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
p4a apk failing for project with setup.py because arch string is being passed into a method that's expecting the arch object. Below is the build output
INFO:p4a:[INFO]: android==1.0
Cython==3.0.8
pyjnius==1.6.1
six==1.15.0
[INFO]: Populating venv's site-packages with ctx.get_site_packages_dir()...
INFO:p4a:[INFO]: Populating venv's site-packages with ctx.get_site_packages_dir()...
Traceback (most recent call last):
File "/home/pimmaneni/.local/bin/p4a", line 8, in
sys.exit(main())
File "/home/pimmaneni/.local/lib/python3.10/site-packages/pythonforandroid/entrypoints.py", line 18, in main
ToolchainCL()
File "/home/pimmaneni/.local/lib/python3.10/site-packages/pythonforandroid/toolchain.py", line 685, in init
getattr(self, command)(args)
File "/home/pimmaneni/.local/lib/python3.10/site-packages/pythonforandroid/toolchain.py", line 104, in wrapper_func
build_dist_from_args(ctx, dist, args)
File "/home/pimmaneni/.local/lib/python3.10/site-packages/pythonforandroid/toolchain.py", line 163, in build_dist_from_args
build_recipes(build_order, python_modules, ctx,
File "/home/pimmaneni/.local/lib/python3.10/site-packages/pythonforandroid/build.py", line 528, in build_recipes
run_pymodules_install(
File "/home/pimmaneni/.local/lib/python3.10/site-packages/pythonforandroid/build.py", line 767, in run_pymodules_install
run_setuppy_install(ctx, project_dir, env, arch.arch)
File "/home/pimmaneni/.local/lib/python3.10/site-packages/pythonforandroid/build.py", line 579, in run_setuppy_install
os.path.abspath(ctx.get_site_packages_dir(arch))
File "/home/pimmaneni/.local/lib/python3.10/site-packages/pythonforandroid/build.py", line 424, in get_site_packages_dir
return self.get_python_install_dir(arch.arch)
AttributeError: 'str' object has no attribute 'arch'