fix(ios): make Podfile.lock SPEC CHECKSUMS deterministic across machines#56994
Open
IsaacIsrael wants to merge 1 commit into
Open
fix(ios): make Podfile.lock SPEC CHECKSUMS deterministic across machines#56994IsaacIsrael wants to merge 1 commit into
IsaacIsrael wants to merge 1 commit into
Conversation
Two sources of non-determinism cause Podfile.lock to differ between machines, breaking `pod install --deployment` in CI: 1. Yoga.podspec: Dir.glob returns files in filesystem-dependent order. Add .sort to ensure consistent ordering regardless of OS/filesystem. 2. hermes-engine.podspec: require.resolve with __dir__ produces an absolute path containing the user's home directory. Compute a relative path from Pod::Config sandbox root and use $(PODS_ROOT) so the xcconfig is deterministic while supporting any project layout. Fixes facebook#56975 Co-authored-by: Cursor <cursoragent@cursor.com>
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
Two sources of non-determinism cause
Podfile.lockSPEC CHECKSUMS to differ between machines, breakingpod install --deploymentin CI and creating unnecessary churn in PRs.Fix 1: Sort
Dir.globresults inYoga.podspecDir.globreturns files in filesystem-dependent order (varies across macOS APFS volumes, case sensitivity settings, and Linux ext4/xfs). Since CocoaPods evaluates the podspec at install time, the resulting array order differs between machines, producing different spec checksums.Fix 2: Use a Pods-relative path in
hermes-engine.podspecrequire.resolvewith__dir__resolves to an absolute path containing the developer's home directory (e.g.,/Users/alice/project/node_modules/...). This absolute path gets baked intouser_target_xcconfig, which differs per machine.Instead of hardcoding a relative path (which assumes a specific project layout), we dynamically compute the relative path from
Pod::Config.instance.sandbox.rootto the resolvedhermes-compilerlocation. This supports any project layout (standard apps, monorepos, RNTester, etc.) while keeping the xcconfig deterministic.Changelog:
[IOS] [FIXED] - Make Podfile.lock SPEC CHECKSUMS deterministic across machines by sorting Dir.glob results in Yoga.podspec and using a dynamically computed Pods-relative path in hermes-engine.podspec
Test Plan
pod installon machine A, recordPodfile.lockpod installon machine B (different username/home directory)We have verified this fix in our production app — after patching, running
pod installconsecutively produces zero diff inPodfile.lock.Supersedes #56977 (closed due to force-push history issue).
Fixes #56975
Made with Cursor