feat: support lean Android/Termux bootstrap with optional native deps#496
Conversation
|
Android/Termux follow-up after testing in a bare proot-style Termux sandbox:
Validation performed on-device:
Note: full suite with no coverage got to 8016 passed before stopping on an unrelated existing |
|
Update / handoff note for Mike: I closed #494 as superseded by this PR so there is one clean upstream lane. The intended split is:
Reference implementation / companion overlay:
Why this matters: upstream only needs to merge the minimal installability/bootstrapping pieces. The Android-specific agent/orchestration machinery can remain a plugin overlay, proving the architecture without turning Code Puppy core into a phone-shaped dependency piñata. |
3d89696 to
b4afb8c
Compare
Move native-heavy optional capabilities out of the base install path, add an Android/Termux bootstrap planner and wizard, and document the verified lean install flow. Keep Playwright, PyPI ripgrep, Pillow, tiktoken, and regex detached from the base install so Android can install Code Puppy after the required Termux uv/rust/clang prerequisites are present.
b4afb8c to
7795b38
Compare
Summary
This PR makes Code Puppy installable on Android/Termux by keeping native-heavy optional capabilities out of the base dependency path and adding a lean bootstrap flow for phones.
Key changes:
browserextra and guard browser imports so the CLI still boots without it.ripgrepbundle behind the optionalsearchextra; Code Puppy already uses the systemrgbinary when available.Pillow,tiktoken,regex).code-puppy-bootstrapplanner/wizard commands for environment detection, profile planning, guarded install steps, and post-install verification.README.mdanddocs/ANDROID_INSTALL.md.[images,search]for the historical macOS test suite that exercises image/search behavior.Important search-support note:
Android / Termux install notes
The verified fresh-phone path is:
Important bootstrapping detail: install
uvfrom Termux (pkg install uv) instead ofpython -m pip install uv. On Android, PyPI can fall back to buildinguvfrom source. Also installrust clangbeforeuvx --from code-puppy ..., becauseuvxmust resolve Code Puppy's required Python deps (notablypydantic-core) before the wizard code can run.The wizard then handles remaining Android-native helper packages like
ripgrep/proot, installs Code Puppy, and verifiescode-puppy --help.For a source checkout / editable install on Android, keep the runtime lean and do not use plain
uv syncfor runtime validation:uv sync --no-dev --python "$(command -v python)"or from an activated lean venv:
uv pip install -e '.[images]'Plain
uv syncinstalls the dev group; on Android that can attempt to build dev tools likerufffrom Rust source and OOM. That is not the end-user runtime install path.Desktop/macOS CI can still install the full historical image/search test surface:
uv pip install -e '.[images,search]'Fresh-checkout Android proof
Strongest checkout test: fresh clone from upstream, then fetch the upstream PR ref
from
origin— no fork remote needed for the proof.Lean install from that fresh upstream+PR-ref checkout succeeded on Android/Termux
using the Termux system Python (
/data/data/com.termux/files/usr/bin/python3.13):Import/runtime/degradation checks from that fresh checkout:
Proof artifacts from this device:
outputs/pr496-upstream-pr-ref-20260622-103342.log— strongest proof: upstream clone, upstreampull/496/headref, Termux system Python, documenteduv sync --no-dev, optional-native absence, imports, browser/search graceful degradation, system-rg search, bootstrap, anduv run --no-devall passed.outputs/pr496-fresh-checkout-20260622-102330.log— plainuv syncdev-env attempt; failed buildingruff, confirminguv syncis not the Android runtime path.outputs/pr496-squashed-bare-termux-proof.log— earlier bare-Termux sandbox proof.Test plan
Local Android-safe checks run on this branch:
Result:
22 passed.CI workflow patch:
-e .first and verifies optional native modules are absent..[images,search]before the full historical macOS test suite, because existing tests cover Pillow/image and ripgrep/search behavior..[durable]first, then.[durable,images,search]for full/integration coverage.Commit hygiene
History has been squashed into one commit for review: