Skip to content

Commit 51cdfb6

Browse files
Technologicatclaude
andcommitted
CI: diagnose Windows DLL-load failure in simple extension
First Windows CI run failed uniformly across all four Python versions with `ImportError: DLL load failed while importing simple`. `defs` loaded fine on the same runner — the extension that fails is the first one in the import chain that uses OpenMP (`cimport openmp` + `prange`). Strong signal that `vcomp*.dll` cannot be found on Windows' loader search path even though GitHub runners ship it in System32 (Python 3.8+ tightened loader search rules; System32 is not always consulted for module imports). Rather than guessing and iterating, add a Windows-only diagnostic step that: - reports the Python version and prefix, - tries to load vcomp140 / vcomp140d / vcruntime140 / msvcp140 via ctypes.CDLL so we know which ones are actually resolvable, - runs `dumpbin /DEPENDENTS` on every built .pyd so the CI log lists the delay-load dependencies we need to get on PATH, - runs `python -v` importing `wlsqm.fitter.defs` then `simple` and filters the trace for DLL / OpenMP lines so the error is visible without drowning in loader noise. The step is `continue-on-error: true` so it never fails the job on its own; its only purpose is to give the follow-up commit a precise target. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent da7965f commit 51cdfb6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,22 @@ jobs:
6969
- name: Install wlsqm
7070
run: pip install --no-build-isolation -e .
7171

72+
# Diagnose Windows DLL-load failures: if importing simple fails, most
73+
# of the time it is vcomp*.dll (MSVC OpenMP runtime) that cannot be
74+
# found on the DLL search path. This step probes it explicitly and
75+
# dumps the DELAY-LOAD dependencies of simple.pyd so the CI log
76+
# pinpoints the missing dependency on the first try.
77+
- name: Diagnose extension DLL dependencies (Windows)
78+
if: runner.os == 'Windows'
79+
shell: pwsh
80+
run: |
81+
python -c "import sys; print('python:', sys.version); print('prefix:', sys.prefix)"
82+
python -c "import ctypes; [ctypes.CDLL(name) and print(name, 'OK') for name in ('vcomp140.dll', 'vcomp140d.dll', 'vcruntime140.dll', 'msvcp140.dll')]" 2>&1 | Tee-Object -Append -FilePath dll-probe.log
83+
Get-ChildItem -Recurse -Filter '*.pyd' wlsqm | ForEach-Object { "=== $($_.FullName) ==="; dumpbin /DEPENDENTS $_.FullName 2>&1 }
84+
python -v -c "import wlsqm.fitter.defs" 2>&1 | Select-String -Pattern 'simple|defs|infra|omp|vcomp' | Select-Object -First 40
85+
python -v -c "from wlsqm.fitter import simple" 2>&1 | Select-String -Pattern 'simple|omp|vcomp|DLL' | Select-Object -First 60 || $true
86+
continue-on-error: true
87+
7288
- name: Run tests
7389
run: pytest tests/ -v
7490

0 commit comments

Comments
 (0)