fix: resolve zstd-sys compilation issues with zig cross-compilation (#203)

- Update to mlugg/setup-zig@v2 for better stability and features
- Use Zig 0.13.0 for improved musl target support
- Add system zstd libraries (libzstd-dev, zstd) to Ubuntu dependencies
- Configure environment variables for zstd-sys to use pkg-config
- Enable pkg-config feature for zstd dependency to prefer system library
- Add proper C/C++ compiler configuration for musl targets

Fixes the 'error: unable to parse target query x86_64-unknown-linux-musl: UnknownOperatingSystem'
compilation error in zstd-sys during cross-compilation.
This commit is contained in:
安正超
2025-07-14 20:01:52 +08:00
committed by GitHub
parent 63b79ae151
commit ccad91a4a9
4 changed files with 33 additions and 3 deletions

View File

@@ -58,7 +58,9 @@ runs:
libwebkit2gtk-4.1-dev \
libxdo-dev \
pkg-config \
libssl-dev
libssl-dev \
libzstd-dev \
zstd
- name: Install protoc
uses: arduino/setup-protoc@v3
@@ -81,6 +83,8 @@ runs:
- name: Install Zig
if: inputs.install-cross-tools == 'true'
uses: mlugg/setup-zig@v2
with:
version: 0.13.0
- name: Install cargo-zigbuild
if: inputs.install-cross-tools == 'true'