Skip to content

Commit b1dbcd7

Browse files
committed
release: Enable build-std, panic_immediate_abort, etc.
Significantly reduces the size of the released binary.
1 parent c1af1c9 commit b1dbcd7

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
with:
5151
target: ${{ matrix.target }}
5252
profile: minimal
53+
components: rust-src
5354

5455
- name: Install additional toolchains
5556
if: ${{ matrix.os == 'ubuntu-latest' && matrix.extra_toolchain != '' }}
@@ -70,7 +71,11 @@ jobs:
7071
uses: actions-rs/cargo@v1
7172
with:
7273
command: build
73-
args: --target ${{ matrix.target }} --release
74+
args: >-
75+
--target ${{ matrix.target }}
76+
--release
77+
-Z build-std=std,panic_abort
78+
-Z build-std-features=panic_immediate_abort
7479
7580
- name: Strip binary
7681
run: |

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## v0.6.0 (unreleased)
44

5-
- Reduce binary size by over 70%.
5+
- Reduce binary size significantly.
66

77
## v0.5.4 (2022-08-30)
88

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ rstest = "0.15.0"
2626

2727
[profile.release]
2828
lto = true
29+
panic = "abort"
30+
opt-level = "z"
2931

3032
[workspace]
3133
members = [".", "./testtools"]

0 commit comments

Comments
 (0)