From c52fc52d23647992474ebc1950cb1327d27a6911 Mon Sep 17 00:00:00 2001 From: VC Date: Tue, 20 Apr 2021 11:38:50 +0200 Subject: [PATCH] Optimizing size of the final executable --- .gitlab-ci.yml | 5 ++--- Cargo.toml | 9 ++++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9cd248c..dec236c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,10 +3,9 @@ stages: rust-latest: stage: build + artifacts: + - target/release/scootaloo image: rust:latest script: - - cargo build --verbose - cargo build --release --verbose - - strip target/release/${CI_PROJECT_NAME} - - du -h target/release/${CI_PROJECT_NAME} diff --git a/Cargo.toml b/Cargo.toml index 21850ce..58954d4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "scootaloo" -version = "0.3.2" +version = "0.3.3" authors = ["VC "] edition = "2018" @@ -17,3 +17,10 @@ reqwest = "^0.11" htmlescape = "^0.3" log = "^0.4" simple_logger = "^1.11" + +[profile.release] +opt-level = 's' # Optimize for size. +lto = true # Link Time Optimization (LTO) +codegen-units = 1 # Set this to 1 to allow for maximum size reduction optimizations: +panic = 'abort' # removes the need for this extra unwinding code. +