From ecc5769c6469d1204972a71fa2b90027e3b43c7e Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Wed, 20 Sep 2023 15:16:42 -0400 Subject: [PATCH] fix: restore static binary builds Signed-off-by: Chris Gianelloni --- .github/workflows/release.yml | 11 +++++++++++ .github/workflows/tests.yml | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0e41de94..e4299bd5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -90,12 +90,23 @@ jobs: echo "SDKROOT=$(xcrun -sdk macosx --show-sdk-path)" >> $GITHUB_ENV echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version)" >> $GITHUB_ENV + - name: Linux AMD setup + if: ${{ matrix.job.target == 'x86_64-unknown-linux-gnu' }} + run: | + echo "RUSTFLAGS=-C target-feature=+crt-static" >> $GITHUB_ENV + - name: Linux ARM setup if: ${{ matrix.job.target == 'aarch64-unknown-linux-gnu' }} run: | sudo apt-get update -y sudo apt-get install -y gcc-aarch64-linux-gnu libssl-dev:armhf echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV + echo "RUSTFLAGS=-C target-feature=+crt-static" >> $GITHUB_ENV + + - name: Windows setup + if: ${{ matrix.job.os == 'windows-latest' }} + run: | + echo "RUSTFLAGS=-C target-feature=+crt-static" >> $GITHUB_ENV - name: Build binaries uses: actions-rs/cargo@v1 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cdc1776c..1341b67b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,7 +15,9 @@ jobs: steps: - uses: actions/checkout@v3 - name: Build - run: cargo build --verbose --workspace + run: cargo build --verbose --workspace --target x86_64-unknown-linux-gnu + env: + RUSTFLAGS: -C target-feature=+crt-static - name: Run unit tests run: cargo test --verbose --workspace - name: Run examples