build(android): drop the x86_64 ABI, which no Android can run

The fat APK's second half was 31 MB that cannot execute on any Android
device. modernc.org/libc's Xlstat64 issues a raw lstat syscall on
linux/amd64, and Android's seccomp policy forbids it because bionic
never issues it, so the process takes SIGSYS the first time anything
touches the database -- which for this app is startup. That is every
x86_64 Android, x86 Chromebooks included, not merely the emulator.
arm64 is structurally unaffected: the architecture has no lstat syscall
at all, so modernc routes through fstatat.

27,059,130 bytes to 15,898,465, and one lib/ entry.

Three places had to agree, and the third is what would have made this a
silent no-op: abiFilters (what Gradle packages), android:package rather
than package:fat (what Go *compiles* -- otherwise the library is still
built and then discarded), and the native-code assertion in CI. That
assertion is anchored, `native-code: 'arm64-v8a'$`, because without the
anchor it also matches the fat APK's line and would pass on exactly the
thing it exists to catch. Checked against a real artifact.

Adding the ABI back, if modernc ever fixes Xlstat64, is those same
three edits.
This commit is contained in:
2026-08-16 22:26:11 -04:00
parent da38b865fc
commit b6651310ea
3 changed files with 31 additions and 10 deletions
+14 -3
View File
@@ -40,9 +40,21 @@ android {
versionCode Integer.parseInt(System.getenv("YJ_VERSION_CODE") ?: "1")
versionName System.getenv("YJ_VERSION") ?: "0.0.0"
// Configure supported ABIs
// **arm64 only, and x86_64 is not a gap.** `modernc.org/libc`'s
// Xlstat64 issues a raw lstat syscall on linux/amd64, which
// Android's seccomp policy forbids (bionic never issues it), so
// the process takes SIGSYS the first time anything touches the
// database -- which for this app is startup. That is every
// x86_64 Android, emulators and x86 Chromebooks alike, not just
// some. arm64 is structurally unaffected: the architecture has
// no lstat syscall at all, so modernc routes through fstatat.
//
// So the second ABI was ~31 MB of an artifact that could not run
// anywhere. If modernc fixes it, adding 'x86_64' back here and
// to the native-code assertion in android-apk.yml is the whole
// change.
ndk {
abiFilters 'arm64-v8a', 'x86_64'
abiFilters 'arm64-v8a'
}
}
@@ -93,7 +105,6 @@ android {
packagingOptions {
// Don't strip Go symbols in debug builds
doNotStrip '*/arm64-v8a/libwails.so'
doNotStrip '*/x86_64/libwails.so'
}
}