fix(update): handle uv binary incompatibility and NODE_ENV=production on Termux#35287
Closed
alaamohanad169-ship-it wants to merge 1 commit into
Closed
Conversation
… 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.
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. |
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.
Summary
Two fixes for
hermes updateon 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.1which doesn't exist — causingFileNotFoundErrorat subprocess time, not at thewhich()check.Added a
uv --versionprobe 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=productionis set in the environment (common on Termux), npm skips devDependencies. TypeScript (tsc) is a devDependency of the web UI, sonpm run buildfails withtsc: not found.Fixed by:
envparameter to_run_npm_install_deterministic()and_run_with_idle_timeout()NODE_ENV=developmentin_build_web_ui()for all npm subprocess callsTesting
Verified both fixes on Termux/Android (aarch64, Python 3.13, Node 26):
hermes updatecompletes cleanly with uv binary present but incompatibleNODE_ENV=productionin the parent environment