Commit 56fa98e
committed
fix(ci): setup MSVC for x86 using vswhere + cmd activation for reliable 32-bit builds on windows-2025
The x86 job was failing at "Install dependencies" (uv sync --frozen --compile)
because packages like pyyaml and greenlet have no cp314-win32 wheels for
Python 3.14 and must be built from sdist. This requires the 32-bit MSVC
toolchain (cl.exe etc.) to be active in the environment.
Key problems with prior attempts:
- Hardcoded paths for "2022" broke because windows-2025 now uses VS 2026
(paths under Microsoft Visual Studio\18\...).
- ilammy/msvc-dev-cmd is Node 20-based and deprecated under Node 24 forcing.
- Env activation in pwsh steps did not reliably propagate to the uv build
step (GITHUB_ENV + process env issues for native extension builds).
Solution (standard pattern from MS docs, runner-images, and many C++/Python
extension projects on GitHub):
- Use vswhere.exe (official locator, handles any VS version/edition) to
dynamically find the installation.
- Activate with "amd64_x86" (correct cross for 64-host -> 32-target).
- Verify activation in Setup step logs (where cl + version).
- Export VCVARSALL path.
- For the critical "Install dependencies" step, use shell: cmd and directly
call "%VCVARSALL%" amd64_x86 right before "uv sync", with verification.
This ensures the compiler env is active in the exact context where sdist
builds happen.
Added verification print also in the install step for easier debugging.
This is the minimal, reliable change strictly for the x86 CI fix (no dep
changes elsewhere). All other actions remain pinned.1 parent 9ab8b45 commit 56fa98e
1 file changed
Lines changed: 50 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
47 | 86 | | |
48 | 87 | | |
49 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
50 | 99 | | |
51 | 100 | | |
52 | 101 | | |
| |||
0 commit comments