[build-tools] Add 3rd party precompiled modules support#3573
[build-tools] Add 3rd party precompiled modules support#3573
Conversation
|
Subscribed to pull request
Generated by CodeMention |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3573 +/- ##
==========================================
+ Coverage 54.27% 54.43% +0.17%
==========================================
Files 820 822 +2
Lines 35011 35143 +132
Branches 7248 7263 +15
==========================================
+ Hits 18998 19126 +128
- Misses 15926 15930 +4
Partials 87 87 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Reintroduces third-party precompiled iOS module preparation in worker builds (previously in #3556), updating the download URLs and wiring the preparation into iOS pod-install flows.
Changes:
- Add build-tools utilities to download/extract third-party precompiled module archives and wait (with timeout) before
pod install. - Start preparation early in worker builds and expose env vars (
EXPO_USE_PRECOMPILED_MODULES, optionallyEXPO_PRECOMPILED_MODULES_PATH) for flagged iOS jobs. - Add unit + integration test coverage and fixtures for the precompiled modules preparation behavior.
Reviewed changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/worker/src/env.ts | Enables precompiled-module env vars for flagged iOS jobs and sets the modules path when third-party downloads are enabled. |
| packages/worker/src/config.ts | Adds the configured third-party precompiled modules download URLs to worker config. |
| packages/worker/src/build.ts | Starts background preparation early in the worker lifecycle. |
| packages/worker/src/unit/env.test.ts | Adds tests covering env var behavior for enabled/disabled third-party module downloads. |
| packages/build-tools/src/utils/precompiledModules.ts | Implements download/extract/publish logic, plus wait-with-timeout coordination. |
| packages/build-tools/src/utils/tests/precompiledModules.test.ts | Unit tests for proxy download, fallback, extraction, failure handling, and timeout behavior. |
| packages/build-tools/src/utils/integration-tests/precompiledModules.test.ts | Integration test validating merged Debug/Release extraction into the expected destination tree. |
| packages/build-tools/src/utils/integration-tests/fixtures/precompiledModules/xcframeworks-Debug.zip | Adds debug fixture archive used by the integration test. |
| packages/build-tools/src/utils/integration-tests/fixtures/precompiledModules/xcframeworks-Release.zip | Adds release fixture archive used by the integration test. |
| packages/build-tools/src/steps/functions/installPods.ts | Waits (best-effort) for preparation before running pod install in the steps-based flow. |
| packages/build-tools/src/steps/functions/tests/installPods.test.ts | Tests the new wait-and-continue behavior for the steps-based pod install. |
| packages/build-tools/src/ios/pod.ts | Waits (best-effort) for preparation before running pod install in the legacy pod flow. |
| packages/build-tools/src/ios/tests/pod.test.ts | Tests that legacy pod install waits for prep and continues on prep failure. |
| packages/build-tools/src/index.ts | Exports the new precompiled modules helpers from @expo/build-tools. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| url: string; | ||
| archivePath: string; | ||
| cocoapodsProxyUrl?: string; | ||
| logger: bunyan; | ||
| signal: AbortSignal; | ||
| }): Promise<void> { | ||
| const proxiedUrl = cocoapodsProxyUrl | ||
| ? (() => { | ||
| const parsedUrl = new URL(url); | ||
| return `${cocoapodsProxyUrl}/${parsedUrl.hostname}${parsedUrl.pathname}${parsedUrl.search}${parsedUrl.hash}`; |
There was a problem hiding this comment.
The timeout/abort logic won't cancel an in-flight download: @expo/downloader doesn't accept an AbortSignal, and the calls here don't set any per-request timeout. This means a slow/hung download can keep running (and hold disk space in tmp) even after waitForThirdPartyPrecompiledModulesPreparationAsync() times out. Consider adding a reasonable download timeout (possibly configurable) and/or extending the downloader usage to support cancellation via AbortSignal.
| thirdPartyPrecompiledModulesUrls: [ | ||
| 'https://storage.googleapis.com/turtle-v2/precompiled-modules/b3e34ec259271164e537f6d33b446130ebc666aa/xcframeworks-Debug.zip', | ||
| 'https://storage.googleapis.com/turtle-v2/precompiled-modules/b3e34ec259271164e537f6d33b446130ebc666aa/xcframeworks-Release.zip', | ||
| ], |
There was a problem hiding this comment.
These precompiled-module URLs are hard-coded in worker runtime config. That makes rotating the artifact set (or switching buckets/versions) require a worker release rather than a runtime config update, unlike other URLs (npm/maven/cocoapods) that come from WORKER_RUNTIME_CONFIG_BASE64. Consider sourcing this list from runtime config (with these as defaults) to make rollouts and emergency rollbacks operationally safer.
|
⏩ The changelog entry check has been skipped since the "no changelog" label is present. |
Summary
Reintroduces support for third-party precompiled iOS modules in EAS Build as a best-effort optimization.
First-party prebuilds are now distributed through npm packages, so this change only covers downloading and preparing third-party precompiled module artifacts on the worker.
What changed
pod installSPIN_UP_BUILDERso preparation can overlap with earlier build workpod install, but only up to 15 secondspod installif preparation fails or times outEXPO_USE_PRECOMPILED_MODULES=1whenEAS_USE_PRECOMPILED_MODULES=1EXPO_PRECOMPILED_MODULES_PATHonly when third-party downloads are enabledEnv behavior
EAS_USE_PRECOMPILED_MODULES=1EXPO_USE_PRECOMPILED_MODULES=1EXPO_PRECOMPILED_MODULES_PATHEAS_USE_PRECOMPILED_MODULESunsetEAS_USE_PRECOMPILED_MODULES=1andEAS_DISABLE_THIRD_PARTY_PRECOMPILED_MODULES=1EXPO_USE_PRECOMPILED_MODULES=1EXPO_PRECOMPILED_MODULES_PATHImplementation notes
pod installwaitsTest coverage