From 814ebb12b64cee51b91ada9fa0d90970feac9a9f Mon Sep 17 00:00:00 2001 From: Christian Falch Date: Wed, 13 May 2026 10:47:42 -0700 Subject: [PATCH] fix(cocoapods) Podfile.lock SPEC CHECKSUMS drift for React XCFrameworks (#56803) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: 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. 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:///... URL differs across machines or working-tree paths, so the hashed JSON differs, so the checksum differs. ### How 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. ## Changelog: [IOS] [FIXED] - Fix Pod install checksum drifting Pull Request resolved: https://github.com/facebook/react-native/pull/56803 Test Plan: Run `pod install` and verify that none of the following files contains absolute paths: - Pods/Local Podspecs/React-Core-prebuilt.podspec.json - Pods/Local Podspecs/ReactNativeDependencies.podspec.json Reviewed By: christophpurrer Differential Revision: D104889112 Pulled By: CalixTang fbshipit-source-id: 97505a8bf78f7df57bda2d87705da5a20c934d2b --- packages/react-native/scripts/cocoapods/rncore.rb | 2 ++ .../react-native/scripts/cocoapods/rndependencies.rb | 9 ++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/react-native/scripts/cocoapods/rncore.rb b/packages/react-native/scripts/cocoapods/rncore.rb index 09cd88363d7..aaa4e5d3325 100644 --- a/packages/react-native/scripts/cocoapods/rncore.rb +++ b/packages/react-native/scripts/cocoapods/rncore.rb @@ -160,6 +160,7 @@ class ReactNativeCoreUtils rncore_log(" #{Pathname.new(destinationDebug).relative_path_from(Pathname.pwd).to_s}") rncore_log(" #{Pathname.new(destinationRelease).relative_path_from(Pathname.pwd).to_s}") + return {:http => stable_tarball_url(@@react_native_version, :debug) } unless @@download_dsyms return {:http => URI::File.build(path: destinationDebug).to_s } end @@ -196,6 +197,7 @@ class ReactNativeCoreUtils rncore_log("Resolved nightly ReactNativeCore-prebuilt version:") rncore_log(" #{Pathname.new(destinationDebug).relative_path_from(Pathname.pwd).to_s}") rncore_log(" #{Pathname.new(destinationRelease).relative_path_from(Pathname.pwd).to_s}") + return {:http => nightly_tarball_url(@@react_native_version, :debug) } unless @@download_dsyms return {:http => URI::File.build(path: destinationDebug).to_s } end diff --git a/packages/react-native/scripts/cocoapods/rndependencies.rb b/packages/react-native/scripts/cocoapods/rndependencies.rb index a9018403407..2000e316cf7 100644 --- a/packages/react-native/scripts/cocoapods/rndependencies.rb +++ b/packages/react-native/scripts/cocoapods/rndependencies.rb @@ -158,10 +158,10 @@ class ReactNativeDependenciesUtils url = release_tarball_url(@@react_native_version, :debug) rndeps_log("Using tarball from URL: #{url}") - destinationDebug = download_stable_rndeps(@@react_native_path, @@react_native_version, :debug) + download_stable_rndeps(@@react_native_path, @@react_native_version, :debug) download_stable_rndeps(@@react_native_path, @@react_native_version, :release) - return {:http => URI::File.build(path: destinationDebug).to_s } + return {:http => url } end def self.release_tarball_url(version, build_type) @@ -225,11 +225,10 @@ class ReactNativeDependenciesUtils url = nightly_tarball_url(version, :debug) rndeps_log("Using tarball from URL: #{url}") - destinationDebug = download_nightly_rndeps(@@react_native_path, @@react_native_version, :debug) + download_nightly_rndeps(@@react_native_path, @@react_native_version, :debug) download_nightly_rndeps(@@react_native_path, @@react_native_version, :release) - return {:http => URI::File.build(path: destinationDebug).to_s } - return {:http => url} + return {:http => url } end def self.download_rndeps_tarball(react_native_path, tarball_url, version, configuration)