JuliaLang / juliaup

Julia installer and version multiplexer
MIT License
972 stars 82 forks source link

Consider stripping binaries #320

Open darleybarreto opened 2 years ago

darleybarreto commented 2 years ago

Hi,

I tested this

cargo build --release --bins --features selfupdate

strip disabled: juliainstaller - 7.8MB julialauncher - 4MB juliaup - 7.8MB

strip enabled: juliainstaller - 4.4MB julialauncher - 2MB juliaup - 4.5MB

You can enable strip on release by adding strip = true to profile.release.

davidanthoff commented 2 years ago

Would we still get the same error messages, though?

jakobnissen commented 2 years ago

Here is how a panic looks in one of my Rust programs that is compiled with strip=true:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: PosOverflow }', src/main.rs:771:48
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Although I hear backtraces are not actually available if the binary is stripped.

darleybarreto commented 2 years ago

AFAIU, strip=true makes impossible to know what line caused a panic, but error messages should be fine. I tested juliaup with this flag, and the messages were just fine, but when downloading a new version, there was no downloading progress bar. I think this might be an undesired side effect of the crated used to show the bar and strip=true.

jakobnissen commented 2 years ago

It does show the line and column of a panic in my app when compiled with strip, see the above message

darleybarreto commented 2 years ago

Oh, I missed that. So when panicking happens, you lose the stack trace. But if the errors are somewhat dealt with, you can still have nice messages.

ViralBShah commented 1 year ago

This doesn't seem like a worthwhile saving.