cargo build --release
https://github.com/mozilla/application-services/blob/master/...I don't think Rust can replace C for CLI tools. It feels more like Java with these uber binaries.
cargo build --release
https://github.com/mozilla/application-services/blob/master/...I don't think Rust can replace C for CLI tools. It feels more like Java with these uber binaries.
They include debug info in release builds in their configuration.
If you run `strip` on the resulting binary, it will likely drop to like 5 MB.
I haven't checked too much into Rust but I seem to recall it could be dynamically compiled. I would imagine any OS base tools would be dynamically compiled anyways.
Though considering the lengths that package managers go to for dependency management, maybe static linking everything is not a bad idea after all, I don't mind a 10GB OS image on disk as long as it isn't actually wasting memory.
Ripgrep is one of the most popular Rust CLI tools. It has ~2MB binaries: https://github.com/BurntSushi/ripgrep/releases (except the windows GNU variant which is 8MB for some reason, but a ~2MB windows MSVC variant is available).
That's certainly a lot bigger than the ~50kb for my system's copy of grep. But it's also faster than grep for most use cases (see: https://blog.burntsushi.net/ripgrep/), and has better support for things like unicode. Seems like a pretty good trade-off to me.
Release just specified the profile and you can override settings if it in Cargo.toml, e.g. to include debug info into release builds it disable lto.
(Edit) which is done by the linked tool.