Skip to content

Commit df1bde4

Browse files
fix(ios): make Podfile.lock SPEC CHECKSUMS deterministic across machines
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 #56975 Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 707e366 commit df1bde4

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

packages/react-native/ReactCommon/yoga/Yoga.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@ Pod::Spec.new do |spec|
6161
# Fabric must be able to access private headers (which should not be included in the umbrella header)
6262
all_header_files = 'yoga/**/*.h'
6363
all_header_files = File.join('ReactCommon/yoga', all_header_files) if ENV['INSTALL_YOGA_WITHOUT_PATH_OPTION']
64-
spec.private_header_files = Dir.glob(all_header_files) - Dir.glob(public_header_files)
64+
spec.private_header_files = Dir.glob(all_header_files).sort - Dir.glob(public_header_files).sort
6565
spec.preserve_paths = [all_header_files]
6666
end

packages/react-native/sdks/hermes-engine/hermes-engine.podspec

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,14 @@ Pod::Spec.new do |spec|
7070
hermes_compiler_path = File.dirname(Pod::Executable.execute_command('node', ['-p',
7171
"require.resolve(\"hermes-compiler\", {paths: [\"#{react_native_path}\"]})", __dir__]).strip
7272
)
73+
hermesc_path = File.join(hermes_compiler_path, 'hermesc', 'osx-bin', 'hermesc')
74+
75+
require 'pathname'
76+
pods_root = Pod::Config.instance.sandbox.root
77+
relative_hermesc = Pathname.new(hermesc_path).relative_path_from(pods_root)
7378

7479
spec.user_target_xcconfig = {
75-
'HERMES_CLI_PATH' => "#{hermes_compiler_path}/hermesc/osx-bin/hermesc"
80+
'HERMES_CLI_PATH' => "$(PODS_ROOT)/#{relative_hermesc}"
7681
}
7782
end
7883

0 commit comments

Comments
 (0)