-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Enable strip in release mode by default #4122
Copy link
Copy link
Closed
Labels
A-configurationArea: cargo config files and env varsArea: cargo config files and env varsC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-buildS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or reviewStatus: Issue or feature is accepted, and has a team member available to help mentor or reviewS-needs-team-inputStatus: Needs input from team on whether/how to proceed.Status: Needs input from team on whether/how to proceed.T-cargoTeam: CargoTeam: Cargodisposition-mergeFCP with intent to mergeFCP with intent to mergefinished-final-comment-periodFCP completeFCP complete
Metadata
Metadata
Assignees
Labels
A-configurationArea: cargo config files and env varsArea: cargo config files and env varsC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-buildS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or reviewStatus: Issue or feature is accepted, and has a team member available to help mentor or reviewS-needs-team-inputStatus: Needs input from team on whether/how to proceed.Status: Needs input from team on whether/how to proceed.T-cargoTeam: CargoTeam: Cargodisposition-mergeFCP with intent to mergeFCP with intent to mergefinished-final-comment-periodFCP completeFCP complete
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
FCP merge
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!