From cfa431af6dfec6c62c71b6111e8a3ae5c850da9d Mon Sep 17 00:00:00 2001 From: Max Topolsky Date: Thu, 30 Oct 2025 20:34:39 -0400 Subject: [PATCH 1/6] extra escape character? --- .../main/insights/stripDebugSymbolsModal.tsx | 101 +++++++++++------- 1 file changed, 62 insertions(+), 39 deletions(-) diff --git a/static/app/views/preprod/buildDetails/main/insights/stripDebugSymbolsModal.tsx b/static/app/views/preprod/buildDetails/main/insights/stripDebugSymbolsModal.tsx index ce191b99ac86d5..f06b67c46c22b8 100644 --- a/static/app/views/preprod/buildDetails/main/insights/stripDebugSymbolsModal.tsx +++ b/static/app/views/preprod/buildDetails/main/insights/stripDebugSymbolsModal.tsx @@ -30,55 +30,78 @@ if [ -d "\${APP_FRAMEWORKS_DIR}" ]; then fi`; const DSYM_INPUT_FILE = - '${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${EXECUTABLE_NAME}'; + '${DWARF_DSYM_FOLDER_PATH}/${EXECUTABLE_NAME}.app.dSYM/\\\nContents/Resources/DWARF/${EXECUTABLE_NAME}'; function getStripDebugSymbolsContent() { return ( - - - {t( - 'Stripping symbols before creating a dSYM breaks crash symbolication. Confirm your release build still produces and uploads dSYMs before stripping.' - )} - + {t( 'Debug info and symbols are only used during development and should not be shipped to users.' )} - - {t('How to fix')} - - {t('You can manually strip a compiled binary with the strip command:')} - - - {STRIP_SINGLE_BINARY} - - + + + + {t('How to fix')} + + + {t( + 'Strip symbols from release builds and instead rely on separate dSYM files for crash reporters.' + )} + + + {t( + 'Stripping symbols before creating a dSYM breaks crash symbolication. Confirm your release build still produces and uploads dSYMs (or another crash reporter has them) before stripping.' + )} + + + {t( + 'In Xcode, ensure your release configuration sets the Debug Information Format build setting to DWARF with dSYM.' + )} + + + {t('You can manually strip a compiled binary with the strip command:')} + + + + {STRIP_SINGLE_BINARY} + + + - - {t('Automate stripping after build')} - - - {t( - 'Below is a sample script you can add as a Run Script phase. This script may require adjustments based on your project.' - )} - - - - {STRIP_BUILD_SCRIPT} - - - - {t( - 'Because Xcode generates dSYMs from the unstripped binary, list the dSYM as an Input File so the script runs after Xcode finishes generating it:' - )} - - - - {DSYM_INPUT_FILE} - - + + + {t('Automate stripping after build')} + + + {t( + 'This script will strip the main app binary along with any binaries in the Frameworks/ directory. This is a sample script that may require adjustments for your project.' + )} + + + {t( + 'Add a Run Script phase that skips non-release builds and leaves Apple-signed frameworks untouched:' + )} + + + + {STRIP_BUILD_SCRIPT} + + + + {t( + 'Because Xcode generates dSYMs from the unstripped binary, list the dSYM as an Input File so the script runs after Xcode finishes generating it:' + )} + + + + {DSYM_INPUT_FILE} + + + + ); } From 8b732a3a64ff127bcc170c9c5738b6391a4d23df Mon Sep 17 00:00:00 2001 From: Max Topolsky Date: Tue, 4 Nov 2025 21:52:04 -0500 Subject: [PATCH 2/6] comments --- .../main/insights/stripDebugSymbolsModal.tsx | 99 +++++++------------ 1 file changed, 38 insertions(+), 61 deletions(-) diff --git a/static/app/views/preprod/buildDetails/main/insights/stripDebugSymbolsModal.tsx b/static/app/views/preprod/buildDetails/main/insights/stripDebugSymbolsModal.tsx index f06b67c46c22b8..2926d9df727d07 100644 --- a/static/app/views/preprod/buildDetails/main/insights/stripDebugSymbolsModal.tsx +++ b/static/app/views/preprod/buildDetails/main/insights/stripDebugSymbolsModal.tsx @@ -34,74 +34,51 @@ const DSYM_INPUT_FILE = function getStripDebugSymbolsContent() { return ( - + + + {t( + 'Stripping symbols before creating a dSYM breaks crash symbolication. Confirm your release build still produces and uploads dSYMs before stripping.' + )} + {t( 'Debug info and symbols are only used during development and should not be shipped to users.' )} - - - - {t('How to fix')} - - - {t( - 'Strip symbols from release builds and instead rely on separate dSYM files for crash reporters.' - )} - - - {t( - 'Stripping symbols before creating a dSYM breaks crash symbolication. Confirm your release build still produces and uploads dSYMs (or another crash reporter has them) before stripping.' - )} - - - {t( - 'In Xcode, ensure your release configuration sets the Debug Information Format build setting to DWARF with dSYM.' - )} - - - {t('You can manually strip a compiled binary with the strip command:')} - - - - {STRIP_SINGLE_BINARY} - - - + + {t('How to fix')} + + {t('You can manually strip a compiled binary with the strip command:')} + + + {STRIP_SINGLE_BINARY} + + - - - {t('Automate stripping after build')} - - - {t( - 'This script will strip the main app binary along with any binaries in the Frameworks/ directory. This is a sample script that may require adjustments for your project.' - )} - - - {t( - 'Add a Run Script phase that skips non-release builds and leaves Apple-signed frameworks untouched:' - )} - - - - {STRIP_BUILD_SCRIPT} - - - - {t( - 'Because Xcode generates dSYMs from the unstripped binary, list the dSYM as an Input File so the script runs after Xcode finishes generating it:' - )} - - - - {DSYM_INPUT_FILE} - - - - + + {t('Automate stripping after build')} + + + {t( + 'Below is a sample script you can add as a Run Script phase. This script may require adjustments based on your project.' + )} + + + + {STRIP_BUILD_SCRIPT} + + + + {t( + 'Because Xcode generates dSYMs from the unstripped binary, list the dSYM as an Input File so the script runs after Xcode finishes generating it:' + )} + + + + {DSYM_INPUT_FILE} + + ); } From fe41d37a786e1218a10e525f205c60652e77da98 Mon Sep 17 00:00:00 2001 From: Max Topolsky Date: Thu, 30 Oct 2025 21:00:04 -0400 Subject: [PATCH 3/6] binary export insight --- .../insights/appSizeInsightsSidebarRow.tsx | 4 + .../mainBinaryExportedSymbolsModal.tsx | 77 +++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 static/app/views/preprod/buildDetails/main/insights/mainBinaryExportedSymbolsModal.tsx diff --git a/static/app/views/preprod/buildDetails/main/insights/appSizeInsightsSidebarRow.tsx b/static/app/views/preprod/buildDetails/main/insights/appSizeInsightsSidebarRow.tsx index 67f61a98822a9a..5a970efc504d51 100644 --- a/static/app/views/preprod/buildDetails/main/insights/appSizeInsightsSidebarRow.tsx +++ b/static/app/views/preprod/buildDetails/main/insights/appSizeInsightsSidebarRow.tsx @@ -17,6 +17,7 @@ import {formatBytesBase10} from 'sentry/utils/bytes/formatBytesBase10'; import {formatPercentage} from 'sentry/utils/number/formatPercentage'; import useOrganization from 'sentry/utils/useOrganization'; import {openAlternativeIconsInsightModal} from 'sentry/views/preprod/buildDetails/main/insights/alternativeIconsInsightInfoModal'; +import {openMainBinaryExportedSymbolsModal} from 'sentry/views/preprod/buildDetails/main/insights/mainBinaryExportedSymbolsModal'; import {openMinifyLocalizedStringsModal} from 'sentry/views/preprod/buildDetails/main/insights/minifyLocalizedStringsModal'; import {openOptimizeImagesModal} from 'sentry/views/preprod/buildDetails/main/insights/optimizeImagesModal'; import {openStripDebugSymbolsModal} from 'sentry/views/preprod/buildDetails/main/insights/stripDebugSymbolsModal'; @@ -45,6 +46,7 @@ const INSIGHTS_WITH_MORE_INFO_MODAL = [ 'image_optimization', 'webp_optimization', 'alternate_icons_optimization', + 'main_binary_exported_symbols', 'localized_strings_minify', 'strip_binary', ]; @@ -91,6 +93,8 @@ export function AppSizeInsightsSidebarRow({ insight.key === 'webp_optimization' ) { openOptimizeImagesModal(platform); + } else if (insight.key === 'main_binary_exported_symbols') { + openMainBinaryExportedSymbolsModal(); } else if (insight.key === 'localized_strings_minify') { openMinifyLocalizedStringsModal(); } else if (insight.key === 'strip_binary') { diff --git a/static/app/views/preprod/buildDetails/main/insights/mainBinaryExportedSymbolsModal.tsx b/static/app/views/preprod/buildDetails/main/insights/mainBinaryExportedSymbolsModal.tsx new file mode 100644 index 00000000000000..072946ac50a239 --- /dev/null +++ b/static/app/views/preprod/buildDetails/main/insights/mainBinaryExportedSymbolsModal.tsx @@ -0,0 +1,77 @@ +import {openInsightInfoModal} from 'sentry/actionCreators/modal'; +import {Flex} from 'sentry/components/core/layout'; +import {Text} from 'sentry/components/core/text'; +import {Heading} from 'sentry/components/core/text/heading'; +import {t, tct} from 'sentry/locale'; +import {InlineCode} from 'sentry/views/preprod/buildDetails/main/insights/insightInfoModal'; + +function getMainBinaryExportedSymbolsContent() { + return ( + + + + + {t('Main Binary Export Metadata')} + + + {tct( + '[bold:What it is]: Binaries that act as entrypoints for your app, such as your main app binary or watchOS app binary, are not linked against by other binaries. This means the export trie information is unnecessary and can be removed.', + {bold: } + )} + + + {tct( + '[bold:How to fix]: Maintain a minimal allowlist so only required entry points stay exported.', + {bold: } + )} + + + + +
    +
  1. + + {tct('Create a text file in your project, for example [path]', { + path: Config/ExportedSymbols.txt, + })} + +
  2. +
  3. + + {tct('Add [main] on its own line', { + main: _main, + mh: __mh_execute_header, + dlsym: dlsym, + })} + +
  4. +
  5. + + {t('If you rely on other dynamic lookups, list those symbols too')} + +
  6. +
  7. + + {tct('In Xcode, set [setting] to the new file’s path', { + setting: ( + + {t('Build Settings → Linking → Exported Symbols File')} + + ), + })} + +
  8. +
+ {t('Xcode now limits the export trie to just that allowlist')} +
+
+
+ ); +} + +export function openMainBinaryExportedSymbolsModal() { + openInsightInfoModal({ + title: t('Main binary export metadata'), + children: getMainBinaryExportedSymbolsContent(), + }); +} From 85a21cfa3182df084a93c0fbf924b62379661a04 Mon Sep 17 00:00:00 2001 From: Max Topolsky Date: Tue, 4 Nov 2025 22:01:53 -0500 Subject: [PATCH 4/6] comments --- .../main/insights/mainBinaryExportedSymbolsModal.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/static/app/views/preprod/buildDetails/main/insights/mainBinaryExportedSymbolsModal.tsx b/static/app/views/preprod/buildDetails/main/insights/mainBinaryExportedSymbolsModal.tsx index 072946ac50a239..78a6e1e8950414 100644 --- a/static/app/views/preprod/buildDetails/main/insights/mainBinaryExportedSymbolsModal.tsx +++ b/static/app/views/preprod/buildDetails/main/insights/mainBinaryExportedSymbolsModal.tsx @@ -1,7 +1,6 @@ import {openInsightInfoModal} from 'sentry/actionCreators/modal'; import {Flex} from 'sentry/components/core/layout'; import {Text} from 'sentry/components/core/text'; -import {Heading} from 'sentry/components/core/text/heading'; import {t, tct} from 'sentry/locale'; import {InlineCode} from 'sentry/views/preprod/buildDetails/main/insights/insightInfoModal'; @@ -10,9 +9,6 @@ function getMainBinaryExportedSymbolsContent() { - - {t('Main Binary Export Metadata')} - {tct( '[bold:What it is]: Binaries that act as entrypoints for your app, such as your main app binary or watchOS app binary, are not linked against by other binaries. This means the export trie information is unnecessary and can be removed.', From 94c3422bd357a50dc2d5f308111622721ae33b17 Mon Sep 17 00:00:00 2001 From: Max Topolsky Date: Wed, 5 Nov 2025 23:29:47 -0500 Subject: [PATCH 5/6] checkout debug symbol on main --- .../buildDetails/main/insights/stripDebugSymbolsModal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/app/views/preprod/buildDetails/main/insights/stripDebugSymbolsModal.tsx b/static/app/views/preprod/buildDetails/main/insights/stripDebugSymbolsModal.tsx index 2926d9df727d07..ce191b99ac86d5 100644 --- a/static/app/views/preprod/buildDetails/main/insights/stripDebugSymbolsModal.tsx +++ b/static/app/views/preprod/buildDetails/main/insights/stripDebugSymbolsModal.tsx @@ -30,7 +30,7 @@ if [ -d "\${APP_FRAMEWORKS_DIR}" ]; then fi`; const DSYM_INPUT_FILE = - '${DWARF_DSYM_FOLDER_PATH}/${EXECUTABLE_NAME}.app.dSYM/\\\nContents/Resources/DWARF/${EXECUTABLE_NAME}'; + '${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${EXECUTABLE_NAME}'; function getStripDebugSymbolsContent() { return ( From 0cea6ebae6323c8f1cb3d6e410e26802dc29dca5 Mon Sep 17 00:00:00 2001 From: Max Topolsky Date: Tue, 25 Nov 2025 11:29:57 -0500 Subject: [PATCH 6/6] nico comments --- .../main/insights/mainBinaryExportedSymbolsModal.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/static/app/views/preprod/buildDetails/main/insights/mainBinaryExportedSymbolsModal.tsx b/static/app/views/preprod/buildDetails/main/insights/mainBinaryExportedSymbolsModal.tsx index 78a6e1e8950414..b2ba034b7284d4 100644 --- a/static/app/views/preprod/buildDetails/main/insights/mainBinaryExportedSymbolsModal.tsx +++ b/static/app/views/preprod/buildDetails/main/insights/mainBinaryExportedSymbolsModal.tsx @@ -10,15 +10,13 @@ function getMainBinaryExportedSymbolsContent() { - {tct( - '[bold:What it is]: Binaries that act as entrypoints for your app, such as your main app binary or watchOS app binary, are not linked against by other binaries. This means the export trie information is unnecessary and can be removed.', - {bold: } + {t( + 'Binaries that act as entrypoints for your app, such as your main app binary or watchOS app binary, are not linked against by other binaries. This means the export trie information is unnecessary and can be removed.' )} - {tct( - '[bold:How to fix]: Maintain a minimal allowlist so only required entry points stay exported.', - {bold: } + {t( + 'You can maintain a minimal allowlist so only required entry points stay exported:' )} @@ -58,7 +56,7 @@ function getMainBinaryExportedSymbolsContent() { - {t('Xcode now limits the export trie to just that allowlist')} + {t('Xcode will now limit the export trie to just that allowlist.')}