Repository navigation
feat(terminal): harden Android arm64 bionic loader, packaging validation and docs - #2579
Merged
Merged
Conversation
houko
force-pushed
the
feat/android-terminal-1452
branch
2 times, most recently
from
November 27, 2026 10:40
0eb5f46 to
63bd5e7
Compare
houko
force-pushed
the
feat/android-terminal-1452
branch
from
November 27, 2026 11:36
63bd5e7 to
2c39475
Compare
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
Follow-up hardening, bug fixes, ELF/packaging regression tests and documentation updates on top of #2139 for Android arm64
base/terminalsupport.fakecgo__errnofix:internal/purego/internal/fakecgo/zsymbols_android_android_arm64.gopreviously imported glibc's__errno_locationfromlibc.so, which bionic does not export (flagged in feat(terminal): support Android arm64 remote sessions #2139 review and fixed in upstreamebitengine/purego#572). Switched the dynamic import to bionic's__errnoso Android'slinker64resolves it cleanly even whensyscall.Setuid-family calls retainfakecgo.errno().dlerror&dlopen(NULL)semantics:internal/purego/dlfcn_android_nocgo_android_arm64.gonow locks the OS thread acrossdlopen/dlsym/dlclose+dlerror, passesNULLfor an emptydlopenpath, and explicitly records//go:cgo_import_dynamic _ _ "libdl.so".validateNativeBinaryincmd/nsgo/package_natives.goto validateandroidELF64 shared libraries (ET_DYN, noPT_INTERP, matching architecture).androidGhosttyFileincmd/nsgo/android.goto validatelib/android-arm64/libghostty-vt.soand report an error if the committed arm64 prebuild is missing or wrong-arch.base/terminal/internal/library.Find()onandroid/arm64whenlibghostty-vt.sois absent beside the executable.internal/purego/andbase/terminal/internal/vtininternal/moduletest/layering_test.go'slayerstable (removing the ad-hoccheckLayerexception) and unwrapped hard-wrapped comments.base/terminal/internal/library: tests for AndroidnativeLibraryDirsibling lookup andlib/android-arm64/libghostty-vt.soELF verification (EM_AARCH64,ET_DYN, bionic-onlyDT_NEEDED, exportedghostty_*symbols).cmd/nsgo:TestAndroidTerminalPackagingAndBionicELFbuilds real cgo-freeandroid_arm64APK, AAB and AAR packages with/withoutbase/terminal, verifieslibghostty-vt.soinclusion/omission across all three archive layouts, and inspectslib/arm64-v8a/libnsgo.soELF headers (PT_INTERP == /system/bin/linker64,DT_NEEDEDlibdl.so+libc.sowith no versioned glibc sonames, importeddlopen/dlsym/dlerror/__errnoand no__errno_location).tools/libghostty: addedandroid-arm64selection assertions.docs/architecture/{terminal,layers,tool,embedding}.md,docs/roadmap.md,docs/public/{en,zh}/{terminal,embedding}.md,skills/nsgo/SKILL.md, andinternal/purego/README.mdto reflect shipped Android arm64 support, Android 10 (API 29+) requirement, andandroid/amd64status.Refs #1452
Verification
gofmt -lon all modified.gofiles: clean (empty)go tool nsgo check -target android_arm64,macos_arm64,linux_x64 -jobs 3& hostgo tool nsgo check: passedgo tool nsgo test ./tools/libghostty ./base/terminal/... ./internal/moduletest: passed (114 passed, 0 failed)go tool nsgo test -run "TestTerminal|TestAndroid|TestNative|TestGhostty" ./cmd/nsgo: passed (32 passed, 0 failed)NSGO_PLATFORM_DUPLICATES_BASE=origin/main go tool nsgo test -run '^TestPlatformFunctionDuplicates$' ./internal/moduletest: passedgo tool nsgo test -run '^TestRepositoryFragments$' ./tools/changelog: passedinternal/platform/android/runtime/classes.dexorclasses.jar.🤖 Gemini 4 Neon