Strip local symbols from macOS and Linux release bundles - #63429
Open
SomeoneToIgnore wants to merge 1 commit into
Open
Strip local symbols from macOS and Linux release bundles#63429SomeoneToIgnore wants to merge 1 commit into
SomeoneToIgnore wants to merge 1 commit into
Conversation
Contributor
Strips debug info and local symbols from shipped macOS and Linux binaries, matching what Windows already does with PDBs: `bundle-mac` now always runs `dsymutil` before a new `strip -x` step, and `bundle-linux` adds `--discard-all` plus `zed.dbg`/`remote_server.dbg` extraction via `--only-keep-debug`. Sentry uploads are unchanged and precede stripping. The macOS binary UUID and the GNU build id survive stripping, so user-provided traces stay recoverable without rebuilding at the reporter's commit: `sample` output resolves via `atos` against the archived `zed.dwarf`, and `perf.data` via `perf buildid-cache` against the Sentry-archived binary. Both flows are documented, and the Linux perf instructions now record dwarf call graphs, which unwind via the `.eh_frame` data that stripping retains. zed binary: macOS (2026-08-29 nightly): 420478976 -> 316503984 bytes (-24.7%, -104.0MB) Linux (v1.17.2 aarch64): 439417448 -> 336967256 bytes (-23.3%, -102.5MB) Downloads shrink far less, symbols compress ~7:1: the macOS DMG loses only ~15MB. Release Notes: - Improved installed size on macOS and Linux by stripping debug symbols from release binaries (roughly -25%).
SomeoneToIgnore
force-pushed
the
kb/strip-binaries
branch
from
August 29, 2026 22:55
a753cc9 to
676d279
Compare
pixel365
pushed a commit
to pixel365/zed
that referenced
this pull request
Aug 31, 2026
Cargo joins `build.rustflags` across config sources, so the base `symbol-mangling-version=v0` and `tokio_unstable` flags still apply after the newly added config. With sccache disabled, `cargo build --release -p zed` on macOS: Before: zed binary 420677880 bytes After: zed binary 375109048 bytes (-10.8%, -45.6MB) After `strip -x` of both (zed-industries#63429): 313879024 -> 307727432 bytes (-2.0%, -6.2MB) The rest of the delta is the smaller symbol table. `drop_glue` instantiations: 101778 -> 65041. Release Notes: - N/A
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Not sure if this PR is 100% good, since it removes symbols from local traces, leaving addresses only — but this what Windows seem to do already, and we have those symbols on Sentry to restore from, which were needed to normally read Linux perf traces already (see
perf.zipin #59689 (comment))On the upside, uncompressed binaries' are now ~100MB less, which is a lot — hence decided to open the PR for the review
Strips debug info and local symbols from shipped macOS and Linux binaries, matching what Windows already does with PDBs:
bundle-macnow always runsdsymutilbefore a newstrip -xstep, andbundle-linuxadds--discard-allpluszed.dbg/remote_server.dbgextraction via--only-keep-debug.Sentry uploads are unchanged and precede stripping.
The macOS binary UUID and the GNU build id survive stripping, so user-provided traces stay recoverable without rebuilding at the reporter's commit:
sampleoutput resolves viaatosagainst the archivedzed.dwarf, andperf.dataviaperf buildid-cacheagainst the Sentry-archived binary.zed binary:
macOS (2026-08-29 nightly): 420478976 -> 316503984 bytes (-24.7%, -104.0MB)
Linux (v1.17.2 aarch64): 439417448 -> 336967256 bytes (-23.3%, -102.5MB)
Downloads shrink far less, symbols compress ~7:1: the macOS DMG loses only ~15MB.
Release Notes: