Skip to content

ci: locate Visual Studio with vswhere in the MSVC CUDA setup#797

Open
zkasuran wants to merge 1 commit into
QuEST-Kit:develfrom
zkasuran:ci-fix-msvc-cuda-vs-path
Open

ci: locate Visual Studio with vswhere in the MSVC CUDA setup#797
zkasuran wants to merge 1 commit into
QuEST-Kit:develfrom
zkasuran:ci-fix-msvc-cuda-vs-path

Conversation

@zkasuran

Copy link
Copy Markdown

What

The Windows + CUDA CI jobs fail in the "Setup CUDA (MSVC)" step. setup_cuda.ps1 copies the CUDA MSBuild integration into Visual Studio's BuildCustomizations folder, found by globbing a hard-coded C:\Program Files\Microsoft Visual Studio\2022\* path. That path no longer exists on the current windows-latest runner image, so the step exits 1 with "Cannot find path 'C:\Program Files\Microsoft Visual Studio\2022' because it does not exist" before anything compiles.

This is hitting the whole repo's Windows CUDA matrix right now (for example #785 and #791), not one branch.

Fix

Resolve the VS install path with vswhere, the supported version-independent way to locate Visual Studio, then glob MSBuild\Microsoft\VC\*\BuildCustomizations under it. vswhere ships at a stable location on every GitHub Windows image, so this keeps working across runner image bumps.

One file, the MSVC CUDA setup script. It only runs for the Windows MSVC CUDA matrix, so it cannot affect the Linux, macOS or non-CUDA builds.

I do not have a Windows runner locally, so the proof is this PR's own Windows CUDA matrix. If the vswhere call needs adjusting I will iterate here.

AI disclosure: drafted with help from Claude (Anthropic). I traced the failure to the "Setup CUDA (MSVC)" step (the VS2022 path drift) across the failing jobs and an unrelated PR before writing the change. Verified by CI.

The Windows + CUDA jobs fail in the "Setup CUDA (MSVC)" step. setup_cuda.ps1 copies
the CUDA MSBuild integration into Visual Studio's BuildCustomizations folder, found
by globbing a hard-coded C:\Program Files\Microsoft Visual Studio\2022 path. That
path no longer exists on the current windows-latest runner image, so the step exits
1 with "Cannot find path ... 2022" before anything compiles.

Resolve the VS install path with vswhere, the supported version-independent way to
locate Visual Studio, so the integration is copied wherever VS lives. vswhere ships
at a stable path on every GitHub Windows image, so this survives runner image bumps.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant