Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upBuild --release doesn't optimise filesize? #4122
Comments
This comment has been minimized.
This comment has been minimized.
ghost
commented
Jun 5, 2017
|
I think this should only change if |
This comment has been minimized.
This comment has been minimized.
|
@cedenday I don't see an issue with backtraces being wiped in |
This comment has been minimized.
This comment has been minimized.
|
Thanks for the report! I think this is mostly due to the addition of debuginfo into the standard library a few versions ago, so the lion's share of |
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton maybe LLVM's For ld/lld |
This comment has been minimized.
This comment has been minimized.
|
@mati865 we have a nightly rustc flag for that: rust-lang/rust#49212. I think the idea is, eventually, to enable stripping for |
This comment has been minimized.
This comment has been minimized.
|
@matklad that's nice but it would be even better if there was option to use |
This comment has been minimized.
This comment has been minimized.
jcbritobr
commented
Jul 6, 2018
|
Hello. When this will be solved? |
cup
referenced this issue
Oct 19, 2018
Merged
Pass --strip-debug to GccLinker when building without debuginfo #49212
This comment has been minimized.
This comment has been minimized.
|
cc #3483 |
SuperCuber commentedJun 5, 2017
•
edited
I'd expect
build --releaseto apply all optimisations, and one of them would be file size.I tried two programs, a trivial "hello rust" and a trivial "hello panic". Both of their sizes were 3.8M which is pretty crazy for something that is supposed to be optimised... So I tried
strip --strip-alling the executables.Hello rust went to 372K
Hello panic went to 364K
That's a pretty huge change... The only difference in functionality I found is that
RUST_BACKTRACE=1shows a lot of<unknown>s onstriped files which is to be expected, but I think that's not a real issue because the whole point of--releaseis that it's not supposed to be debugged, there is the normalbuildfor that...For now I will be
strip --strip-alling all of my released executables but I really don't see a reason whybuild --releasedoesn't do it. I'd be happy to be enlightened if I missed anything though!