From 01c03f43ccfe8e8b5fa6991692611c2b05ef3369 Mon Sep 17 00:00:00 2001 From: Sawan Srivastava Date: Mon, 2 Nov 2026 13:57:11 -0800 Subject: [PATCH] Build Windows ROCm inside the VS developer shell Upstream ggml-org/llama.cpp#31329 embeds an app manifest in every Windows executable. With ROCm's clang in MSVC mode, lld-link has to merge that manifest by invoking the Windows SDK's mt.exe, which isn't on PATH outside a VS developer environment. Every windows-rocm build since b12013 failed at link time, and the release job then dropped the whole ROCm family, Ubuntu archives included. Enter the VS developer shell before building so the MSVC-ABI toolchain gets the SDK tools it expects, and keep building with the runner's CMake instead of the copy VS bundles. Co-Authored-By: Claude Opus 5.5 (1M context) --- .github/workflows/release.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 59f18ef6b211..0c2af6ca6c99 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -923,9 +923,20 @@ jobs: - name: Build run: | + # TheRock's clang targets the MSVC ABI, so link in the VS developer environment it expects: + # upstream embeds an app manifest in every exe (ggml-org/llama.cpp#31329), and lld-link needs the SDK's mt.exe to merge it. + # The dev shell prepends VS's bundled CMake; keep building with the runner's. + $cmake = (Get-Command cmake).Source + $vs = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * ` + -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath + if (-not $vs) { throw "No Visual Studio install with the x64 C++ tools found" } + Import-Module "$vs\Common7\Tools\Microsoft.VisualStudio.DevShell.dll" + Enter-VsDevShell -VsInstallPath $vs -SkipAutomaticLocation -DevCmdArguments "-arch=x64 -host_arch=x64" + write-host "VS: $vs; cmake: $cmake; mt: $((Get-Command mt.exe).Source)" + mkdir build cd build - cmake .. ` + & $cmake .. ` -G "Unix Makefiles" ` -DCMAKE_PREFIX_PATH="${env:HIP_PATH}" ` -DCMAKE_BUILD_TYPE=Release ` @@ -941,7 +952,7 @@ jobs: -DHIP_PATH="${env:HIP_PATH}" ` -DGGML_HIP_ROCWMMA_FATTN=ON ` -DAMDGPU_TARGETS="${{ matrix.gpu_targets }}" - cmake --build . --config Release --parallel ${env:NUMBER_OF_PROCESSORS} + & $cmake --build . --config Release --parallel ${env:NUMBER_OF_PROCESSORS} - name: Verify HIP backend was built run: |