NLnetLabs / krill

RPKI Certificate Authority and Publication Server written in Rust
https://nlnetlabs.nl/projects/routing/krill/
Mozilla Public License 2.0
294 stars 42 forks source link

Use new Rustc/Cargo 1.58.0 strip feature in the `pkg` build #756

Open ximon18 opened 2 years ago

ximon18 commented 2 years ago

Currently the pkg build manually invokes strip on built binaries. However the pkg build uses latest stable Rust and Rust 1.58.0 released two days from now will bring with it the new support for specifying binary stripping in the [profile.release] section of Cargo.toml. Using this will be less custom and hopefully will also be supported by cargo cross cross-compiled builds which otherwise require manually specifying the right strip tool to use.

ximon18 commented 2 years ago

Update: In a quick local test using cross build the resulting binary was significantly smaller when built with cross +nightly build and the following addition to Cargo.toml (26233520 bytes for krill vs 34970356 bytes):

[profile.release]
panic = "abort"
+strip = "symbols"
ximon18 commented 2 years ago

This will not actually be available via Cargo in 1.58.0, rather in the next release. See https://github.com/rust-lang/rust/issues/72110#issuecomment-1012428365.