Skip to content

fix(update): handle uv binary incompatibility and NODE_ENV=production on Termux#35287

Closed
alaamohanad169-ship-it wants to merge 1 commit into
NousResearch:mainfrom
alaamohanad169-ship-it:fix/termux-update-uv-and-web-build
Closed

fix(update): handle uv binary incompatibility and NODE_ENV=production on Termux#35287
alaamohanad169-ship-it wants to merge 1 commit into
NousResearch:mainfrom
alaamohanad169-ship-it:fix/termux-update-uv-and-web-build

Conversation

@alaamohanad169-ship-it

Copy link
Copy Markdown
Contributor

Summary

Two fixes for hermes update on Android/Termux environments:

1. uv executability check

shutil.which("uv") finds the binary by path but doesn't verify it can actually execute. On Android, the uv binary is an ELF built for Linux with dynamic linker /lib/ld-linux-aarch64.so.1 which doesn't exist — causing FileNotFoundError at subprocess time, not at the which() check.

Added a uv --version probe with proper fallback to pip at all three code paths:

  • _update_via_zip()
  • _cmd_update_impl()
  • _ensure_uv_for_termux()

2. NODE_ENV=development for web build

When NODE_ENV=production is set in the environment (common on Termux), npm skips devDependencies. TypeScript (tsc) is a devDependency of the web UI, so npm run build fails with tsc: not found.

Fixed by:

  • Adding an env parameter to _run_npm_install_deterministic() and _run_with_idle_timeout()
  • Passing NODE_ENV=development in _build_web_ui() for all npm subprocess calls

Testing

Verified both fixes on Termux/Android (aarch64, Python 3.13, Node 26):

  • hermes update completes cleanly with uv binary present but incompatible
  • Web UI builds successfully with NODE_ENV=production in the parent environment

… on Termux

Two fixes for Hermes update on Android/Termux environments:

1. **uv executability check**: shutil.which() finds the uv binary by path
   but doesn't verify it can actually execute. On Android, the uv binary is
   an ELF built for Linux with dynamic linker /lib/ld-linux-aarch64.so.1
   which doesn't exist on Android — causing FileNotFoundError at subprocess
   time. Added a uv --version probe with proper fallback to pip at all three
   code paths (_update_via_zip, _cmd_update_impl, _ensure_uv_for_termux).

2. **NODE_ENV=development for web build**: When NODE_ENV=production is set
   in the environment (common on Termux), npm skips devDependencies.
   TypeScript (tsc) is a devDependency of the web UI, so 'npm run build'
   fails with 'tsc: not found'. Fixed by adding an env parameter to
   _run_npm_install_deterministic and _run_with_idle_timeout, and passing
   NODE_ENV=development in _build_web_ui for all npm subprocess calls.
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard comp/tui Terminal UI (ui-tui/ + tui_gateway/) labels May 30, 2026
@alaamohanad169-ship-it

Copy link
Copy Markdown
Contributor Author

Closing as duplicate. This PR overlaps with #25649, #18682, #17906, and #22187 which all address the same NODE_ENV=production issue. PR #25649 is the most comprehensive (covers TUI + web UI, has test coverage) — that one should be merged instead.

The uv executability check (part 1 of this PR) isn't covered by any existing PR, but I'll submit it separately as a focused one-file change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/tui Terminal UI (ui-tui/ + tui_gateway/) P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants