Skip to content

Commit 2becfaa

Browse files
committed
Fix hermes-engine Podfile.lock checksum inconsistency across developers
Summary: See Issue: #54891
1 parent fd4fee0 commit 2becfaa

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# LICENSE file in the root directory of this source tree.
55

66
require "json"
7+
require "pathname"
78
require_relative "./hermes-utils.rb"
89

910
begin
@@ -92,8 +93,13 @@ Pod::Spec.new do |spec|
9293
"require.resolve(\"hermes-compiler\", {paths: [\"#{react_native_path}\"]})", __dir__]).strip
9394
)
9495

96+
# Compute a relative path from PODS_ROOT to avoid absolute paths with usernames that cause different checksums across developers,
97+
# and works regardless of project structure.
98+
hermesc_path = "#{hermes_compiler_path}/hermesc/osx-bin/hermesc"
99+
relative_hermesc_path = Pathname.new(hermesc_path).relative_path_from(Pod::Config.instance.sandbox_root)
100+
95101
spec.user_target_xcconfig = {
96-
'HERMES_CLI_PATH' => "#{hermes_compiler_path}/hermesc/osx-bin/hermesc"
102+
'HERMES_CLI_PATH' => "${PODS_ROOT}/#{relative_hermesc_path}"
97103
}
98104
end
99105

0 commit comments

Comments
 (0)