Skip to content

recipe.py: fix sync-upstream merge regression in PythonRecipe install - #7

Merged
Krozark merged 1 commit into
developfrom
fix/recipe-py-sync-regression
Sep 28, 2026
Merged

Krozark merged 1 commit into
developfrom
fix/recipe-py-sync-regression

Conversation

@Krozark

@Krozark Krozark commented Sep 28, 2026

Copy link
Copy Markdown
Owner

What

The sync-upstream merge (55feaec4) had a 257-line conflict on pythonforandroid/recipe.py that got resolved by keeping this fork's old pre-sync code instead of adopting upstream's current version:

  • PythonRecipe.install_python_package(), install_hostpython_package() and install_hostpython_prerequisites() were installing via setup.py install instead of upstream's pip install .
  • hostpython_prerequisites defaulted to [] instead of ['setuptools']
  • The HTTP_PROXY/HTTPS_PROXY passthrough in get_recipe_env() was dropped entirely

This restores upstream's code for all of the above verbatim, keeping this fork's two genuine additions on top:

  • RustCompiledComponentsRecipe's per-target CC_/AR_ env vars (needed for cryptography-cffi's build.rs)
  • MesonRecipe.ensure_args()'s guard against mutating the inherited class-level extra_build_args list

Also: --no-deps on both pip install . calls

Without it, pip resolves this package's own declared PyPI dependencies too, even when one of them already has its own Android recipe (e.g. kivymd declaring pycairo, which p4a builds itself) — redundant with p4a's own dependency graph (depends/python_depends) at best, and a real build failure at worst when PyPI has no prebuilt wheel for it. Found this rebuilding AVA with the plain upstream restore: pycairo's sdist needs a working meson host toolchain that isn't set up for this kind of incidental, non-recipe host build.

Verification

Full clean rebuild of AVA (exercises PythonRecipe/CythonRecipe/CompiledComponentsPythonRecipe via wikipedia, srt, kivymd, cymem, blis, murmurhash, preshed, srsly, thinc, spacy, MarkupSafe, ...) — BUILD SUCCESSFUL, APK produced.

🤖 Generated with Claude Code

The sync-upstream merge (55feaec) had a 257-line conflict on this
file that got resolved by keeping this fork's old pre-sync code
instead of adopting upstream's: PythonRecipe.install_python_package(),
install_hostpython_package() and install_hostpython_prerequisites()
were installing via `setup.py install` instead of upstream's `pip
install .`, hostpython_prerequisites defaulted to [] instead of
['setuptools'], and the HTTP_PROXY/HTTPS_PROXY passthrough in
get_recipe_env() was dropped entirely.

Restored upstream's code for all of the above verbatim, keeping this
fork's two genuine additions on top: RustCompiledComponentsRecipe's
per-target CC_/AR_ env vars, and MesonRecipe.ensure_args()'s guard
against mutating the inherited class-level extra_build_args list.

Also add --no-deps to both `pip install .` calls: without it, pip
resolves *this package's own* declared PyPI dependencies too, even
when one of them already has its own Android recipe (e.g. kivymd
declaring pycairo, which p4a builds itself) -- redundant with p4a's
own dependency graph (depends/python_depends) at best, and a real
build failure at worst when PyPI has no prebuilt wheel for it (as
found rebuilding AVA with this fix: pycairo's sdist needs a working
meson host toolchain that isn't set up for this kind of incidental,
non-recipe host build).

Verified with a full clean rebuild of AVA (many recipes exercise
PythonRecipe/CythonRecipe/CompiledComponentsPythonRecipe: wikipedia,
srt, kivymd, cymem, blis, murmurhash, preshed, srsly, thinc, spacy,
MarkupSafe...) -- BUILD SUCCESSFUL, APK produced.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Krozark
Krozark merged commit 99807e7 into develop Sep 28, 2026
20 of 22 checks passed
@Krozark
Krozark deleted the fix/recipe-py-sync-regression branch September 28, 2026 14:18
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

Successfully merging this pull request may close these issues.

1 participant