Fix debug Hermes being embedded in iOS Release builds after hermes-engine pod re-install#57574
Closed
tjzel wants to merge 2 commits into
Closed
Fix debug Hermes being embedded in iOS Release builds after hermes-engine pod re-install#57574tjzel wants to merge 2 commits into
tjzel wants to merge 2 commits into
Conversation
tjzel
marked this pull request as ready for review
July 16, 2026 08:38
cipolleschi
approved these changes
Jul 16, 2026
|
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this in D112308961. |
cortinico
approved these changes
Jul 16, 2026
cortinico
left a comment
Contributor
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
|
@cipolleschi merged this pull request in 62a2b38. |
react-native-bot
pushed a commit
that referenced
this pull request
Jul 16, 2026
…gine pod re-install (#57574) Summary: The `hermes-engine` pod is always installed from the debug tarball; the debug/release selection is deferred to a build phase that runs `sdks/hermes-engine/utils/replace_hermes_version.js`. The script tracks which variant currently sits in `Pods/hermes-engine` through a `.last_build_configuration` marker at the Pods root and skips the swap when the marker matches the requested configuration. Whenever CocoaPods re-installs `hermes-engine`, the engine resets to the debug variant while the marker still claims `Release`. The next Release build takes the "Same config of the previous build" path and silently embeds the debug `hermesvm` into the Release app. I moved the marker inside `Pods/hermes-engine/` so a pod re-install destroys it together with the engine it describes and the next build re-runs the swap — the same pattern `replace-rncore-version.js` and `replace_dependencies_version.js` already use for their prebuilts. I also added some assertions. ## Changelog: [IOS] [FIXED] - Fix debug Hermes being silently embedded in Release builds after the hermes-engine pod is re-installed Pull Request resolved: #57574 Test Plan: Reproduced on `react-native@0.86.0` before the change: Release build, then `rm -rf ios/Pods/hermes-engine && pod install`, then Release build again — the app's embedded `hermesvm` is the debug binary (`nm -gU -arch arm64 hermesvm | grep -c CDPDebugAPI` prints 6, ~12.2 MB; the release binary prints 0, ~10.2 MB) while the marker says `Release`. Reviewed By: cortinico Differential Revision: D112308961 Pulled By: cipolleschi fbshipit-source-id: 2f4111ac7030fcedd888d91c6eb2dd034dc13c0d
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
The
hermes-enginepod is always installed from the debug tarball; the debug/release selection is deferred to a build phase that runssdks/hermes-engine/utils/replace_hermes_version.js. The script tracks which variant currently sits inPods/hermes-enginethrough a.last_build_configurationmarker at the Pods root and skips the swap when the marker matches the requested configuration.Whenever CocoaPods re-installs
hermes-engine, the engine resets to the debug variant while the marker still claimsRelease. The next Release build takes the "Same config of the previous build" path and silently embeds the debughermesvminto the Release app.I moved the marker inside
Pods/hermes-engine/so a pod re-install destroys it together with the engine it describes and the next build re-runs the swap — the same patternreplace-rncore-version.jsandreplace_dependencies_version.jsalready use for their prebuilts.I also added some assertions.
Changelog:
[IOS] [FIXED] - Fix debug Hermes being silently embedded in Release builds after the hermes-engine pod is re-installed
Test Plan:
Reproduced on
react-native@0.86.0before the change: Release build, thenrm -rf ios/Pods/hermes-engine && pod install, then Release build again — the app's embeddedhermesvmis the debug binary (nm -gU -arch arm64 hermesvm | grep -c CDPDebugAPIprints 6, ~12.2 MB; the release binary prints 0, ~10.2 MB) while the marker saysRelease.