install.sh: refuse Termux hosts and point at the APT package

check_platform accepted Termux as plain Linux, so `curl | bash` on a
phone walked the source-install ladder: a glibc uv, a lock whose CPython
is the bundled bionic build with no Android wheels, and on-device sdist
builds. The signed APT package is the only supported Termux shape, so
detect Termux the way the runtime does (TERMUX_VERSION or the com.termux
PREFIX) and stop before any stage with `pkg install hermes-agent` and
the setup docs URL. --json surfaces the reason in the stage frame.
This commit is contained in:
ethernet
2026-09-21 18:41:42 -04:00
parent 04bfa58d47
commit 5e8fbd4919
2 changed files with 35 additions and 0 deletions

View File

@@ -190,6 +190,12 @@ ensure_uv() {
}
check_platform() {
# Termux is Linux by uname, but this installer builds a glibc source
# install the phone cannot run (no Android wheels in the lock). The
# signed APT package is the only supported shape there.
if [ -n "${TERMUX_VERSION:-}" ] || case "${PREFIX:-}" in *com.termux/files/usr*) true ;; *) false ;; esac; then
fail "Termux is installed from its APT repository, not install.sh: pkg install hermes-agent (setup: https://hermes-agent.nousresearch.com/docs/getting-started/termux)"
fi
case "$(uname -s 2>/dev/null)" in
Linux*) : ;;
Darwin*) : ;;