Skip to content

Commit 641bc54

Browse files
fix(ci): fix release builds for linux-aarch64 and windows-x86_64
linux-aarch64: Install protoc v25.1 binary in Cross.toml pre-build (apt protobuf-compiler is too old for proto3 optional labels). Pass PROTOC env var through to cross container. windows-x86_64: Set CFLAGS=/MD and CXXFLAGS=/MD to force dynamic CRT linkage for all C/C++ dependencies. Fixes LNK2038 mismatch between esaxx-rs (/MT static) and cxx (/MD dynamic). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent cd5a6e4 commit 641bc54

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ jobs:
7878
shell: bash
7979
run: |
8080
echo "LIBCLANG_PATH=C:\\Program Files\\LLVM\\lib" >> $GITHUB_ENV
81+
# Force dynamic CRT (/MD) for all C/C++ deps to prevent LNK2038 mismatch
82+
# (esaxx-rs defaults to /MT which conflicts with cxx's /MD)
83+
echo "CFLAGS=/MD" >> $GITHUB_ENV
84+
echo "CXXFLAGS=/MD" >> $GITHUB_ENV
8185
8286
- name: Disable usearch simsimd for cross-compile targets
8387
if: matrix.cross || runner.os == 'Windows'
@@ -112,6 +116,7 @@ jobs:
112116
PKG_CONFIG_ALLOW_CROSS: "1"
113117
PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig
114118
PKG_CONFIG_SYSROOT_DIR: /
119+
PROTOC: /usr/local/bin/protoc
115120
run: cross build --release --target ${{ matrix.target }}
116121

117122
- name: Create archive directory

Cross.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
pre-build = [
33
"dpkg --add-architecture arm64",
44
"apt-get update",
5-
"apt-get install -y protobuf-compiler libclang-dev libssl-dev:arm64 pkg-config"
5+
"apt-get install -y libclang-dev libssl-dev:arm64 pkg-config curl unzip",
6+
"curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v25.1/protoc-25.1-linux-x86_64.zip && unzip protoc-25.1-linux-x86_64.zip -d /usr/local && rm protoc-25.1-linux-x86_64.zip"
67
]
78

89
[target.aarch64-unknown-linux-gnu.env]
@@ -13,6 +14,7 @@ passthrough = [
1314
"PKG_CONFIG_ALLOW_CROSS",
1415
"PKG_CONFIG_PATH",
1516
"PKG_CONFIG_SYSROOT_DIR",
17+
"PROTOC",
1618
]
1719

1820
[build.env]

0 commit comments

Comments
 (0)