Skip to content

Commit ea5ab25

Browse files
authored
Run std/optimize_for_size in nightly CI (#65)
1 parent c030adc commit ea5ab25

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,5 @@ jobs:
7575
working-directory: ${{ matrix.project_dir }}
7676
run: >
7777
rustup component add rust-src;
78-
RUSTFLAGS="-Zlocation-detail=none" cargo +nightly build -Z build-std=std,panic_abort --target x86_64-unknown-linux-gnu --release;
78+
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;
7979
cargo +nightly build -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --target x86_64-unknown-linux-gnu --release;

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,11 @@ $ RUSTFLAGS="-Zlocation-detail=none" cargo +nightly build -Z build-std=std,panic
209209
--target x86_64-apple-darwin --release
210210
```
211211

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

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

217218
# Remove `panic` String Formatting with `panic_immediate_abort`
218219

0 commit comments

Comments
 (0)