Skip to content

Commit

Permalink
feat: add thin build profile
Browse files Browse the repository at this point in the history
Signed-off-by: Antheas Kapenekakis <[email protected]>
  • Loading branch information
antheas authored and cgwalters committed Dec 2, 2024
1 parent b9360a9 commit cad773d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@ panic = "abort"
# We assume we're being delivered via e.g. RPM which supports split debuginfo
debug = true

[profile.thin]
# drop bootc size when split debuginfo is not available and go a step
# further in size optimization (when tested from 140mb, to 12mb without
# symbols/debuginfo, to 5.8mb with extra optimizations)
# https://github.com/johnthagen/min-sized-rust
# cargo build --profile=thin
inherits = "release"
debug = false # Re-strip debug symbols
strip = true # Strip symbols from binary
lto = true # Use full lto to remove dead code
opt-level = 's' # Optimize for size with vector vectorization
codegen-units = 1 # Reduce number of codegen units to increase optimizations

[profile.releaselto]
codegen-units = 1
inherits = "release"
Expand Down

0 comments on commit cad773d

Please sign in to comment.