[build-tools] support remote CocoaPods caching - #4266
Open
AbbanMustafa wants to merge 5 commits into
Open
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4266 +/- ##
==========================================
+ Coverage 64.05% 64.09% +0.05%
==========================================
Files 1042 1043 +1
Lines 48009 48107 +98
Branches 10130 10141 +11
==========================================
+ Hits 30745 30830 +85
- Misses 17148 17161 +13
Partials 116 116 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
AbbanMustafa
marked this pull request as ready for review
August 26, 2026 05:29
…ld-cache # Conflicts: # CHANGELOG.md
|
✅ Thank you for adding the changelog entry! |
sjchmiela
reviewed
Aug 26, 2026
Comment on lines
106
to
+119
| await ctx.cacheManager?.restoreCache(ctx); | ||
| await restoreCcacheAsync({ | ||
| logger: ctx.logger, | ||
| workingDirectory, | ||
| target: { platform: ctx.job.platform, simulator: ctx.job.simulator === true }, | ||
| env: ctx.env, | ||
| secrets: ctx.job.secrets, | ||
| }); | ||
| await restoreCocoapodsCacheAsync({ | ||
| logger: ctx.logger, | ||
| workingDirectory, | ||
| env: ctx.env, | ||
| secrets: ctx.job.secrets, | ||
| }); |
Contributor
There was a problem hiding this comment.
i wonder if it would make sense to parallelize them some time
maybe not in this PR
this is going to create weird log output
Comment on lines
+263
to
+268
| await saveCocoapodsCacheAsync({ | ||
| logger: ctx.logger, | ||
| workingDirectory, | ||
| env: ctx.env, | ||
| secrets: ctx.job.secrets, | ||
| }); |
| }; | ||
| } | ||
|
|
||
| export async function compressCocoapodsCacheAsync({ |
Contributor
There was a problem hiding this comment.
why do we prefer this over compressCacheAsync?
| }); | ||
| } | ||
|
|
||
| export async function saveCocoapodsCacheAsync({ |
Contributor
There was a problem hiding this comment.
we need to prune the cache somehow too? what's the plan here?
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.
Why
CocoaPods dependencies are installed from scratch on every iOS build. For projects with large dependency graphs,
pod installcan add several minutes even whenPodfile.lockhas not changed.Local validation with 107 pods showed that remote Pods caching reduced the relevant phases from 111 seconds to 42 seconds.
The cache-hit validation started with no
Podfile.lockpresent. It requested theios-pods-1.16.2-prefix, restored the hash-qualifiedios-pods-1.16.2-5c51d462...entry, and completed the iOS build successfully.How
EAS_PODS_CACHE=1.ios/Podsunder the exact keyios-pods-<cocoapods-version>-<sha256-of-Podfile.lock>.ios-pods-<cocoapods-version>-prefix and restore its newest matching entry.pod installto reconcile restored Pods with the generated lockfile.~/Library/Caches/CocoaPodsis intentionally excluded. In local testing, its 435 MB archive added approximately 33 seconds of restore time and 42 seconds of recompression on a cache hit.Test Plan
Podfile.lockexists before prebuild.~/Library/Caches/CocoaPodsremoved to simulate a fresh worker.