Skip to content

docs(apple): Add swift_ast stripping guide for dSYM uploads#17105

Merged
mtopo27 merged 2 commits intomasterfrom
mtopo27/add-swift-ast-stripping
Mar 24, 2026
Merged

docs(apple): Add swift_ast stripping guide for dSYM uploads#17105
mtopo27 merged 2 commits intomasterfrom
mtopo27/add-swift-ast-stripping

Conversation

@mtopo27
Copy link
Contributor

@mtopo27 mtopo27 commented Mar 24, 2026

DESCRIBE YOUR PR

Add documentation for stripping __swift_ast sections from dSYMs before uploading to Sentry. This section is only used for LLDB debugging and can make up the majority of dSYM size with DWARF v5.

  • Add shared MDX include with explainer text and a bash script to zero out __swift_ast
  • Include the guide in both the Size Analysis and Build Distribution pages under "Uploading Best Practices"

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.
    Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

Add shared include with explainer and script to zero out __swift_ast
sections in dSYMs before uploading. This section is only used for LLDB
debugging and can account for the majority of dSYM size with DWARF v5.

Include is referenced from both the Size Analysis and Build Distribution
pages under a new "Uploading Best Practices" section.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Mar 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sentry-docs Ready Ready Preview, Comment Mar 24, 2026 9:33pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
develop-docs Ignored Ignored Preview Mar 24, 2026 9:33pm

Request Review

done
done < <(find "$DSYMS_DIR" -name "*.dSYM" -type d)

TOTAL_MB=$(echo "scale=1; $TOTAL_ZEROED / 1048576" | bc)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops can you update this to 1000000 for MB units.

@@ -0,0 +1,149 @@
For optimal processing speeds, strip `__swift_ast` from your dSYMs before uploading to Sentry. This section of the binary is a copy of your code's swiftmodule file and is only used for runtime debugging with LLDB. It is not required for symbolication, Size Analysis, or Build Distribution.

The script below can be used to strip `__swift_ast` from your dSYMs. The xcarchive is modified in-place. Back up first if needed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth mentioning that the script requires python3 and some Xcode tools, though those should already be installed on virtually any macOS CI machine.

Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.


zeroed=$(strip_binary "$binary")
if [[ "$zeroed" -gt 0 ]]; then
zeroed_mb=$(echo "scale=1; $zeroed / 1048576" | bc)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent MB divisor between per-file and total output

Medium Severity

The per-file size on line 140 divides by 1048576 (MiB) while the total on line 148 divides by 1000000 (MB), but both label the result as "MB". This means the per-file values and the summary total use different units, producing misleading output. The PR discussion indicates the intent was to use 1000000 everywhere for MB units, so line 140's divisor appears to have been missed during that update.

Additional Locations (1)
Fix in Cursor Fix in Web

@mtopo27 mtopo27 merged commit a114634 into master Mar 24, 2026
18 checks passed
@mtopo27 mtopo27 deleted the mtopo27/add-swift-ast-stripping branch March 24, 2026 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants