From 6258175c5e02a0c8cc4db4e5d170c8410387ac31 Mon Sep 17 00:00:00 2001 From: Rodolphe Breard Date: Tue, 23 Apr 2019 23:37:35 +0200 Subject: [PATCH] Reduce the executable size In release mode, the executable size should be kept to the bare minimum in order to be used in environments with low storage and reduce the data consumption when pre-built packages are downloaded. Because performance is absolutely not needed, it allows to a quite aggressive compiling strategy (opt-level = 'z'). https://doc.rust-lang.org/cargo/reference/manifest.html#the-profile-sections Fixes #1 --- Cargo.toml | 6 ++++++ README.md | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index cc2b731..34b2972 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,3 +2,9 @@ members = [ "acmed", ] + +[profile.release] +opt-level = 'z' +lto = 'thin' +codegen-units = 1 +panic = 'abort' diff --git a/README.md b/README.md index df48dbc..c5398fa 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ In order to compile ADMEd, you will need the [Rust](https://www.rust-lang.org/) ACMEd depends on the OpenSSL. The minimal supported versions are those from the [openssl](https://docs.rs/openssl/) crate, currently OpenSSL 1.0.1 through 1.1.1 and LibreSSL 2.5 through 2.8. ``` -cargo build --release +cargo build --release && strip target/release/acmed ``` The executable is located in `target/release/acmed`.