Commit 62a2b38
Fix debug Hermes being embedded in iOS Release builds after hermes-engine 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: 2f4111ac7030fcedd888d91c6eb2dd034dc13c0d1 parent dd5dc6b commit 62a2b38
1 file changed
Lines changed: 18 additions & 4 deletions
Lines changed: 18 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
59 | 63 | | |
60 | 64 | | |
61 | 65 | | |
62 | 66 | | |
63 | 67 | | |
64 | 68 | | |
65 | | - | |
66 | | - | |
67 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
68 | 82 | | |
69 | 83 | | |
70 | 84 | | |
| |||
0 commit comments