fix: harden Android build and packaging pipeline#210
Merged
Conversation
Document Android ABI selection and Hermes packaging fixes for release.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this?
This PR hardens the Android build process against the two failure classes uncovered while triaging #209:
android/CMakeLists.txtbecause thefilesallowlist inpackages/android-client/package.jsonwasn't updated when the native build was introduced — every consumer's Android build broke until v2.1.1. CI never caught it because it builds from workspace links, which always see the full source tree.libvoltra_js_renderer.sofailing to link JSI/Hermes symbols onarmeabi-v7aonly. The report did not reproduce on a clean install (all upstream prefab artifacts and a pristine Expo 57 / RN 0.86 build check out), but it exposed that CI never compiles the 32-bit ABIs, so a real regression of that shape would ship unnoticed.It also fixes two adjacent issues in
packages/android-client/android/build.gradle: the library ignored the app'sreactNativeArchitecturesselection, and thepackagingOptionsexcludes still referenced the oldlibhermes.soname, so the renamedlibhermesvm.so(~2 MB per ABI, already provided by the host app's React Native runtime) was bundled into build outputs.How does it work?
android-tarball-buildCI job exercises the real consumer path end to end: it packs@use-voltra/android-client, installs the tarball (not the workspace symlink) into the example app, runsexpo prebuild, and builds the native library with-PreactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64. A file missing from the tarball breaks prebuild or CMake configure; a per-ABI link regression breaks the targetedexternalNativeBuildDebugtask. Scoping the Gradle invocation to that one task keeps the job well under a full app assembly. Rather than asserting a curated list of "critical files" (which invites false confidence — what belongs in the tarball can't be enumerated deterministically), the job relies on hard evidence: the packed artifact either builds or it doesn't. The job'sGITHUB_TOKENis restricted tocontents: read.build.gradlegains the React Native template convention: areactNativeArchitectures()helper feedingndk.abiFilters, so the standalone Hermes runtime is only compiled for the ABIs the app actually ships, and apps that restrict architectures no longer pay for (or trip over) the ones they exclude. The packaging excludes now coverlibhermesvm.soalongside the legacylibhermes.so.Why is this useful?
expo run:androidtime.reactNativeArchitecturesget matching native builds from Voltra instead of the library unconditionally building all four ABIs.