fix(ios): make Podfile.lock SPEC CHECKSUMS deterministic across machines#56977
fix(ios): make Podfile.lock SPEC CHECKSUMS deterministic across machines#56977IsaacIsrael 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. Replace with a $(PODS_ROOT)-relative path that resolves at build time instead. Fixes facebook#56975 Co-authored-by: Cursor <cursoragent@cursor.com>
|
Hi @IsaacIsrael! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
@fabriziocucci has imported this pull request. If you are a Meta employee, you can view this in D106499747. |
|
|
||
| spec.user_target_xcconfig = { | ||
| 'HERMES_CLI_PATH' => "#{hermes_compiler_path}/hermesc/osx-bin/hermesc" | ||
| 'HERMES_CLI_PATH' => '$(PODS_ROOT)/../../node_modules/hermes-compiler/hermesc/osx-bin/hermesc' |
There was a problem hiding this comment.
his won't work with RNTester because RNTester doesn't have an iOS folder. This assumes that the structure is always:
app
|-> node_modules
|-> ios
|-> Pods
But many apps might have different setups and layouts.
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 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.Replaced with
$(PODS_ROOT)/../../node_modules/hermes-compiler/hermesc/osx-bin/hermesc— a Pods-relative Xcode build variable that resolves at build time instead ofpod installtime.Changelog:
[IOS] [FIXED] - Make Podfile.lock SPEC CHECKSUMS deterministic across machines by sorting Dir.glob results in Yoga.podspec and using a 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.Fixes #56975