feat: add Android/Termux support to postinstall and wrapper#1144
Open
Ue1i7on wants to merge 1 commit into
Open
feat: add Android/Termux support to postinstall and wrapper#1144Ue1i7on wants to merge 1 commit into
Ue1i7on wants to merge 1 commit into
Conversation
On Termux (Android), os.platform() returns 'android', which caused: - postinstall.mjs to look for @mimo-ai/mimocode-android-arm64 (doesn't exist) - bin/mimo wrapper to construct an incorrect lookup path Changes: - postinstall.mjs: map android to linux for binary package lookup - bin/mimo: add android to platformMap for correct binary resolution - bin/mimo: use grun (glibc-runner) on Android to execute glibc-linked binary Linux arm64 binaries are compiled against glibc and need grun to run on Termux, which uses Android's bionic libc.
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.
Issue for this PR
Closes #1139, #305
Type of change
What does this PR do?
On Termux (Android arm64),
os.platform()returns"android". TheplatformMapin bothpostinstall.mjsandbin/mimoonly mappeddarwin,linux, andwin32. This caused:@mimo-ai/mimocode-android-arm64— a package that doesn't exist. The correct binary is@mimo-ai/mimocode-linux-arm64.spawn()tries to execute the glibc-linked binary directly. On Termux, the linux-arm64 binary is compiled against glibc and can't run natively (Termux uses Android's bionic libc).Changes:
postinstall.mjs: addandroid: "linux"toplatformMapso the postinstall resolves the correct binary package.bin/mimo: addandroid: "linux"toplatformMap; in therun()function, detect Android and usegrun(glibc-runner) as the command wrapper, passing the target binary as the first argument.Why this works: Termux provides
grun(via theglibc-runnerpackage fromtur-repo) which loads a full glibc userspace and executes glibc-linked binaries. The linux-arm64 binary can run undergrun, and the platform mapping fix ensures the correct package (@mimo-ai/mimocode-linux-arm64) is looked up.How did you verify your code works?
Tested on Termux (Android 16, aarch64) with Node v24 and npm v11:
@mimo-ai/cli@0.1.1with--ignore-scripts@mimo-ai/mimocode-linux-arm64@0.1.1postinstall.mjsmanually to verify binary is correctly resolved and linkedmimo --version— outputs0.1.1mimo --help— full help output with commands, options, and agent listingThe
--forceflag is still needed on Termux to bypass theosconstraint on optional dependency packages. The generatedpackage.jsonfor binary packages only lists"os": ["linux"], so npm filters them out on Android. Fixing that in the build script is a separate concern.Screenshots / recordings
Checklist