Skip to content

Commit

Permalink
Make binary smaller by rebuilding std with -Oz and panic_abort (#28)
Browse files Browse the repository at this point in the history
* Update to nushell 0.98.0
* Use nightly +Z flags to reduce binary size
  • Loading branch information
domsleee authored Sep 26, 2024
1 parent 43dcb25 commit 5695214
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 110 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,16 @@ jobs:
uses: actions-rust-lang/setup-rust-toolchain@v1.9.0
with:
target: ${{ matrix.target }}
toolchain: nightly-2024-05-16

- name: Install cargo-src
run: |
rustup target add ${{ matrix.target }}
rustup component add rust-src --target ${{ matrix.target }}
- name: Build binary
run: cargo build --release --locked --target=${{ matrix.target }} --color=always
# use optimize_for_size in the future (https://github.com/rust-lang/rust/issues/125612)
run: cargo build --release -Z build-std=core,std,alloc,proc_macro,panic_abort -Z build-std-features=panic_immediate_abort --locked --target=${{ matrix.target }} --color=always

- name: Install cargo-deb
if: ${{ matrix.deb == true }}
Expand Down
Loading

0 comments on commit 5695214

Please sign in to comment.