-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Fix hermes-engine Podfile.lock checksum inconsistency across developers #55208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix hermes-engine Podfile.lock checksum inconsistency across developers #55208
Conversation
cortinico
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review automatically exported from Phabricator review in Meta.
cipolleschi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the attempt. This is not the right solution because we can't make assumptions on the structure of the projects. React Native is not used from the template only, but also in several brownfield scenarios we need to consider.
In the comment, I suggested a proper fix.
You can also test the fix by building the RNTesterApp locally:
# from the react-native folder
yarn install
cd packages/rn-tester
bundle install
bundle exec pod install
open RNTesterPods.xcworkspace
yarn start
Then build and run in xcode.
| # For non-standard structures, use HERMES_OVERRIDE_HERMESC_PATH environment variable. | ||
| spec.user_target_xcconfig = { | ||
| 'HERMES_CLI_PATH' => "#{hermes_compiler_path}/hermesc/osx-bin/hermesc" | ||
| 'HERMES_CLI_PATH' => "${PODS_ROOT}/../../node_modules/hermes-compiler/hermesc/osx-bin/hermesc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the attempt, but this won't work.
Sure, it works for the template app specifically, but, for example, it does not work for the RNTester app we have inside the repo.
For the RNTester app, the Pods folder is located in react-native/packages/rn-tester/Pods.
Therefore ${PODS_ROOT}/../../ points to packages, which won't have a node_modules folder, so the HERMES_CLI_PATH will always fail.
The right approach here would be to keep the resolution, and then use something like Pathname#relative_path_from to compute a path that it is always correct, independently from how the project is set up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing that out! I've updated the implementation as per your suggestion to use Pathname#relative_path_from.
5d9d8b5 to
7fdc8b9
Compare
Summary:
Fixed an issue where developers with identical development environments get different checksums for hermes-engine in Podfile.lock, causing unnecessary git conflicts.
The root cause was that hermes-engine.podspec used require.resolve() to get the absolute path to hermes-compiler, which included usernames. This caused the generated hermes-engine.podspec.json to differ across developers, resulting in different checksums.
See Issue: #54891
Changelog:
[IOS] [FIXED] - Fix hermes-engine Podfile.lock checksum inconsistency across developers
Test Plan:
pod installand verifiedhermes-engine.podspec.jsoncontains${PODS_ROOT}/../../node_modules/hermes-compilerpathrn-testerapp builds and runs successfully