Automatically stripping binaries with `cargo install`


#1

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

It’s not possible at the moment AFAIK.


#3

Known problem:


#4

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


#5

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.