Skip to content

Commit b118bfc

Browse files
kkraus14cursoragent
andcommitted
Fix Windows link.exe: prepend MSVC bin dir to PATH via GHA expression
Use ${{ env.VCToolsInstallDir }} (resolved at YAML parse time) instead of $VCToolsInstallDir (cibuildwheel runtime expansion, which silently failed). This prepends the MSVC bin dir to PATH so link.exe resolves to MSVC's linker instead of Git's /usr/bin/link.exe. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent e56e2dd commit b118bfc

1 file changed

Lines changed: 3 additions & 14 deletions

File tree

.github/workflows/build-wheel.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,7 @@ jobs:
182182
CIBW_ENVIRONMENT_WINDOWS: >
183183
CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})"
184184
CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }}
185-
# Git ships /usr/bin/link.exe (POSIX hardlink tool) which shadows
186-
# MSVC's linker when DISTUTILS_USE_SDK=1 skips vcvarsall.bat.
187-
CIBW_BEFORE_BUILD_WINDOWS: >
188-
pip install delvewheel &&
189-
if exist "C:\Program Files\Git\usr\bin\link.exe"
190-
(rename "C:\Program Files\Git\usr\bin\link.exe" link.exe.bak)
185+
PATH="${{ env.VCToolsInstallDir }}bin/Hostx64/x64;$PATH"
191186
# check cache stats before leaving cibuildwheel
192187
CIBW_BEFORE_TEST_LINUX: >
193188
"/host/${{ env.SCCACHE_PATH }}" --show-stats
@@ -248,10 +243,7 @@ jobs:
248243
CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }}
249244
CUDA_CORE_BUILD_MAJOR=${{ env.BUILD_CUDA_MAJOR }}
250245
PIP_FIND_LINKS="$(cygpath -w ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }})"
251-
CIBW_BEFORE_BUILD_WINDOWS: >
252-
pip install delvewheel &&
253-
if exist "C:\Program Files\Git\usr\bin\link.exe"
254-
(rename "C:\Program Files\Git\usr\bin\link.exe" link.exe.bak)
246+
PATH="${{ env.VCToolsInstallDir }}bin/Hostx64/x64;$PATH"
255247
# check cache stats before leaving cibuildwheel
256248
CIBW_BEFORE_TEST_LINUX: >
257249
"/host${{ env.SCCACHE_PATH }}" --show-stats
@@ -450,10 +442,7 @@ jobs:
450442
CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }}
451443
CUDA_CORE_BUILD_MAJOR=${{ env.BUILD_PREV_CUDA_MAJOR }}
452444
PIP_FIND_LINKS="$(cygpath -w ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }})"
453-
CIBW_BEFORE_BUILD_WINDOWS: >
454-
pip install delvewheel &&
455-
if exist "C:\Program Files\Git\usr\bin\link.exe"
456-
(rename "C:\Program Files\Git\usr\bin\link.exe" link.exe.bak)
445+
PATH="${{ env.VCToolsInstallDir }}bin/Hostx64/x64;$PATH"
457446
# check cache stats before leaving cibuildwheel
458447
CIBW_BEFORE_TEST_LINUX: >
459448
"/host${{ env.SCCACHE_PATH }}" --show-stats

0 commit comments

Comments
 (0)