Skip to content

Fix the Android build on Windows - #51

Merged
jimrandomh merged 2 commits into
jimrandomh:mainfrom
A-nony-mous:fix/windows-build
Oct 23, 2026
Merged

jimrandomh merged 2 commits into
jimrandomh:mainfrom
A-nony-mous:fix/windows-build

Conversation

@A-nony-mous

Copy link
Copy Markdown
Contributor

Two independent Windows-only failures kept npm run build from producing an APK on a Windows checkout:

1. Node cannot hand gradlew.bat to CreateProcess (EINVAL). scripts/kotlin-build.cjs spawned the wrapper directly; on Windows the .bat must go through a shell. Run it through shell: true there, quoted so checkouts under paths with spaces still work.

2. The NDK clang wrapper is not a Win32 program (CreateProcess error=193). The NDK ships its clang driver twice: extensionless, as a Unix shell script, and as .cmd, the variant Windows can launch. App_Resources/Android/app.gradle executed the extensionless one, so prepareFaceclawNativeLibs died building libfaceclaw_lc3.so. Select .cmd on Windows; same story for llvm-strip.exe in prepareFaceclawLlama.

Also fixes two tests that only held on a POSIX checkout: one matched a template ending in a bare newline (a Windows checkout converts it to CRLF), and one compared a path.relative() result, which uses backslashes there.

Verified on Windows 10/JDK 21/NDK 26: full debug build now succeeds end-to-end (llama.cpp, native libs, Gradle) and produces an APK; the affected tests pass (tests/kotlin-build.test.cjs, tests/evenhub-extensions-shim.test.cjs, 13/13). No behavior change on macOS/Linux — both fixes are guarded by platform checks.

Node cannot hand gradlew.bat to CreateProcess (EINVAL); run the wrapper
through a shell there. Two tests also assumed a POSIX checkout's
trailing newline and path separators.
The extensionless wrapper is a Unix shell script; CreateProcess rejects
it with error 193. llvm-strip likewise needs .exe there.
@jimrandomh
jimrandomh merged commit bce2307 into jimrandomh:main Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants