recipe.py: fix sync-upstream merge regression in PythonRecipe install - #7
Merged
Merged
Conversation
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>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
The sync-upstream merge (
55feaec4) had a 257-line conflict onpythonforandroid/recipe.pythat 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()andinstall_hostpython_prerequisites()were installing viasetup.py installinstead of upstream'spip install .hostpython_prerequisitesdefaulted to[]instead of['setuptools']HTTP_PROXY/HTTPS_PROXYpassthrough inget_recipe_env()was dropped entirelyThis restores upstream's code for all of the above verbatim, keeping this fork's two genuine additions on top:
RustCompiledComponentsRecipe's per-targetCC_/AR_env vars (needed forcryptography-cffi's build.rs)MesonRecipe.ensure_args()'s guard against mutating the inherited class-levelextra_build_argslistAlso:
--no-depson bothpip install .callsWithout it, pip resolves this package's own declared PyPI dependencies too, even when one of them already has its own Android recipe (e.g.
kivymddeclaringpycairo, 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 workingmesonhost toolchain that isn't set up for this kind of incidental, non-recipe host build.Verification
Full clean rebuild of AVA (exercises
PythonRecipe/CythonRecipe/CompiledComponentsPythonRecipeviawikipedia,srt,kivymd,cymem,blis,murmurhash,preshed,srsly,thinc,spacy,MarkupSafe, ...) —BUILD SUCCESSFUL, APK produced.🤖 Generated with Claude Code