Skip to content
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

[Suggestion] Remove debug info from release builds #23

Closed
istudyatuni opened this issue Apr 8, 2022 · 3 comments · Fixed by #24
Closed

[Suggestion] Remove debug info from release builds #23

istudyatuni opened this issue Apr 8, 2022 · 3 comments · Fixed by #24
Labels
enhancement New feature or request packaging Package manager repos, binary downloads, etc.

Comments

@istudyatuni
Copy link
Contributor

istudyatuni commented Apr 8, 2022

Rust 1.59 introduced new feature - creating stripped binaries. Results for hello-world app (target x86_64-unknown-linux-gnu):

$ cargo build --release
   Compiling hello-world v0.1.0 (//hello-world)
    Finished release [optimized] target(s) in 0.94s
$ du -h target/release/hello-world
3.6M	target/release/hello-world
# enable here
$ cargo build --release           
   Compiling hello-world v0.1.0 (//hello-world)
    Finished release [optimized] target(s) in 0.29s
$ du -h target/release/hello-world
308K	target/release/hello-world

with stripping all symbol information:

[profile.release]
strip = true
@Samyak2 Samyak2 added enhancement New feature or request packaging Package manager repos, binary downloads, etc. labels Apr 8, 2022
@Samyak2
Copy link
Owner

Samyak2 commented Apr 8, 2022

TIL. This is nice.

Here are the sizes I got:

  • default: 4.4M
  • strip = "debuginfo": 1.3M
  • strip = "symbols" or strip = true: 1.1M

I think strip = "debuginfo" is a good middle ground. Some symbols might be needed for debugging crashes, etc.

@Samyak2
Copy link
Owner

Samyak2 commented Apr 8, 2022

Do you want to open a PR for this?

@istudyatuni
Copy link
Contributor Author

Sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request packaging Package manager repos, binary downloads, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants