android-jsi CMake builds for all NDK ABIs regardless of reactNativeArchitectures filter
Description
When a React Native project passes -PreactNativeArchitectures to restrict which ABIs to build for (e.g. arm64-v8a,armeabi-v7a), the app module respects the filter — but the watermelondb-android-jsi native library compiles for all NDK ABIs (including x86, x86_64) anyway.
This wastes significant CPU time during local and EAS builds, especially on developer machines or CI runners where every second counts. The unnecessary .so files are eventually stripped from the AAB packaging, so it is purely wasted work.
Root Cause
The native/android-jsi/build.gradle has no abiFilters in its defaultConfig.ndk{} block, so CMake/ninja builds for every architecture the NDK supports — ignoring the parent project's reactNativeArchitectures property.
Proposed Fix
PR #1970 adds an ndk.abiFilters block in defaultConfig that reads the reactNativeArchitectures (or react.nativeArchitectures) property from rootProject. When unset, the list is empty which is a no-op (all ABIs built, same as before).
Steps to Reproduce
- Set
android.gradleCommandineas.jsonto:app:bundleRelease -PreactNativeArchitectures=arm64-v8a - Run
eas build --platform android --profile production --local - Observe that ninja spawns
x86andx86_64build processes forwatermelondb-android-jsi
Environment
- WatermelonDB: current master
- React Native: 0.85.x
- Android: API 26+
Source: Nozbe/WatermelonDB