[No QA] Strip Hermes debug info from production iOS bytecode#83256
[No QA] Strip Hermes debug info from production iOS bytecode#83256roryabraham merged 6 commits intomainfrom
Conversation
Add a patch for react-native's react-native-xcode.sh to always pass -output-source-map to hermesc for production builds. This strips ~13.4MB of debug metadata from the bytecode by writing it to the source map file instead. When source maps aren't being composed, the generated .map file is cleaned up to prevent it from shipping. This is the standalone App counterpart to the same fix applied in Mobile-Expensify for HybridApp builds. Co-authored-by: Cursor <cursoragent@cursor.com>
Made-with: Cursor
This comment was marked as resolved.
This comment was marked as resolved.
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
@truph01 I don't think we need C+ review here |
The previous patch broke debug builds on physical devices where EMIT_SOURCEMAP=true. The compose step expects main.jsbundle.map from hermesc, which wasn't being generated for dev builds. Now pass -output-source-map when EITHER source maps are requested (EMIT_SOURCEMAP=true) OR it's a production build (DEV!=true). Made-with: Cursor
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
Android build failure is unrelated, I will work on fixing it separately |
|
@roryabraham looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 @roryabraham has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
@roryabraham @Julesssss No QA steps, OK to checkoff this one? |
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.3.28-0 🚀
|
@m-natarajan yeah no QA needed |
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.3.30-0 🚀
|
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.3.30-3 🚀
|
Explanation of Change
Patches
react-native-xcode.shto always pass-output-source-maptohermescfor production iOS builds, regardless of whetherSOURCEMAP_FILEis set. This strips ~10MB of debug metadata from the Hermes bytecode — the data gets written to a separate source map file instead of being embedded in the bytecode.Previously,
-output-source-mapwas only passed conditionally whenEMIT_SOURCEMAPwas true (derived fromSOURCEMAP_FILEbeing set). If the build environment didn't properly propagateSOURCEMAP_FILE, the flag was omitted and debug info remained in the shippedmain.jsbundle.When source maps are being composed (the normal case), the existing compose-and-cleanup flow is unchanged. When they aren't, the generated
.mapfile is cleaned up so it doesn't ship in the IPA.This is the standalone App build counterpart to the same fix applied in Mobile-Expensify for HybridApp builds: https://github.com/Expensify/Mobile-Expensify/pull/13867
Fixed Issues
$ #83000
MOBILE-EXPENSIFY: https://github.com/Expensify/Mobile-Expensify/pull/13867
Tests
Offline tests
N/A — this change only affects the build-time bytecode compilation, not runtime behavior.
QA Steps
None.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
N/A — build-time only change, no UI impact
Android: mWeb Chrome
N/A — build-time only change, no UI impact
iOS: Native
N/A — build-time only change, no UI impact
iOS: mWeb Safari
N/A — build-time only change, no UI impact
MacOS: Chrome / Safari
N/A — build-time only change, no UI impact