buildozer icon indicating copy to clipboard operation
buildozer copied to clipboard

local_recipes is not passed to `p4a` command

Open dlech opened this issue 2 years ago • 2 comments

Versions

  • Python: 3.8
  • OS: Ubuntu 20.04
  • Buildozer: 1.2.0

Description

I'm trying to clean a local recipe to rebuild it without rebuilding everything else. I would expect the following command to work:

buildozer.spec

Command:

buildozer android p4a -- clean-recipe-build bleak

Spec file:

...
# (str) The directory in which python-for-android should look for your own build recipes (if any)
#p4a.local_recipes = recipes
p4a.local_recipes = ../../bleak/backends/p4android/recipes
...

Logs

...
ValueError: Recipe does not exist: bleak
# Command failed: /home/david/work/pybricks/bleak/.venv/bin/python -m pythonforandroid.toolchain clean-recipe-build bleak --color=always --storage-dir="/home/david/work/pybricks/bleak/examples/kivy/.buildozer/android/platform/build-armeabi-v7a" --ndk-api=21
...

dlech avatar Oct 09 '21 19:10 dlech

To make it work, I have to run:

buildozer android p4a -- clean-recipe-build bleak --local-recipes=../../../../../../bleak/backends/p4android/recipes

It is inconvenient to have to add the extra argument and to remember to add ../../../../ to the path given in the spec file. It would be much nicer if the argument from the spec file was passed to this p4a command like it is to other commands.

dlech avatar Oct 09 '21 19:10 dlech

So much, "Ugh!" Ironically, I just hit this exact same issue while also attempting (but failing) to force Buildozer to acknowledge the exact same Bleak recipe. Incidentally, let's note that @dlech is the active maintainer for Bleak. Mad props, @dlech.

I can also confirm that this...

It would be much nicer if the argument from the spec file was passed to this p4a command like it is to other commands.

...doesn't actually appear to be the case. The buildozer android p4a command always unconditionally ignores the p4a.local_recipes setting in the top-level buildozer.spec file. This applies to not merely the clean-recipe-build subcommand but to all the other subcommands as well (e.g., buildozer android p4a -- recipes).

This is probably thanks to the extreme caching performed by both Buildozer and p4a. The buildozer android p4a command probably reuses a previously synthesized dist, build, or bootstrap rather than re-reading the top-level buildozer.spec file. Since internal and external documentation is scant on the subject, we're just left with bad assumptions. :face_exhaling:

leycec avatar Apr 27 '22 04:04 leycec