Skip to content

Commit

Permalink
Improve std feature flag in README and CI
Browse files Browse the repository at this point in the history
Sorry, my previous example was hardcoded for `std`, but in theory this flag could be used also for core/alloc, if some people want to only rebuild these libstd crates. Using just `optimize_for_size` should be more rgeneral.
  • Loading branch information
Kobzol committed Jun 16, 2024
1 parent 63a7b92 commit a37fa79
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 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 -Z build-std-features="std/optimize_for_size" --target x86_64-unknown-linux-gnu --release;
RUSTFLAGS="-Zlocation-detail=none" cargo +nightly build -Z build-std=std,panic_abort -Z build-std-features="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;
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ host: x86_64-apple-darwin
# Add the =std,panic_abort to the option to make panic = "abort" Cargo.toml option work.
# See: https://github.com/rust-lang/wg-cargo-std-aware/issues/56
$ RUSTFLAGS="-Zlocation-detail=none" cargo +nightly build -Z build-std=std,panic_abort \
-Z build-std-features="std/optimize_for_size" \
-Z build-std-features="optimize_for_size" \
--target x86_64-apple-darwin --release
```

Expand Down

0 comments on commit a37fa79

Please sign in to comment.