File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,12 @@ jobs:
164164 Write-Output "PACKAGE_VERSION=None" >> "$env:GITHUB_OUTPUT"
165165 }
166166
167+ # Pin VS build tools to 17.9 for wider compat
168+
169+ - name : Install VS2022 BuildTools 17.9.7
170+ run : choco install -y visualstudio2022buildtools --version=117.9.7.0 --params "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --installChannelUri https://aka.ms/vs/17/release/180911598_-255012421/channel"
171+ if : runner.os == 'Windows'
172+
167173 # Install uv for easier python setup
168174 - name : Install the latest version of uv and set the python version
169175 uses : astral-sh/setup-uv@v5
@@ -267,6 +273,13 @@ jobs:
267273 - name : Build for CUDA
268274 if : matrix.cuda != ''
269275 run : |
276+ # --- Spawn the VS shell
277+ if ($IsWindows) {
278+ Import-Module 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll'
279+ Enter-VsDevShell -VsInstallPath 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools' -DevCmdArguments '-arch=x64 -host_arch=x64'
280+ $env:DISTUTILS_USE_SDK=1
281+ }
282+
270283 # --- Build wheel
271284 $BUILDTAG = "+cu${{ steps.cuda_deps.outputs.CUDA_VERSION_PYTORCH }}-torch${{ matrix.torch }}"
272285 $env:BUILD_TARGET = "cuda"
Original file line number Diff line number Diff line change @@ -164,6 +164,12 @@ jobs:
164164 Write-Output "PACKAGE_VERSION=None" >> "$env:GITHUB_OUTPUT"
165165 }
166166
167+ # Pin VS build tools to 17.9 for wider compat
168+
169+ - name : Install VS2022 BuildTools 17.9.7
170+ run : choco install -y visualstudio2022buildtools --version=117.9.7.0 --params "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --installChannelUri https://aka.ms/vs/17/release/180911598_-255012421/channel"
171+ if : runner.os == 'Windows'
172+
167173 # Install uv for easier python setup
168174 - name : Install the latest version of uv and set the python version
169175 uses : astral-sh/setup-uv@v5
@@ -267,6 +273,13 @@ jobs:
267273 - name : Build for CUDA
268274 if : matrix.cuda != ''
269275 run : |
276+ # --- Spawn the VS shell
277+ if ($IsWindows) {
278+ Import-Module 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll'
279+ Enter-VsDevShell -VsInstallPath 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools' -DevCmdArguments '-arch=x64 -host_arch=x64'
280+ $env:DISTUTILS_USE_SDK=1
281+ }
282+
270283 # --- Build wheel
271284 $BUILDTAG = "+cu${{ steps.cuda_deps.outputs.CUDA_VERSION_PYTORCH }}-torch${{ matrix.torch }}"
272285 $env:BUILD_TARGET = "cuda"
You can’t perform that action at this time.
0 commit comments