fix(termux): prebuild psutil compatibility shim in setup-hermes.sh - #72571
fix(termux): prebuild psutil compatibility shim in setup-hermes.sh#72571bradlishman wants to merge 1 commit into
Conversation
setup-hermes.sh (the manual dev quick-setup script) jumps straight to `pip install -e ".[termux]"` on Termux, so a fresh clone fails with "platform android is not supported" when pip tries to build psutil from its sdist -- the same failure reported in #31415. scripts/install.sh already works around this by prebuilding psutil via scripts/install_psutil_android.py before the main package install (see install.sh's Android psutil prebuild step). setup-hermes.sh never picked up the equivalent step, so `./setup-hermes.sh` silently leaves the venv without the actual hermes-agent package or its CLI entry point installed. Mirror install.sh's guard: detect sys.platform == "android" and run the psutil shim before the [termux] install, with the same warning message on failure. Fixes #31415
…tup-hermes.sh Merges the setup-hermes.sh fix from NousResearch/hermes-agent#72571 into local main and the bradlishman/hermes-agent fork's main, ahead of upstream maintainer review/merge (read-only access to origin).
|
Thanks for covering the separate Problems
Suggested changes
Automated hermes-sweeper review. |
GottZ
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Summary
Three PRs address or reference #31415 across distinct Termux installation paths: #22901 added the Android psutil shim to the supported installer and update flow, #44390 adds the missing shim and 32-bit Rust-target guidance to the manual documentation, and #72571 invokes the existing shim from the cloned-repository quick-setup script.
Related pull requests
- #22901 [merged]
partial— (+281/-32) — merged reference implementation: it introduced scripts/install_psutil_android.py and wired the psutil prebuild into fresh installs and updates, directly handling psutil's Android platform rejection; it remains relevant because the other PRs extend that established workaround to paths it did not cover. - #44390
best fix— (+120/-11) — keep open with a salvage path: the diff places the existing psutil shim before pip installation in both manual guides, adds the reported armv8l Rust-target workaround, and tests those ordering and architecture invariants. This matches the keep_open review on #44390 and addresses the documentation path rather than duplicating the installer implementation. - #72571
partial— (+14/-0) — keep open with a salvage path: the diff adds the established Android-only psutil prebuild before setup-hermes.sh's Termux pip command, covering a separate executable path from #44390. This matches the keep_open review on #72571, but the PR description should drop its unsupported claim that both failed installs leave the script exiting 0; the verified gap is the missing prebuild ordering.
Suggested consolidation
Keep #44390 open for the manual-guide and regression-test salvage path, and keep #72571 open for the separate setup-hermes.sh salvage path after correcting its exit-status rationale. #22901 is the merged reference implementation, not a duplicate to revisit; #44390 and #72571 should not be closed as duplicates because they modify non-overlapping user paths.
Complex graph
flowchart LR
classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
classDef best stroke-width:3px,stroke:#b45309
classDef target stroke-width:3px,stroke:#4338ca
I31415(["issue #31415 (open)"])
P72571["PR #72571 (open)"]
P72571 -.->|partial| I31415
class I31415 open
class P72571 open
class P72571 target
click I31415 "https://github.com/NousResearch/hermes-agent/issues/31415"
click P72571 "https://github.com/NousResearch/hermes-agent/pull/72571"
Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed (state tag in the node label).
Cross-PR triage: Reviewed 3 pull requests and 1 issue in this complex. Each diff was read against this issue; Assessment working set: 30 kB of PR diffs, 12 kB of issue/PR text, 18 kB of discussion (12 comments), 4 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.
What does this PR do?
Fixes
setup-hermes.sh(the manual dev quick-setup script) so it doesn't silently produce a broken install on Termux/Android.On Termux,
setup-hermes.shcurrently jumps straight from creating the venv topip install -e ".[termux]" -c constraints-termux.txt. Because upstreampsutil'ssetup.pyrejectssys.platform == "android"before the build even starts, that install fails onpsutilwithplatform android is not supported— the exact symptom in #31415. The script's own-e(set -e) doesn't catch this because the pip call is chained with||into a fallback that also fails, and the overall script still exits 0, leaving a venv containing onlypip/wheel/setuptoolsand no actualhermescommand.scripts/install.sh(the one-linecurl | bashinstaller) already works around this: it prebuildspsutilvia the repo's ownscripts/install_psutil_android.pyshim before the[termux]install.setup-hermes.shnever got the equivalent step, so anyone following "Quick setup for developers who cloned the repo manually" on Termux hits this.Related Issue
Fixes #31415
Note: #44390 (open) already fixes the documented manual step-by-step guide in
website/docs/getting-started/termux.mdto include the psutil shim step. That guide never mentionssetup-hermes.sh, so this PR is a separate, non-overlapping fix for the convenience script itself — confirmed no open PR currently touchessetup-hermes.sh's Termux branch.Type of Change
Changes Made
setup-hermes.sh: on Termux, detectsys.platform == "android"and runscripts/install_psutil_android.py(mirroringinstall.sh's existing guard and warning message) before the[termux]pip install.How to Test
rm -rf venv && ./setup-hermes.shERROR: Failed to build 'psutil' when getting requirements to build wheeland the script still exits 0 withvenv/bin/containing nohermesentry point.Android Python detected: prebuilding psutil compatibility shim...prints before the[termux]install,pip install -e ".[termux]"succeeds, andhermes --version/hermes doctorwork afterward.Checklist
Code
fix(scope):)setup-hermes.sh)Documentation & Housekeeping
website/docs/getting-started/termux.mddoesn't referencesetup-hermes.shso no doc update needed here