Repository navigation
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
373bf17 to
99076b7
Compare
…hardlinks Android SELinux blocks link(2) with EACCES/EPERM, breaking file locking and atomic copy operations that rely on fs.link*. Patch node:fs link, linkSync, and promises.link on Android early in runCliCommand() to fall back to exclusive copyFile (COPYFILE_EXCL) while preserving EEXIST semantics, and add unit tests covering fallback, error propagation, and idempotency. Co-authored-by: Antigravity (Gemini 4 Neon) <noreply@google.com>
99076b7 to
b0ea153
Compare
Problem
On Android (Termux, arm64, Node
v26.13.1), SELinux blockslink(2)withEACCES/EPERM, breakingfs.link,fs.linkSync, andfs.promises.linkcalls (e.g., lockfile and atomic link operations).Change
apps/server/src/androidCompat.ts, invoked early inrunCliCommand()inapps/server/src/binMain.ts) that wrapsfs.link,fs.linkSync, andfs.promises.linkwhenprocess.platform === "android". Whenlink(2)fails withEACCESorEPERM, it falls back tocopyFile/copyFileSync/fs.promises.copyFilewithCOPYFILE_EXCLsoEEXISTsemantics are preserved, callsNodeModule.syncBuiltinESMExports(), and guards against double-patching. Non-Android platforms are untouched.apps/server/src/androidCompat.test.ts) covering non-Android no-op behavior,EACCES/EPERMfallback across sync/callback/promise APIs, error propagation for non-SELinux errors (EEXIST), and idempotency.Split from the original combined PR: the companion
ffi-rs1.3.2->1.3.7bump is now in #44856 (full native Termux setup also depends on upstream microsoft/node-pty#1019). Creating the fork, commits, and this PR were all done using T3 Code itself running inside Termux viat3 serveand controlled from the T3 Code Android app (the web UI was also tested and used to configure Antigravity).Scope
Focused, Android-only compatibility fix (
process.platform === "android") with zero runtime impact on macOS, Linux, or Windows. No prior issue was filed because the failure is a straightforwardEACCES/EPERMerror fromlink(2)under Android SELinux.Verification
Verified directly on Android arm64 (Termux, Node
v26.13.1, pnpm12.14.0):t3 serve, controlled it via the T3 Code Android app (creating the fork, commits, and PRs from it), and also tested the web UI directly, including configuring Antigravity through the web UI.patchAndroidHardlinkFallback()against realnode:fs/node:fs/promiseson temporary files in Termux; verifiedlinkSync,link, andpromises.linkfall back to copying content and still fail withEEXISTwhen the destination already exists.apps/server/src/androidCompat.test.ts(non-Android no-op,EACCES/EPERMfallback withCOPYFILE_EXCL,EEXISTpropagation without copy, and idempotency).tsc --noEmit(strict,exactOptionalPropertyTypes,noUncheckedIndexedAccess,verbatimModuleSyntax,erasableSyntaxOnly) onapps/server/src/androidCompat.ts: 0 errors.oxlintonapps/server/src/androidCompat.ts,apps/server/src/androidCompat.test.ts, andapps/server/src/binMain.ts: 0 warnings, 0 errors.oxfmt --checkon all 3 files: all formatted cleanly.vp(vite-plus) does not ship anandroid-arm64native binding yet, sovp run check:changedand running Vitest viavp test runcould not be executed in Termux and rely on GitHub Actions CI.Written with Gemini 4 Neon via Antigravity (running inside T3 Code on Android/Termux).