Repository navigation
feat(mobile): skip dev-client rebuilds when the Expo native fingerprint is unchanged - #33410
Merged
Merged
Conversation
…nt is unchanged Add `pnpm native ensure <ios|android>`, which installs a cached dev-client build keyed by the Expo fingerprint and only runs `expo run` on a miss. The cache lives in the user cache dir so every worktree shares it, and app.config.js registers it as Expo's buildCacheProvider so plain `expo run` reuses hits too. A report-only PR job flags fingerprint changes against the base in the step summary.
nwparker
marked this pull request as ready for review
October 25, 2026 05:53
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 9 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Summary
Dev-client rebuilds are skipped when the Expo fingerprint of the native inputs hasn't changed.
pnpm native ensure <ios|android> [--device <name|udid|serial>] [--rebuild](mobile/scripts/native-client.mjs) computes the platform fingerprint and looks up a build cached under that fingerprint..appwithxcrun simctl install(the simulator boots headless if needed) or the.apkwithadb install -r -d, and printsHIT <platform> fingerprint <hash>. If that install fails, it falls back to a build.ios/orandroid/whenever its stamp doesn't match the fingerprint, runsexpo run:<platform> --no-bundler, and stores the artifact.~/Library/Caches/orca-mobile/native-builds,$XDG_CACHE_HOME/...,%LOCALAPPDATA%\..., orORCA_MOBILE_NATIVE_BUILD_CACHE_DIR), so every worktree shares it. Writes go through a staging dir and a rename, so a concurrent reader never sees a partial build. The newest 3 entries per platform are kept.buildCacheProvider:mobile/scripts/native-build-cache.cjsis registered as the provider inapp.config.js, so a plainpnpm ios/pnpm androidalso installs a cached build on a hit. Onlyensurewrites to the cache.expo runreuses an existingios//android/directory even when it was generated from older inputs, so letting it store could cache a stale build under the new fingerprint.mobile/fingerprint.config.js:packages/expo-two-way-audio. pnpm installs it undernode_modules/.pnpm, which the fingerprint skips as a nestednode_modules..gitignore, and version/build numbers, which never change native code.@expo/fingerprintis loaded throughexpo's own dependency, so it is the exact version Expo CLI uses. There are no lockfile changes.Mobile native fingerprintjob inmobile.yml(2 vCPU, mobile-only install with--ignore-scripts,continue-on-error) fingerprints the head andHEAD^1. It writes base/head hashes and the changed sources to the step summary, and adds a warning annotation when they differ.Why the provider is a complement, not a replacement
Expo 55 ships a local provider, but its default cache lives per worktree in
.expo/build-cache. Passing a shared absolutecacheDirthrough the Expo config would put a per-user path into the hashed config, so the fingerprint would differ between machines and CI. The custom provider resolves the shared dir at runtime, which keeps the config constant. The EAS provider needs credentials, so it doesn't fit.Notes
expo-updates, soruntimeVersion: { policy: "fingerprint" }doesn't apply and is unchanged. If OTA is adopted later, the same fingerprint (and this CI job) is the natural runtime-version gate.buildCacheProviderand the source skips.Validation
node scripts/typecheck-mobile.mjs,check:tests-typecheck,pnpm lint,pnpm format:check,check:code-quality:changed, and the mobilescripts/tests pass. The new test covers the provider's store gating, variant keys, and LRU pruning.resolveBuildCacheProvider/resolveBuildCache/uploadBuildCacheagainst the real config: a miss, then a store in store mode, then a hit. The CLI hash matchespnpm native fingerprint.ensure androidagainst a stubbedadbprints HIT and installs the cached artifact. The miss path ranexpo prebuild, wrote the stamp, and invokedexpo run:android; that machine has no Android SDK, so the build itself failed.packages/expo-two-way-audio/ioschanges it.comparewas checked locally against base and head fingerprints.