mirror of
https://github.com/rustfs/rustfs.git
synced 2026-01-17 01:30:33 +00:00
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:
6
.github/actions/setup/action.yml
vendored
6
.github/actions/setup/action.yml
vendored
@@ -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'
|
||||
|
||||
11
.github/workflows/build.yml
vendored
11
.github/workflows/build.yml
vendored
@@ -191,6 +191,17 @@ jobs:
|
||||
run: |
|
||||
# Use unified build script for consistent builds
|
||||
./build-rustfs.sh --platform ${{ matrix.target }}
|
||||
env:
|
||||
# Set environment variables for zstd-sys to avoid target parsing issues
|
||||
ZSTD_SYS_USE_PKG_CONFIG: 1
|
||||
PKG_CONFIG_ALLOW_CROSS: 1
|
||||
# For musl targets, use system zstd if available
|
||||
CC_x86_64_unknown_linux_musl: zig cc -target x86_64-linux-musl
|
||||
CXX_x86_64_unknown_linux_musl: zig c++ -target x86_64-linux-musl
|
||||
AR_x86_64_unknown_linux_musl: zig ar
|
||||
CC_aarch64_unknown_linux_musl: zig cc -target aarch64-linux-musl
|
||||
CXX_aarch64_unknown_linux_musl: zig c++ -target aarch64-linux-musl
|
||||
AR_aarch64_unknown_linux_musl: zig ar
|
||||
|
||||
- name: Create release package
|
||||
id: package
|
||||
|
||||
Reference in New Issue
Block a user