Repository navigation
[Android/Termux] DSH 0.1.5-rc.1 无法运行:flock is not supported on android-arm64(附 sharp 问题与临时修复) #6148
Replies: 2 comments
|
补充确认,供定位参考(信息都并入此帖,不再另开): 1) 该问题在最新的 0.1.6-alpha.1(commit
2) 走源码检出时,只放宽加载器的平台判断还不够。 3) 一个便于确认的现场特征: 失败时 session 目录里会留下空的 最小复现(源码检出,无需启动 UI): cd packages/session/session-persistence-jsonl
node -e "import('@deepseek-ai/node-addon-system/flock').then(m => m.tryLockExclusive(0)).then(() => console.log('ok')).catch(e => console.log(e.code, '|', e.message))"
# ERR_FLOCK_UNSUPPORTED_PLATFORM | flock is not supported on android-arm64 |
|
中文摘要: Android 上这条其实不必等原生构建—— The diagnosis in this thread matches what we see; one thing that hasn't come up yet is that Android doesn't actually need a native build to be unblocked. bionic has
|
Uh oh!
There was an error while loading. Please reload this page.
中文摘要
DSH 0.1.5-rc.1 在 Android/Termux(aarch64)上每一轮 agent 运行都会失败,界面报:
原因:
@deepseek-ai/dsh-session-persistence-jsonl从 0.1.5 起在每个会话写入前要对session.lock取 POSIXflock,而@deepseek-ai/node-addon-system/lib/flock.js只支持linux/darwin,其它平台直接抛ERR_FLOCK_UNSUPPORTED_PLATFORM;没有 android-arm64 的原生绑定包。0.1.2 不使用 flock,因此这是 0.1.5 引入的回归。同一升级还暴露第二个 Android 兼容问题:
sharp没有 android-arm64 预编译(需回退到@img/sharp-wasm32)。English report
Environment
process.platform === 'android',process.arch === 'arm64')npm install -g @deepseek-ai/dsh$PREFIX/lib/node_modules/@deepseek-ai/dshSummary
Every agent turn fails on Android/Termux:
The session JSONL is never materialized, so no session can run.
Steps to reproduce
npm install -g @deepseek-ai/dsh@0.1.5-rc.1dsh web --no-open, open the printed token URL, send any message.Root cause
@deepseek-ai/node-addon-system/lib/flock.js→loadBinding():Android reports
platform === 'android', so it always throws.There is no
@deepseek-ai/node-addon-system-android-arm64package; onlynode-addon-system-darwin-arm64(and the linux variants) ship prebuilds.Consumer:
@deepseek-ai/dsh-session-persistence-jsonl→SessionWriteLease.acquire()callstryLockExclusive(handle.fd)onsession.lockfor every write-open. It mapsEAGAINtoSessionAlreadyOwnedErrorand rethrows everything else — soERR_FLOCK_UNSUPPORTED_PLATFORMbecomes a fatal turn error.Regression: 0.1.2's
dsh-session-persistence-jsonldoes not import flock at all, so Android worked before this upgrade.Suggested fix (upstream)
Any of these is fine; the lock exists to serialize cross-process writers, and on a single-process harness an in-process claim already excludes all writers (the module's own docs note the browser worker stubs flock to immediate success for exactly this reason):
src/flock.cwith node-gyp), and gate the platform check on actual binding availability rather than a hard platform allow-list.SessionWriteLeasecapability-based (e.g. skip the kernel lock when no binding is available).Workaround (what we applied locally)
Patch the platform branch in
.../@deepseek-ai/node-addon-system/lib/flock.js:Verified:
tryLockExclusive(0)resolves, and sessions run again.Second Android issue on the same upgrade:
sharpsharphas no android-arm64 prebuilt, so image/attachment handling needs the WASM fallback. Workaround used: copy@img/sharp-wasm32@0.35.4(+@emnapi/runtime,tslib) intosharp/node_modules, thensharpreportsversions.sharp 0.35.4 / vips 8.18.6.Minor
Starting a second
dsh webwhile one is already listening producesEADDRINUSE 127.0.0.1:3080and a full stack trace. A clearer message ("already running on port 3080") would help.Note
Both workarounds are wiped by
npm install -g @deepseek-ai/dsh(they live insidenode_modules) and must be re-applied after every upgrade. If DSH can carry these Android accommodations itself, Termux users would stop hitting a hard failure on upgrade.All reactions