-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Binaries built with 1.21.0 are 5x the size of those from 1.20.0 #46150
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
Comments
Nevermind nightly, hadn't updated rustup in a while. The binaries are back down in size with the most recent nightly, but not the current beta (1.22.0-beta.3 (cc6ed06 2017-11-13)). Please backport this fix so it makes 1.22.0! |
@saarw Have you tried running |
Running strip -x -u -r reduces the binary size on mac from 9.3M to 7.6M so there is still a long way to go. Running without arguments doesn't work (error message "symbols referenced by indirect symbol table entries that can't be stripped"). Isn't there also a chance that too aggressive stripping will break the code's ability to unwind panics? |
@saarw The worst it can do is make all symbols Since 1.22 will be released in 2 days, there's likely no chance to backport fixes for this which isn't a really serious bug. 1.23 will also enter beta soon, so the bug will naturally go away in 6 weeks. Would you mind to share the library for comparison though? We may still like to know what caused the size fluctuation. |
I can't share the library, but you can replicate the difference by cloning the hyper crate and adding the following to Cargo.toml
When you build it with 1.20.0, you get a dylib of about 160K, while the same lib is 3+ M when built with 1.21.0 |
Test sizes on
However, if you run
Since I'm going to guess the fix was introduced in #45575. |
See #45613 for a workaround. Also marking this as a duplicate of the linked issue. EDIT: the work around is to compile |
We are building a library on Mac/Linux/Windows that ends up being ~2 MB when built with Rust 1.20 and Rust 1.19, but when I am building it with Rust 1.21.0
or nightly, the library becomes ~10 MB.In both cases I'm building with "cargo build --release"
The text was updated successfully, but these errors were encountered: