Skip to content

Commit

Permalink
Run std/optimize_for_size in nightly CI (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnthagen authored Jun 14, 2024
1 parent c030adc commit ea5ab25
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,5 @@ jobs:
working-directory: ${{ matrix.project_dir }}
run: >
rustup component add rust-src;
RUSTFLAGS="-Zlocation-detail=none" cargo +nightly build -Z build-std=std,panic_abort --target x86_64-unknown-linux-gnu --release;
RUSTFLAGS="-Zlocation-detail=none" cargo +nightly build -Z build-std=std,panic_abort -Z build-std-features="std/optimize_for_size" --target x86_64-unknown-linux-gnu --release;
cargo +nightly build -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --target x86_64-unknown-linux-gnu --release;
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,11 @@ $ RUSTFLAGS="-Zlocation-detail=none" cargo +nightly build -Z build-std=std,panic
--target x86_64-apple-darwin --release
```

On macOS, the final stripped binary size is reduced to 51KB.
The `optimize_for_size` flag provides a hint to `libstd` that it should try to use algorithms
optimized for binary size. More information about it can be found in the
[tracking issue](https://github.com/rust-lang/rust/issues/125612).

The `optimize_for_size` flag provides a hint to libstd that it should try to use algorithms optimized
for binary size. More information about it can be found [here](https://github.com/rust-lang/rust/issues/125612).
On macOS, the final stripped binary size is reduced to 51KB.

# Remove `panic` String Formatting with `panic_immediate_abort`

Expand Down

0 comments on commit ea5ab25

Please sign in to comment.