Skip to content

Strip local symbols from macOS and Linux release bundles - #63429

Open
SomeoneToIgnore wants to merge 1 commit into
mainfrom
kb/strip-binaries
Open

Strip local symbols from macOS and Linux release bundles#63429
SomeoneToIgnore wants to merge 1 commit into
mainfrom
kb/strip-binaries

Conversation

@SomeoneToIgnore

@SomeoneToIgnore SomeoneToIgnore commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

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.zip in #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-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.

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%)

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Aug 29, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label Aug 29, 2026
@zed-industries-bot

zed-industries-bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor
Messages
📖

This PR includes links to the following GitHub Issues: #59689
If this PR aims to close an issue, please include a Closes #ISSUE line at the top of the PR body.

Generated by 🚫 dangerJS against 676d279

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%).
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants