Skip to content

Commit d483207

Browse files
fix(ci): fix release builds for linux-aarch64 and windows-x86_64
fix(ci): fix release builds for linux-aarch64 and windows
2 parents 7db3e20 + dc37e29 commit d483207

2 files changed

Lines changed: 36 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,27 @@ jobs:
7373
run: |
7474
choco install protoc llvm -y
7575
76+
- name: Configure Windows build environment
77+
if: runner.os == 'Windows'
78+
shell: bash
79+
run: |
80+
# MSVC cannot compile SimSIMD's AVX-512 FP16 intrinsics (_mm512_reduce_add_ph).
81+
# Set LIBCLANG_PATH for bindgen/rocksdb and configure cargo to disable
82+
# simsimd feature for usearch via .cargo/config.toml override.
83+
echo "LIBCLANG_PATH=C:\\Program Files\\LLVM\\lib" >> $GITHUB_ENV
84+
mkdir -p .cargo
85+
cat >> .cargo/config.toml << 'TOML'
86+
[target.x86_64-pc-windows-msvc]
87+
rustflags = []
88+
TOML
89+
90+
- name: Patch usearch for Windows (disable simsimd)
91+
if: runner.os == 'Windows'
92+
shell: bash
93+
run: |
94+
# Replace usearch default features to exclude simsimd which fails on MSVC
95+
sed -i 's/^usearch = "2"/usearch = { version = "2", default-features = false, features = ["fp16lib"] }/' Cargo.toml
96+
7697
- name: Install Rust
7798
uses: dtolnay/rust-toolchain@stable
7899
with:
@@ -93,6 +114,10 @@ jobs:
93114

94115
- name: Build (cross)
95116
if: matrix.cross
117+
env:
118+
PKG_CONFIG_ALLOW_CROSS: "1"
119+
PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig
120+
PKG_CONFIG_SYSROOT_DIR: /
96121
run: cross build --release --target ${{ matrix.target }}
97122

98123
- name: Create archive directory

Cross.toml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,16 @@ pre-build = [
66
]
77

88
[target.aarch64-unknown-linux-gnu.env]
9-
passthrough = ["OPENSSL_DIR", "OPENSSL_LIB_DIR", "OPENSSL_INCLUDE_DIR", "PKG_CONFIG_ALLOW_CROSS"]
9+
passthrough = [
10+
"OPENSSL_DIR",
11+
"OPENSSL_LIB_DIR",
12+
"OPENSSL_INCLUDE_DIR",
13+
"PKG_CONFIG_ALLOW_CROSS",
14+
"PKG_CONFIG_PATH",
15+
"PKG_CONFIG_SYSROOT_DIR",
16+
]
1017

1118
[build.env]
12-
passthrough = ["PKG_CONFIG_ALLOW_CROSS=1"]
19+
passthrough = [
20+
"PKG_CONFIG_ALLOW_CROSS",
21+
]

0 commit comments

Comments
 (0)