Automatically stripping binaries with `cargo install`

Hi all,

I've just set up a new Banana Pi and I need small binaries for various tools I use (such as ripgrep, fd, &c.). So far I've just called strip on them manually, but I was wondering if cargo could do this automatically (I haven't seen anything in --help and I couldn't find manpages...)

2 Likes

It's not possible at the moment AFAIK.

Known problem:

https://github.com/rust-lang/cargo/issues/545

I think this is not something that should require a build script, but rather an action cargo install should (probably?) always perform.

2 Likes

Yes, I agree. cabal-install has an option to strip binaries (which doesn't work but...). I think it would be a good feature since much Rust software is distributing via cargo install.