Repository navigation
docs: add Android (Termux) install guide - #62695
jason081112 wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
The page is clear and fits the V2 docs conventions: frontmatter, supported Callout types, root-relative links and the sidebar entry all look right. I didn't run anything because this is docs only and I have no Termux device, so the steps themselves are your testing, not mine. I also checked that the updater won't detect a binary under ~/.local/lib/opencode, so auto-update won't overwrite the patched binary. That matches the manual update section.
Public API: unchanged.
One inconsistency to fix in the troubleshooting table (inline comment).
For maintainers: this documents an unofficial workaround in the official docs, which is your call. The draft #60903 would add a native android-arm64 build, and if it lands this page should be removed or rewritten.
| | Symptom | Cause | Fix | | ||
| | --- | --- | --- | | ||
| | `serve: error while loading shared libraries: serve` | Started through `grun` or `ld.so`, so the service cannot re-exec itself | Run the launcher from [Add a launcher](#add-a-launcher) | | ||
| | `libc.so: invalid ELF header` | `LD_PRELOAD` still points at Termux's Bionic shim | Make sure the launcher runs `unset LD_PRELOAD` | |
There was a problem hiding this comment.
This row says libc.so: invalid ELF header comes from a leftover LD_PRELOAD. The "Patch the interpreter only" warning above (and your PR description) says the same error comes from setting an RPATH. If both can cause it, please list both fixes here: re-extract and patch only the interpreter, or check the launcher. Otherwise someone who ran grun -c will keep checking their launcher.
|
Fixed in a3b2236. The On the maintainer call: agreed, this is a workaround, and the page says |
Issue for this PR
Closes #
Type of change
What does this PR do?
Adds an Android (Termux) page to the V2 docs and links it from the CLI install section.
The Linux ARM64 build is a glibc ELF and Termux is Bionic, so it does not run as shipped. The page documents the setup I verified on aarch64: install glibc and
patchelf, point the ELF interpreter at Termux's loader, and wrap the binary in a launcher that clearsLD_PRELOAD.Two details are worth calling out because they are easy to get wrong:
--set-rpath(whatgrun -cdoes) rewrites the executable and corrupts its bundled payload, which shows up asSIGSEGVorlibc.so: invalid ELF header. Termux's loader already searches$PREFIX/glibc/lib.grunorld.somakes/proc/self/exethe loader, so the background service's re-exec fails withserve: error while loading shared libraries: serve. Running the patched binary directly avoids it.The page is marked community-maintained, so it does not claim official Android support.
How did you verify your code works?
On Termux aarch64 with Android 15 and
@opencode/cli-linux-arm64:opencode --versionprints the release versionopencode service statusreturns the background service URLLD_PRELOADsetI also checked that the standalone
opencode-linux-arm64.tar.gzfrom the update API requests/lib/ld-linux-aarch64.so.1, so the same patch applies to the download path the page uses.Screenshots / recordings
N/A. New page only.
Checklist
Added by the opencode bot (AI-generated).
Related: #47612, #60762