mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-20 20:48:43 +00:00
Fix release build: Set RUSTFLAGS
to link with libgcc statically
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
af3b87df7a
commit
9e5ff25be8
2 changed files with 10 additions and 0 deletions
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
|
@ -110,6 +110,8 @@ jobs:
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: ${{ env.CTOOL }} build ${{ env.CARGS }}
|
run: ${{ env.CTOOL }} build ${{ env.CARGS }}
|
||||||
|
env:
|
||||||
|
RUSTFLAGS: ${{ env.RUSTFLAGS }}
|
||||||
|
|
||||||
- name: Get output
|
- name: Get output
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
|
@ -9,9 +9,16 @@ if $for_release then {
|
||||||
output: "debug",
|
output: "debug",
|
||||||
profile: "dev",
|
profile: "dev",
|
||||||
args: ($matrix.debug_build_args // ""),
|
args: ($matrix.debug_build_args // ""),
|
||||||
|
rustflags: "",
|
||||||
features: ($matrix.debug_features // ["rustls", "fancy-with-backtrace"]),
|
features: ($matrix.debug_features // ["rustls", "fancy-with-backtrace"]),
|
||||||
} end
|
} end
|
||||||
|
|
|
|
||||||
|
.rustflags = (
|
||||||
|
if $for_release and $matrix.target == "aarch64-unknown-linux-musl" or $matrix.target == "armv7-unknown-linux-musleabihf"
|
||||||
|
then "-C link-arg=-lgcc -Clink-arg=-static-libgcc"
|
||||||
|
else "" end
|
||||||
|
)
|
||||||
|
|
|
||||||
.features = (
|
.features = (
|
||||||
if (.features | length > 0)
|
if (.features | length > 0)
|
||||||
then "--no-default-features --features \(.features | join(","))"
|
then "--no-default-features --features \(.features | join(","))"
|
||||||
|
@ -23,6 +30,7 @@ if $for_release then {
|
||||||
CTOOL: (if ($matrix."use-cross" // false) then "cross" else "cargo" end),
|
CTOOL: (if ($matrix."use-cross" // false) then "cross" else "cargo" end),
|
||||||
COUTPUT: .output,
|
COUTPUT: .output,
|
||||||
CARGS: "--target \($matrix.target) --profile \(.profile) \(.features) \(.args)",
|
CARGS: "--target \($matrix.target) --profile \(.profile) \(.features) \(.args)",
|
||||||
|
RUSTFLAGS: .rustflags,
|
||||||
}
|
}
|
||||||
|
|
|
|
||||||
to_entries[] | "\(.key)=\(.value)"
|
to_entries[] | "\(.key)=\(.value)"
|
||||||
|
|
Loading…
Add table
Reference in a new issue