mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-23 05:58:42 +00:00
Use build-std
feature for release build to reduce binary size
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
ac995798ef
commit
98d8a96a02
2 changed files with 7 additions and 2 deletions
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
|
@ -105,7 +105,7 @@ jobs:
|
|||
run: sudo ./ci-scripts/install-deps.sh
|
||||
|
||||
- name: Build
|
||||
run: ${{ env.CTOOL }} build ${{ env.CARGS }}
|
||||
run: ${{ env.CTOOL }} ${{ env.TOOLCHAIN }} build ${{ env.CARGS }}
|
||||
|
||||
- name: Get output
|
||||
shell: bash
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
if $for_release then {
|
||||
output: "release",
|
||||
toolchain: "+nightly",
|
||||
profile: "release",
|
||||
args: ($matrix.release_build_args // ""),
|
||||
# Use build-std to build a std library optimized for size and abort immediately on abort,
|
||||
# so that format string for `unwrap`/`expect`/`unreachable`/`panic` can be optimized out.
|
||||
args: ($matrix.release_build_args // "-Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort"),
|
||||
features: ($matrix.release_features // []),
|
||||
} else {
|
||||
output: "debug",
|
||||
toolchain: "+stable",
|
||||
profile: "dev",
|
||||
args: ($matrix.debug_build_args // ""),
|
||||
features: ($matrix.debug_features // ["rustls", "fancy-with-backtrace"]),
|
||||
|
@ -19,6 +23,7 @@ if $for_release then {
|
|||
{
|
||||
CBIN: (if ($matrix.target | test("windows")) then "cargo-binstall.exe" else "cargo-binstall" end),
|
||||
CTOOL: (if ($matrix."use-cross" // false) then "cross" else "cargo" end),
|
||||
TOOLCHAIN: .toolchain,
|
||||
COUTPUT: .output,
|
||||
CARGS: "--target \($matrix.target) --profile \(.profile) \(.features) \(.args)",
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue