diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0dedd6526..3dd7c09e7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -96,3 +96,29 @@ jobs: path: app/build/outputs/apk/debug/*.apk if-no-files-found: error retention-days: 30 + + # Every NEEDED of every library we ship must resolve inside the apk or on the device. The + # first build shipped libwayland-server.so without libffi.so, and the app died on + # System.loadLibrary the moment a session started — a check this step would have caught. + - name: Check the native dependency closure + run: | + set -euo pipefail + APK=$(find app/build/outputs/apk -name '*.apk' | head -1) + WORK=$(mktemp -d) + unzip -q "$APK" 'lib/arm64-v8a/*' -d "$WORK" + cd "$WORK/lib/arm64-v8a" + # Provided by the platform, so never packaged. + SYSTEM="libc.so libm.so libdl.so liblog.so libandroid.so libz.so libvulkan.so + libGLESv2.so libEGL.so libnativewindow.so libjnigraphics.so libaaudio.so + libOpenSLES.so libmediandk.so libcamera2ndk.so libsync.so libneuralnetworks.so" + fail=0 + for so in *.so; do + for need in $(readelf -d "$so" | sed -n 's/.*NEEDED.*\[\(.*\)\]/\1/p'); do + [ -f "$need" ] && continue + case " $SYSTEM " in *" $need "*) continue ;; esac + echo "::error::$so needs $need, which is neither in the apk nor a platform library" + fail=1 + done + done + [ "$fail" = 0 ] && echo "every NEEDED resolves" + exit $fail diff --git a/app/src/main/jniLibs/arm64-v8a/libffi.so b/app/src/main/jniLibs/arm64-v8a/libffi.so new file mode 100755 index 000000000..eceb85edf Binary files /dev/null and b/app/src/main/jniLibs/arm64-v8a/libffi.so differ