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..b2ba034b7284d4 --- /dev/null +++ b/static/app/views/preprod/buildDetails/main/insights/mainBinaryExportedSymbolsModal.tsx @@ -0,0 +1,71 @@ +import {openInsightInfoModal} from 'sentry/actionCreators/modal'; +import {Flex} from 'sentry/components/core/layout'; +import {Text} from 'sentry/components/core/text'; +import {t, tct} from 'sentry/locale'; +import {InlineCode} from 'sentry/views/preprod/buildDetails/main/insights/insightInfoModal'; + +function getMainBinaryExportedSymbolsContent() { + return ( + + + + + {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.' + )} + + + {t( + 'You can maintain a minimal allowlist so only required entry points stay exported:' + )} + + + + +
    +
  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 will now limit the export trie to just that allowlist.')} +
+
+
+ ); +} + +export function openMainBinaryExportedSymbolsModal() { + openInsightInfoModal({ + title: t('Main binary export metadata'), + children: getMainBinaryExportedSymbolsContent(), + }); +}