4 ms·
You are looking at the aftermath. Also, you could have manually put `strip = "debuginfo"` to avoid the 4 MB binary even before that; the issue is about the defa
by lifthrasiir 3y ago
You are looking at the aftermath. Also, you could have manually put `strip = "debuginfo"` to avoid the 4 MB binary even before that; the issue is about the default when no `strip` option was given.
- josephg 3y agoNo, this is using stable rust 1.75. The binary is not stripped at all, and its still 400kb, not 4mb.
- pdimitar 3y agoActually my issue is with including the stdlib in its entirety, sorry for not clarifying. Indeed we could always strip the binaries and I've done so on every Rust project I worked on.
- lights0123 3y agoYou are aware that the stdlib is linked with --as-needed which tells the linker to not include unused code, right? The entire stdlib is not included in Rust binaries unless you use the entire stdlib. However, as this article shows, that does not apply to debug info.
- pdimitar 3y agoActually I was not aware, thanks for clarifying! Hrm, I read the comments of another user who contributes to Rust and it seems there is various formatting / panic / abort / symbol and location translation code that contributes to the size and currently there is not much that can be done about it. Oh well.