Skip to content

Commit 2443990

Browse files
BoPengclaude
andcommitted
Use static zlib on Windows to fix DLL loading issue
vcpkg's default shared zlib causes DLL load failures at runtime. Using x64-windows-static triplet to statically link zlib. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 85aeb45 commit 2443990

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

.github/workflows/python-app.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ jobs:
146146
- name: Install SWIG
147147
run: choco install swig -y
148148

149-
- name: Install zlib via vcpkg
149+
- name: Install zlib via vcpkg (static)
150150
run: |
151-
vcpkg install zlib:x64-windows
151+
vcpkg install zlib:x64-windows-static
152152
153153
- name: Install Python dependencies
154154
run: |
@@ -159,7 +159,7 @@ jobs:
159159
- name: Build and install simuPOP
160160
run: |
161161
$toolchain = "$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake"
162-
pip install -v . --config-settings=cmake.args="-DCMAKE_TOOLCHAIN_FILE=$toolchain"
162+
pip install -v . --config-settings=cmake.args="-DCMAKE_TOOLCHAIN_FILE=$toolchain;-DVCPKG_TARGET_TRIPLET=x64-windows-static"
163163
164164
- name: Run tests (short allele type)
165165
run: python ./test/run_tests.py short -j2

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ jobs:
161161
with:
162162
python-version: "3.11"
163163

164-
- name: Install zlib via vcpkg
165-
run: vcpkg install zlib:x64-windows
164+
- name: Install zlib via vcpkg (static)
165+
run: vcpkg install zlib:x64-windows-static
166166

167167
- name: Install cibuildwheel
168168
run: pip install cibuildwheel
@@ -172,7 +172,7 @@ jobs:
172172
env:
173173
CIBW_BUILD: "cp39-win_amd64 cp310-win_amd64 cp311-win_amd64 cp312-win_amd64 cp313-win_amd64"
174174
CIBW_BEFORE_BUILD: pip install scikit-build-core cmake ninja swig
175-
CIBW_ENVIRONMENT: CMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
175+
CIBW_ENVIRONMENT: CMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" CMAKE_ARGS="-DVCPKG_TARGET_TRIPLET=x64-windows-static"
176176
CIBW_TEST_COMMAND: python -c "import simuPOP; print(simuPOP.moduleInfo())"
177177

178178
- name: Upload wheels

0 commit comments

Comments
 (0)