fix: stop restoring a mismatched CocoaPods cache on the TestFlight build - #403
Merged
Conversation
The iOS build failed on 2026-08-19 with "could not find compatible versions for pod hermes-engine ... differs from the version stored in Pods/Local Podspecs", which reads like a hermes problem but is not one. The Podfile.lock was correct at that commit. `ios/Pods` was cached with `key: pods-<hash of Podfile.lock>` and `restore-keys: pods-`. When the lock changed - a pod had been removed - the exact key missed, and the prefix fallback happily restored the Pods/ directory from two days earlier, built from the previous dependency set. `pod install` then compared the current podspecs against those stale Pods/Local Podspecs and gave up. Dropping the fallback makes the cache exact-hit-or-cold. `ios/Pods` is resolved output, valid only for the lock that produced it - unlike a package download, where a partial hit is a useful head start. The cost is one full `pod install` whenever the lock changes, which is exactly when one is wanted; an unchanged lock still hits the exact key and is unaffected. The lock hash alone remains a sufficient key: a Podfile change alters PODFILE CHECKSUM inside the lock, and an npm dependency change alters the resolved pod versions in it.
|
gdoumen
marked this pull request as ready for review
August 19, 2026 10:10
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.



The iOS TestFlight build failed on 2026-08-19:
Both sides name the same source, which is the tell: nothing is wrong with hermes-engine, and nothing was wrong with
Podfile.lockeither —f73b875 chore: add pod lockhad already regenerated it, and I verified that commit was an ancestor of the failed build's sha (4c08207). The lock was correct when the build ran.Cause: the Pods cache
f73b875changedPodfile.lock(a pod was removed), so the exact cache key missed.restore-keys: pods-is a prefix fallback matching any earlier pods cache, so it restoredios/Podsfrom 17 Aug — built from the previous dependency set.pod installcompared the current podspecs against that stalePods/Local Podspecsand failed.The history matches: last success 17 Aug, first failure today, and the only thing in between is the dependency set changing.
Fix
Drop the fallback, making the cache exact-hit-or-cold.
ios/Podsis resolved output, valid only for the exact lock that produced it — unlike a package download, where a partial hit is a useful head start. A prefix fallback silently substitutes a directory built from different inputs, which is precisely this failure.The cost is one full
pod installwhenever the lock changes, which is exactly when one is wanted. An unchanged lock still hits the exact key, so the common case is unaffected.The lock hash alone remains a sufficient key — no extra hash inputs are needed: a Podfile change alters
PODFILE CHECKSUMinside the lock, and an npm dependency change alters the resolved pod versions in it.Test plan
keyandpathonly.No Mac-side work is needed —
Podfile.lockis already correct in the repo.