Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: strip debug symbols #1177

Merged
merged 4 commits into from
May 22, 2022
Merged

build: strip debug symbols #1177

merged 4 commits into from
May 22, 2022

Conversation

a-kenji
Copy link
Contributor

@a-kenji a-kenji commented Mar 5, 2022

Stripping the symbols for the release build drops binary size
currently by 20% and the plugin binaries by up to 50%.

Alternative: Keep the debug symbols also on releases

Stripping the symbols for the release build drops binary size
currently by 20% and the plugin binaries by up to 50%.

Alternative: Keep the debug symbols also on releases
@matu3ba
Copy link
Contributor

matu3ba commented Mar 11, 2022

What does this mean in total size? The binary is currently 16MB.

  1. How much space do plugins need?
  2. Is it possible to remove plugins to save space? I guess debugging plugin is a very frequent use case, since plugins are "to customize things".

@a-kenji
Copy link
Contributor Author

a-kenji commented Mar 11, 2022

The plugins take:

545k status-bar.wasm -> 306k
581k strider.wasm -> 302k
444k tab-bar.wasm -> 216k

The zellij binary has 12M after stripping.

Is it possible to remove plugins to save space? I guess debugging plugin is a very frequent use case, since plugins are "to customize things".

Not yet, that is certainly planned.`

For now you could load a layout without specifying plugins:

This is a layout that omits the loading of plugins:

---

@TheLostLambda
Copy link
Member

I'm 100% on board with merging this! I've been warned off of some cutting-edge features by @imsnif in the past (as they can break for people who haven't updated their Rust in a while), but I'm personally up for merging whenever others are comfortable!

@imsnif
Copy link
Member

imsnif commented Mar 16, 2022

I'm 100% on board with merging this! I've been warned off of some cutting-edge features by @imsnif in the past (as they can break for people who haven't updated their Rust in a while), but I'm personally up for merging whenever others are comfortable!

How do you mean? Will people need a higher version of rust than is in eg. apt?

@TheLostLambda
Copy link
Member

I'm 100% on board with merging this! I've been warned off of some cutting-edge features by @imsnif in the past (as they can break for people who haven't updated their Rust in a while), but I'm personally up for merging whenever others are comfortable!

How do you mean? Will people need a higher version of rust than is in eg. apt?

I've not actually checked if it breaks older versions, so it might just be ignored, but it's a feature of the latest stable – 1.59.0 (Blog)

@a-kenji
Copy link
Contributor Author

a-kenji commented Mar 16, 2022

I'm 100% on board with merging this! I've been warned off of some cutting-edge features by @imsnif in the past (as they can break for people who haven't updated their Rust in a while), but I'm personally up for merging whenever others are comfortable!

How do you mean? Will people need a higher version of rust than is in eg. apt?

They will "need" a higher version of cargo than what is in apt.

@TheLostLambda
Copy link
Member

@imsnif I've confirmed it breaks for at least 1.57 which was the version on my Ubuntu docker image
image

Maybe we just offer to migrate all of our Ubuntu / Debian users to Arch? 😉

@imsnif
Copy link
Member

imsnif commented Mar 16, 2022

Maybe we just offer to migrate all of our Ubuntu / Debian users to Arch? wink

Best solution

@a-kenji
Copy link
Contributor Author

a-kenji commented Mar 16, 2022

This is the update policy of cargo and rustc of ubuntu:

We maintain rustc and cargo in ubuntu almost entirely to support building firefox. If you're a rust developer looking to work on your own rust programs, you are probably going to have a better experience (for now, at least) using rustup.

https://wiki.ubuntu.com/FoundationsTeam/RustUpdates

@a-kenji a-kenji merged commit d267730 into zellij-org:main May 22, 2022
@raphCode
Copy link
Contributor

Out of curiosity, why do Panic reports still include line numbers?
I expected them to get stripped away with the debug symbols, but they seem to have a different mechanism?

@a-kenji a-kenji deleted the strip-debug branch May 24, 2022 13:41
@a-kenji
Copy link
Contributor Author

a-kenji commented May 24, 2022

Yes, the panic unwind is not yet really configurable on rust, especially stable rust.
It only strips the debug symbols / doesn't include them, which decreases binary size and can improve compilation time.

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.

5 participants