Skip to content

Commit a995e7d

Browse files
committed
fix(ci): setup MSVC for x86 to fix dependency builds
The x86 (32-bit) build job was failing at "Install dependencies" (uv sync --frozen --compile) because no cp314-win32 wheels exist for packages like pyyaml/greenlet; they build from sdist and need the 32-bit MSVC C toolchain on the 64-bit windows-2025 runner. - The initial attempt used ilammy/msvc-dev-cmd (Node 20). It produced deprecation warnings under Node 24 forcing and did not reliably activate the env. - The first inline version (pwsh + vswhere + cmd child) did not make the compiler visible to the subsequent uv step. Replaced with a minimal native approach that is widely proven: - shell: cmd step (avoids Node and pwsh quoting entirely) - Direct call ...\\vcvarsall.bat amd64_x86 using the documented path for the windows-2025 image (Visual Studio Enterprise 2022). - set >> %GITHUB_ENV% to propagate PATH/INCLUDE/LIB etc. - Added where cl + version check so the activation is visible in logs for the Setup step. Uses �md64_x86 (64-bit hosted tools targeting x86) which matches how the VS components are installed on the runner and is the common pattern for 32-bit extension builds on 64-bit CI hosts. Keeps the change strictly to the CI x86 fix. No dep changes.
1 parent 2b8fbfa commit a995e7d

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

.github/workflows/build_app.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,31 @@ jobs:
4444
with:
4545
python-version: 'cpython-3.14-windows-${{ matrix.arch }}-none'
4646
working-directory: ${{ github.workspace }}/repo
47+
- name: Setup MSVC for x86
48+
if: matrix.arch == 'x86'
49+
shell: cmd
50+
run: |
51+
@echo off
52+
setlocal
53+
set "VCVARS="
54+
echo Looking for vcvarsall.bat...
55+
for /f "delims=" %%f in ('dir /s /b "C:\Program Files*\Microsoft Visual Studio\2022\*\VC\Auxiliary\Build\vcvarsall.bat" 2^>nul') do (
56+
set "VCVARS=%%f"
57+
goto :found
58+
)
59+
:found
60+
if not defined VCVARS (
61+
echo ERROR: vcvarsall.bat not found anywhere under VS 2022
62+
dir "C:\Program Files*\Microsoft Visual Studio\2022" 2>&1 | findstr /i "Enterprise Community Professional BuildTools" || echo (no editions visible)
63+
exit /b 1
64+
)
65+
echo Using: %VCVARS%
66+
call "%VCVARS%" amd64_x86
67+
echo === Verifying 32-bit MSVC toolchain (for uv sdist builds) ===
68+
where cl
69+
cl 2>&1 | findstr /C:"Version" || echo (no version banner)
70+
echo ============================================================
71+
set >> %GITHUB_ENV%
4772
- name: Install dependencies
4873
working-directory: ${{ github.workspace }}/repo
4974
run: uv sync --frozen --compile --group build --group test

0 commit comments

Comments
 (0)