Description
With RCT_BUILD_HERMES_FROM_SOURCE=true, pod install writes a hermes-engine checksum into ios/Podfile.lock that depends on the absolute path of the checkout. Each developer, worktree and CI machine gets a different checksum. Thus Podfile.lock changes after each pod install, and a team cannot keep one stable lock file
The checksum is the SHA1 of ios/Pods/Local Podspecs/hermes-engine.podspec.json. That file contains two machine-specific values:
- The absolute checkout path in
prepare_command (sdks/hermes-engine/hermes-engine.podspec:137)
- The absolute cmake path that pod install found on PATH (
hermes-engine.podspec:142, :152, :164). Thus a different cmake install also changes the checksum
Expected: all checkouts of the same commit get the same checksum
Steps to reproduce
- Clone the reproducer into a folder.
- npm install
- bundle install
- npm run pod
- git diff ios/Podfile.lock
- Look at the diff: the hermes-engine checksum is different from the committed value
React Native Version
0.87.1
Affected Platforms
Build - MacOS
Output of npx @react-native-community/cli info
Ruby:
version: 3.4.9
path: ~/.local/share/mise/installs/ruby/3.4.9/bin/ruby
npmPackages:
"@react-native-community/cli":
installed: 20.2.0
wanted: 20.2.0
react:
installed: 19.2.3
wanted: 19.2.3
react-native:
installed: 0.87.1
wanted: 0.87.1
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: Not found
newArchEnabled: Not found
iOS:
hermesEnabled: true
newArchEnabled: true
Stacktrace or Logs
# Example diff after `npm run pod` in a second checkout folder:
$ git diff ios/Podfile.lock
- hermes-engine: c94c5b0de2016f9b4ddb499cac3e7368e68845a1
+ hermes-engine: be16442c09deb41aeba2a72257d6a15d08891489
# The checksum is the SHA1 of the local podspec JSON:
$ shasum "ios/Pods/Local Podspecs/hermes-engine.podspec.json"
c94c5b0de2016f9b4ddb499cac3e7368e68845a1 ios/Pods/Local Podspecs/hermes-engine.podspec.json
# That file contains the absolute checkout path and the absolute cmake path:
"prepare_command": ". '<checkout>/node_modules/react-native/sdks/hermes-engine/utils/create-dummy-hermes-xcframework.sh'"
export CMAKE_BINARY=${CMAKE_BINARY:-/opt/homebrew/bin/cmake}
MANDATORY Reproducer
https://github.com/Critteros/hermes-changing-checksum
Screenshots and Videos
No response
Description
With
RCT_BUILD_HERMES_FROM_SOURCE=true,pod installwrites a hermes-engine checksum intoios/Podfile.lockthat depends on the absolute path of the checkout. Each developer, worktree and CI machine gets a different checksum. ThusPodfile.lockchanges after eachpod install, and a team cannot keep one stable lock fileThe checksum is the SHA1 of
ios/Pods/Local Podspecs/hermes-engine.podspec.json. That file contains two machine-specific values:prepare_command(sdks/hermes-engine/hermes-engine.podspec:137)hermes-engine.podspec:142, :152, :164). Thus a different cmake install also changes the checksumExpected: all checkouts of the same commit get the same checksum
Steps to reproduce
React Native Version
0.87.1
Affected Platforms
Build - MacOS
Output of
npx @react-native-community/cli infoStacktrace or Logs
MANDATORY Reproducer
https://github.com/Critteros/hermes-changing-checksum
Screenshots and Videos
No response