Skip to content

fix: skip incompatible extras on Android/Termux#16171

Closed
camillanapoles wants to merge 2 commits into
NousResearch:mainfrom
camillanapoles:termux-android-support
Closed

fix: skip incompatible extras on Android/Termux#16171
camillanapoles wants to merge 2 commits into
NousResearch:mainfrom
camillanapoles:termux-android-support

Conversation

@camillanapoles

Copy link
Copy Markdown

Problem

hermes update fails on Android/Termux (aarch64, Python 3.13) because pip install -e ".[all]" hits transitive dependencies without wheels:

Extra Problematic dep Issue
voice ctranslate2 (via faster-whisper) No wheels for cp313 or android_arm64
messaging davey (via discord.py[voice]) Rust/maturin, no Android build
matrix python-olm (via mautrix[e2be]) libolm archived, build fails

The update process crashes during dependency resolution and the user is left with a broken installation.

Solution

Runtime detection in hermes_cli/main.py:

  • New _android_excluded_extras() function checks sys.platform == "android" and returns the set of incompatible extras
  • _install_python_dependencies_with_optional_fallback() uses this to build a filtered extras string instead of .[all] on Android
  • The individual-extras fallback loop also skips excluded extras

Defense in depth via pyproject.toml:

  • Added sys_platform != "android" markers to voice extra dependencies

Changes

  • hermes_cli/main.py: +42 lines (new function + integration in install flow)
  • pyproject.toml: +2 markers on voice deps

Testing

Tested on:

  • Device: Nothing Phone 2, Android 16
  • Environment: Termux 0.119.0-beta.3, Python 3.13.13
  • pip install --dry-run with filtered extras → exit 0, 128 packages resolved
  • hermes update completes successfully
  • hermes --version → v0.11.0 ✓

Impact

  • Zero impact on non-Android platforms: _android_excluded_extras() returns set() when sys.platform != "android"
  • No new dependencies
  • Minimal code footprint: single function + 2 integration points
  • Graceful degradation: if filtered install fails, falls back to base + individual extras (which also skip incompatible ones)

Copilot AI review requested due to automatic review settings April 26, 2026 18:33
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard labels Apr 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@teknium1

Copy link
Copy Markdown
Contributor

Closing as superseded by #22901.

Triage notes (high confidence):
Android/Termux extras handling extensively reworked on main (hermes_cli/main.py:8026-8083, _is_android_python and _install_psutil_android_compat). PR #22901 (merged 2026-05-10) made Termux work end-to-end, plus #21489 added termux-all extras profile.

Thanks for the contribution — the underlying problem this PR addresses has been resolved by the linked PR on current main. If you believe this was closed in error, please comment and we'll reopen.

(Bulk-closed during a CLI PR triage sweep.)

@teknium1 teknium1 closed this May 24, 2026
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 P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants