Skip to content

hermes-engine checksum in Podfile.lock changes with the checkout path (Hermes built from source) #58889

Description

@Critteros

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

  1. Clone the reproducer into a folder.
  2. npm install
  3. bundle install
  4. npm run pod
  5. git diff ios/Podfile.lock
  6. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions