Skip to content

Commit 5ff0b4a

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. Replace with a $(PODS_ROOT)-relative path that resolves at build time instead. Fixes #56975 Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent b8bb88d commit 5ff0b4a

2 files changed

Lines changed: 2 additions & 6 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: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,8 @@ Pod::Spec.new do |spec|
6767
# When using the local prebuilt tarball, it should include hermesc compatible with the used VM.
6868
# In other cases, the prebuilt versioned Hermes V1 hermesc binaries from the hermes-compiler npm package can be used.
6969
if source_type != HermesEngineSourceType::LOCAL_PREBUILT_TARBALL
70-
hermes_compiler_path = File.dirname(Pod::Executable.execute_command('node', ['-p',
71-
"require.resolve(\"hermes-compiler\", {paths: [\"#{react_native_path}\"]})", __dir__]).strip
72-
)
73-
7470
spec.user_target_xcconfig = {
75-
'HERMES_CLI_PATH' => "#{hermes_compiler_path}/hermesc/osx-bin/hermesc"
71+
'HERMES_CLI_PATH' => '$(PODS_ROOT)/../../node_modules/hermes-compiler/hermesc/osx-bin/hermesc'
7672
}
7773
end
7874

0 commit comments

Comments
 (0)