Repository navigation
Conversation
Contributor
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This PR is confined to local Android development-build tooling and tests, preserving native caches around an existing clean prebuild without changing product behavior, defaults, schemas, deployment, or static-analysis settings. The recovery and interruption paths are covered by focused filesystem tests. Notes:
You can add or adjust custom eligibility rules. Learn more. |
macroscopeapp
Bot
dismissed
their stale review
October 11, 2026 07:07
Dismissing prior approval to re-evaluate 4cff81a
This branch has not been deployed
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.
Problem
mobile-native-clientruns a clean Expo prebuild before building an Android development client. Deleting the generated Android directory also deletes.gradleandapp/.cxx, so repeated builds lose Gradle task history and the app's native compilation outputs even when their inputs are unchanged.Change
Move those two directories aside on the same filesystem before Android prebuild, then restore them before Gradle runs. Skip caches behind symlinked directories and refuse restoration through a symlinked parent. Clean prebuild still regenerates native source, autolinking and JS bundle outputs. The existing tracked-native-file guard remains in place, and iOS follows its existing path.
Restore saved outputs after prebuild failure or interruption too. If recovery fails or a regenerated cache directory conflicts, retain the saved files and print their recovery path. This also reports the path when a pending interruption suppresses the returned error. If recovery also fails after a prebuild or save failure, the helper returns the original cause and prints the recovery instructions.
Scope and approval
This is a focused fix for cache loss in the existing native-client command. It preserves outputs that Gradle/Ninja invalidate against their inputs; it adds no build mode, dependency or product setting. I am submitting it under the focused obvious-bug exception without a prior issue or maintainer approval.
Replaces #15412, which was closed because its body did not name the model and harness. The code is unchanged; they are stated at the end.
Fixes #18161.
Verification
vp exec tsc -p scripts/tsconfig.json --noEmitpasses.expo prebuild --clean --platform android --no-installruns followed by ARM64:app:assembleDebugbuilds. Both APKs passed signature verification. A further clean prebuild and debug build passed after rebasing onto the current upstream base.Before-and-after timing
A controlled comparison of clean Expo prebuild plus ARM64 debug Gradle build on
4cff81areduced mean elapsed time from 67.7 s to 46.2 s, saving 21.6 s (31.8%).prebuildAndroidBoth versions used the same source, checkout, environment and warm shared Gradle cache. Each received three warm-ups and an excluded pilot before six measured runs in ABBAAB order. An earlier sequence was discarded after another job briefly overlapped. The reported sequence had no competing heavy job or swap activity. Hyperfine timed the commands; APK signature and content checks ran outside the timed interval.
Environment: Ubuntu/WSL, Ryzen 9 9950X3D with 16 exposed vCPUs, 47 GiB RAM, Node 24.21.0, Java 17 and Android build tools 37.0.0. Both versions used
APP_VARIANT=development,NODE_ENV=development, a 12 GiB memory cap andnice -n 10. The prebuild command wasexpo prebuild --clean --platform android --no-install; the Gradle command was:./gradlew :app:assembleDebug -PreactNativeArchitectures=arm64-v8a \ --build-cache --parallel --max-workers=2 --no-daemon \ -Dorg.gradle.jvmargs='-Xmx3072m -XX:MaxMetaspaceSize=768m' \ -Pkotlin.compiler.execution.strategy=in-processAll six reported builds succeeded, and their APKs passed signature verification. All 3,242 non-signature ZIP entries had identical content hashes across both versions. Generated project/build outputs were regenerated each time.
This is development evidence for warm repeated debug builds of one unchanged app revision. It excludes dependency installation, warm-ups, fingerprint discovery and device installation, and does not establish cold-build or cross-revision performance. macOS/Windows execution and cancellation of an actual Expo subprocess were not checked; interruption tests use Effect fibers with deterministic barriers.
GPT-6.1 Sol, in Codex.
Closes #18161