Skip to content

Commit db0aa2e

Browse files
committed
fix: Use 'cross' for linux aarch64 cross-compilation to handle system deps
1 parent 52bb5ce commit db0aa2e

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,9 @@ jobs:
8989
clang \
9090
libclang-dev
9191
92-
- name: Install cross-compiler (Linux aarch64)
92+
- name: Install cross (Linux aarch64)
9393
if: matrix.target == 'aarch64-unknown-linux-gnu'
94-
run: |
95-
sudo apt-get install -y \
96-
gcc-aarch64-linux-gnu \
97-
libsasl2-dev:arm64 \
98-
libssl-dev:arm64 \
99-
libzstd-dev:arm64 \
100-
libcurl4-openssl-dev:arm64 || true
101-
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
94+
run: cargo install cross --git https://github.com/cross-rs/cross --locked
10295

10396
- name: Install dependencies (macOS)
10497
if: runner.os == 'macOS'
@@ -116,9 +109,14 @@ jobs:
116109
uses: Swatinem/rust-cache@v2
117110

118111
- name: Build release binary
119-
run: cargo build --release --locked --target ${{ matrix.target }}
112+
run: |
113+
if [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then
114+
cross build --release --locked --target ${{ matrix.target }}
115+
else
116+
cargo build --release --locked --target ${{ matrix.target }}
117+
fi
120118
121-
- name: Strip binary (Linux x86_64 and macOS)
119+
- name: Strip binary
122120
if: matrix.target != 'aarch64-unknown-linux-gnu'
123121
run: strip target/${{ matrix.target }}/release/streamforge
124122

0 commit comments

Comments
 (0)