github / github/copilot-cli

Android/Termux support broken in v1.0.48+ (runtime.node requires glibc)

未关闭
#3,333 5 条评论 4 个 reaction 已指派 0 人 在 GitHub 查看
area:installation area:platform-linux
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

## Summary

Copilot CLI v1.0.48 introduced a native Rust addon (`runtime.node`) that is compiled against glibc, making it impossible to run on Android/Termux where Node.js uses Bionic libc.

## Environment

- **Platform**: Android (Termux)
- **`process.platform`**: `"android"`
- **`process.arch`**: `"arm64"`
- **Node.js**: v24.x (Termux package)
- **Last working version**: 1.0.45

## Issues by version

### v1.0.45 (workable with patches)

Three fixable issues:
1. **ripgrep**: Looks for `ripgrep/bin/android-arm64/rg` — fixed by copying from `linux-arm64/rg` (statically linked, runs fine)
2. **pty.node**: Looks for `prebuilds/android-arm64/pty.node` — fixed by building `node-pty` from source on Termux
3. **Platform switch**: The native module loader in `app.js`/`index.js`/`sdk/index.js` doesn't handle `case "android"` — fixed by patching the JS

### v1.0.48+ (BROKEN — no workaround)

A new `runtime.node` Rust addon was introduced that handles token counting (tiktoken), MCP config parsing, shell analysis, hooks, and session filesystem. It is linked against glibc:

```
NEEDED: libgcc_s.so.1, libpthread.so.0, libm.so.6, libdl.so.2, libc.so.6
```

This **cannot** run on Android because:
- Android uses Bionic libc, not glibc
- The glibc TLS (Thread-Local Storage) model is incompatible with Android's linker
- You cannot mix glibc and Bionic libraries in the same process
- The binary is closed-source Rust, so we cannot rebuild it

## Request

1. **Ship an Android-compatible `runtime.node`** — Rust supports the `aarch64-linux-android` target natively. Cross-compiling with `cargo build --target aarch64-linux-android` would produce a Bionic-compatible binary.

2. **Add `android-arm64` to the platform matrix** — The optional dependencies (`@github/copilot-linux-arm64`, etc.) should include an `@github/copilot-android-arm64` variant.

3. **Handle `"android"` in the platform switch** — The JS code in `app.js`, `index.js`, and `sdk/index.js` should map `process.platform === "android"` to the appropriate prebuild path.

## Workaround

We are pinned to v1.0.45. Users who accidentally upgrade are stuck.

## Additional context

Termux is a widely-used terminal emulator for Android that provides a Linux-like environment. Node.js runs natively on it. Before v1.0.48, Copilot CLI worked with minor patches. The introduction of the glibc-only native addon broke this entirely.

贡献指南

打开贡献指南

调研方向

检查 app.js、index.js 和 sdk/index.js,以及可选依赖项的平台矩阵,以追踪原生模块的选择方式。验证 runtime.node 和 android-arm64 包将如何为 Termux 提供,然后确认 Android 平台映射和 runtime 加载,同时不破坏现有目标。

由索引模型根据 Issue 内容生成。

评估

技术栈
android, node.js, rust
领域
build-system, cli, mobile
Issue 类型
缺陷
难度
5/5
预计耗时
一周以上
活跃度
冷清
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。