Conversation
Fixes an NDK/libc++ build failure (missing <unordered_map> include) present in v2.3.0's meson build. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The cryptography-cffi Rust crate's build.rs needs the *target* Python's include dir to compile the cffi-generated _openssl.c, and needs a working C compiler for its target. Two fixes to RustCompiledComponentsRecipe make this work generally, not just for cryptography: - get_recipe_env() now also sets a per-target CC_/AR_ pair (in addition to the existing CARGO_TARGET_*_LINKER): crates using the `cc` crate in their build.rs fall back to guessing --target= from the Rust triple without it, which for some targets (e.g. armv7-linux-androideabi) produces an invalid triple, picking up the wrong <limits.h> and breaking CPython's LONG_BIT sanity check in pyport.h. - MesonRecipe.ensure_args() no longer mutates the inherited class-level extra_build_args list in place, which would otherwise bleed one recipe's meson cross-file args into unrelated PyProjectRecipe subclasses sharing the same class attribute. cryptography's own recipe gets a small patch (via a new P4A_PYTHON_INCLUDE_DIR env var read from build.rs) to prefer the target's include dir over introspecting the host Python for it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…layouts The glob only matched one of the two directory layouts different NDK versions use, raising a bare IndexError when it found nothing instead of a clear BuildInterruptingException. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
vosk imports srt unconditionally (not just from its optional CLI
tool), and srt has no wheel on PyPI -- without a recipe of its own it
was silently dropped, and the app crashed at runtime with
ModuleNotFoundError. Same story for wikipedia, a plain build blocker
(pip install has nothing to build it with, no wheel on PyPI either).
vosk also needed:
- open_dll() patched to recognize sys.platform == "android" (only
"linux" and a few others were recognized, so vosk's own bundled
native library loader didn't find itself on Android)
- --upgrade --force-reinstall on its own pip install step, since a
`pip install .` with a stale but present install can otherwise no-op
("Requirement already satisfied") instead of picking up a rebuild.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
New recipes: bitstring, libonnxruntime, lifxlan, MarkupSafe, materialshapes, meteofrance-api, mpmath, murmurhash, onnxruntime, preshed, pydantic, pywizlight, sherpa-ncnn, sherpa-onnx, simplemma, spacy, srsly, sympy, thinc, tibs, kivymd, blis, cymem, jsonschema. Updates: freetype-py (fall back to distutils when needed), liblzma, pycairo (meson patch), regex -- version/patch bumps picked up while building an app against this set of recipes. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Member
|
Please consider porting all recipes to |
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.
A batch of recipe additions/fixes accumulated while building a Kivy/KivyMD Android app against a fairly large, varied dependency set. Split into logical commits; happy to split into separate PRs if preferred.
numpy: bump v2.3.0 -> v2.3.5Fixes an NDK/libc++ build failure (missing
<unordered_map>include) present in v2.3.0's meson build.cryptography: fix cross-compilingcryptography-cffi'sbuild.rsThe
cryptography-cffiRust crate'sbuild.rsneeds the target Python's include dir to compile the cffi-generated_openssl.c, and needs a working C compiler for its target. Two fixes toRustCompiledComponentsRecipemake this work generally, not just forcryptography:get_recipe_env()now also sets a per-targetCC_/AR_pair (in addition to the existingCARGO_TARGET_*_LINKER): crates using thecccrate in theirbuild.rsfall back to guessing--target=from the Rust triple without it, which for some targets (e.g.armv7-linux-androideabi) produces an invalid triple, picking up the wrong<limits.h>and breaking CPython'sLONG_BITsanity check inpyport.h.MesonRecipe.ensure_args()no longer mutates the inherited class-levelextra_build_argslist in place, which would otherwise bleed one recipe's meson cross-file args into unrelatedPyProjectRecipesubclasses sharing the same class attribute.cryptography's own recipe gets a small patch (via a newP4A_PYTHON_INCLUDE_DIRenv var read frombuild.rs) to prefer the target's include dir over introspecting the host Python for it.libthorvg: fixlibomp.soglob for bothlib/clangandlib64/clangNDK layoutsThe glob only matched one of the two directory layouts different NDK versions use, raising a bare
IndexErrorwhen it found nothing instead of a clearBuildInterruptingException.vosk: fix Android runtime crash; addsrt,wikipediarecipesvoskimportssrtunconditionally (not just from its optional CLI tool), andsrthas no wheel on PyPI -- without a recipe of its own it was silently dropped, and the app crashed at runtime withModuleNotFoundError. Same story forwikipedia, a plain build blocker (pip install has nothing to build it with, no wheel on PyPI either).voskalso needed:open_dll()patched to recognizesys.platform == "android"(only"linux"and a few others were recognized, so vosk's own bundled native library loader didn't find itself on Android)--upgrade --force-reinstallon its own pip install step, since apip install .with a stale but present install can otherwise no-op ("Requirement already satisfied") instead of picking up a rebuild.recipes: add/update several generic recipesNew recipes:
bitstring,libonnxruntime,lifxlan,MarkupSafe,materialshapes,meteofrance-api,mpmath,murmurhash,onnxruntime,preshed,pydantic,pywizlight,sherpa-ncnn,sherpa-onnx,simplemma,spacy,srsly,sympy,thinc,tibs,kivymd,blis,cymem,jsonschema.Updates:
freetype-py(fall back to distutils when needed),liblzma,pycairo(meson patch),regex-- version/patch bumps picked up while building against this set of recipes.Testing
Every recipe here has been exercised by a real, full clean Android build (arm64-v8a + armeabi-v7a) of a Kivy/KivyMD app with a fairly large dependency set (the app also uses
sherpa-onnx,vosk,cryptography,numpy,kivymd, and several of the newly-added recipes directly) --BUILD SUCCESSFUL, APK installs and runs correctly on-device.🤖 Generated with Claude Code