-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
ripgrep binaries are an order of magnitude larger than they need to be #413
Description
This discussion started in #412.
The problem is that when you compile ripgrep today, you get big binaries. Both the cargo install approach and installing Linux binaries from the Github releases yield large binaries.
To address the inconsistency concern in the abstract: there are many inconsistencies between the ripgrep releases and what's installed with cargo install, and these inconsistencies will always be there. For example, cargo install doesn't provide easy access to a man page, license info or to the various auto-completion scripts. So the fact that there is yet another inconsistency doesn't really bother me. Namely, cargo install is not the recommended way to install ripgrep, so I'm less sympathetic to issues that people have using it. It's provided on a best effort basis because it's occasionally convenient for folks who are otherwise Rust programmers.
Secondly, I will describe why I have debug = true for release builds. Perhaps there is some other solution that I haven't thought of.
There are two primary benefits I perceived when setting debug = true:
- A large fraction of time I spend developing ripgrep is with it compiled in release mode because I want to inspect its runtime performance. Release mode by default doesn't include debug symbols, so this makes profiling harder. If
debug = falsewere committed to source control, then I would have to constantly be changing around that value in theCargo.tomlduring development, which is a huge pain. I don't want to do it. - If and when ripgrep panics and the bug is hard to reproduce, the reporter can set
RUST_BACKTRACE=1on some systems and get a useful stack trace if and only if debug symbols are in the binary.
(2) is interesting, because ripgrep hardly ever panics, so it actually has not turned out to be as useful as I would have thought. In the case where it does happen, we could ask the user to compile ripgrep on their own---which is probably what most projects do---but I had wanted to make it as effortless as possible to report a bug. Nevertheless, since it rarely happens, it seems weird to optimize for that case.
With all that said, it seems like this is an argument in favor of stripping debug info from the binaries released in Github, but to retain the debug = true in Cargo.toml. Is there another solution? Can Cargo's config do something to help me out here?