Skip to content

Commit cf61959

Browse files
committed
update release rules
1 parent b50eb20 commit cf61959

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

.cargo/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ rustflags = [
1010
# We can guarantee that this target will always run on a CPU with _at least_
1111
# these capabilities, so let's optimize for them
1212
"-Ctarget-cpu=apple-m1"
13-
]
13+
]

Cargo.toml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,13 @@ memmap2 = "0.9.5"
7777
url = "2.5.4"
7878

7979
[profile.release]
80-
lto = true
81-
strip = true
82-
debug = "limited"
83-
codegen-units = 1
84-
incremental = false
80+
codegen-units = 1 # reduces binary size by ~2%
81+
debug = "full" # No one needs an undebuggable release binary
82+
lto = true # reduces binary size by ~14%
83+
opt-level = "s" # reduces binary size by ~25%
84+
panic = "abort" # reduces binary size by ~50% in combination with -Zbuild-std-features=panic_immediate_abort
85+
split-debuginfo = "packed" # generates a separate *.dwp/*.dSYM so the binary can get stripped
86+
strip = "symbols" # See split-debuginfo - allows us to drop the size by ~65%
8587

8688
[profile.dev]
8789
split-debuginfo = "unpacked"

0 commit comments

Comments
 (0)