Skip to content

Commit 06b5526

Browse files
committed
fix(cocoapods) Podfile.lock SPEC CHECKSUMS drift for React XCFrameworks
**Symptom:** Two developers (or one developer on two paths, or CI vs. local) running pod install on the same React Native project at the same commit get different SPEC CHECKSUMS entries for React-Core-prebuilt and ReactNativeDependencies in Podfile.lock. That breaks pod install-deployment style verification and any workflow that expects Podfile.lock to be reproducible. Root cause: CocoaPods derives each SPEC CHECKSUMS entry by hashing the in-memory podspec JSON. So anything embedded in source.http, prepare_command, user_target_xcconfig, etc. becomes part of the hash. Two podspec-resolution sites in this repo build their source.http from an absolute on-disk path. Because project_pods_root is an absolute path, the resulting file://<abs>/... URL differs across machines or working-tree paths, so the hashed JSON differs, so the checksum differs. **Fix: ** The Maven URL for each tarball is already computed inside both functions (stable_tarball_url(...) / nightly_tarball_url(...) / release_tarball_url(...)). Returning that URL — a stable string identical across machines — instead of the local file:// URL makes source.http path-free. CocoaPods downloads from Maven and caches the tarball itself, so functionality is preserved. The pre-existing local-tarball download is kept untouched (its only remaining consumer is the opt-in `RCT_SYMBOLICATE_PREBUILT_FRAMEWORKS=1` dSYM-injection path in rncore.rb, which still needs file:// to feed CocoaPods a mutated tarball — gated by unless @@download_dsyms so the leak is preserved only for that flag). **Out of scope: ** hermes-engine.podspec has the same shape of leak in user_target_xcconfig.HERMES_CLI_PATH. Fixing it requires a paired change to ensure hermesc lands at the new ${PODS_ROOT}-relative path; that's a separate PR.
1 parent 74b1a4d commit 06b5526

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

packages/react-native/scripts/cocoapods/rncore.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ def self.podspec_source_download_prebuild_stable_tarball()
160160
rncore_log(" #{Pathname.new(destinationDebug).relative_path_from(Pathname.pwd).to_s}")
161161
rncore_log(" #{Pathname.new(destinationRelease).relative_path_from(Pathname.pwd).to_s}")
162162

163+
return {:http => stable_tarball_url(@@react_native_version, :debug) } unless @@download_dsyms
163164
return {:http => URI::File.build(path: destinationDebug).to_s }
164165
end
165166

@@ -196,6 +197,7 @@ def self.podspec_source_download_prebuilt_nightly_tarball()
196197
rncore_log("Resolved nightly ReactNativeCore-prebuilt version:")
197198
rncore_log(" #{Pathname.new(destinationDebug).relative_path_from(Pathname.pwd).to_s}")
198199
rncore_log(" #{Pathname.new(destinationRelease).relative_path_from(Pathname.pwd).to_s}")
200+
return {:http => nightly_tarball_url(@@react_native_version, :debug) } unless @@download_dsyms
199201
return {:http => URI::File.build(path: destinationDebug).to_s }
200202
end
201203

packages/react-native/scripts/cocoapods/rndependencies.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,10 @@ def self.podspec_source_download_prebuild_release_tarball()
158158

159159
url = release_tarball_url(@@react_native_version, :debug)
160160
rndeps_log("Using tarball from URL: #{url}")
161-
destinationDebug = download_stable_rndeps(@@react_native_path, @@react_native_version, :debug)
161+
download_stable_rndeps(@@react_native_path, @@react_native_version, :debug)
162162
download_stable_rndeps(@@react_native_path, @@react_native_version, :release)
163163

164-
return {:http => URI::File.build(path: destinationDebug).to_s }
164+
return {:http => url }
165165
end
166166

167167
def self.release_tarball_url(version, build_type)
@@ -225,11 +225,10 @@ def self.podspec_source_download_prebuilt_nightly_tarball(version)
225225

226226
url = nightly_tarball_url(version, :debug)
227227
rndeps_log("Using tarball from URL: #{url}")
228-
destinationDebug = download_nightly_rndeps(@@react_native_path, @@react_native_version, :debug)
228+
download_nightly_rndeps(@@react_native_path, @@react_native_version, :debug)
229229
download_nightly_rndeps(@@react_native_path, @@react_native_version, :release)
230230

231-
return {:http => URI::File.build(path: destinationDebug).to_s }
232-
return {:http => url}
231+
return {:http => url }
233232
end
234233

235234
def self.download_rndeps_tarball(react_native_path, tarball_url, version, configuration)

0 commit comments

Comments
 (0)