feat(ci): enhance Windows SDK checks in CI and release workflows

- Added checks to ensure Windows SDK environment variables are set, providing warnings if they are not.
- Included a step to verify the presence of kernel32.lib, improving diagnostics for Windows builds.

Benefits:
- Increases the robustness of the CI and release workflows by ensuring necessary SDK components are available.
- Enhances build reliability on Windows by proactively identifying potential issues with the SDK setup.
This commit is contained in:
scawful
2025-10-13 22:21:04 -04:00
parent 0c8353bb39
commit 7bb0f257ce
2 changed files with 34 additions and 0 deletions

View File

@@ -220,6 +220,12 @@ jobs:
} }
} }
Write-Host "MSVC developer environment variables exported (selected set)" Write-Host "MSVC developer environment variables exported (selected set)"
- name: Ensure MSVC Dev Cmd (Windows)
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Diagnose vcpkg (Windows) - name: Diagnose vcpkg (Windows)
if: runner.os == 'Windows' && (steps.vcpkg.outcome == 'failure' || steps.vcpkg.outcome == 'success') if: runner.os == 'Windows' && (steps.vcpkg.outcome == 'failure' || steps.vcpkg.outcome == 'success')
@@ -362,6 +368,17 @@ jobs:
} }
Write-Host "Using vcpkg toolchain: $env:CMAKE_TOOLCHAIN_FILE" Write-Host "Using vcpkg toolchain: $env:CMAKE_TOOLCHAIN_FILE"
if (-not $env:WindowsSdkDir -or -not $env:WindowsSdkVersion) {
Write-Host "::warning::Windows SDK environment variables not set (WindowsSdkDir/WindowsSdkVersion)"
} else {
$kernelLib = Join-Path $env:WindowsSdkDir ("Lib/{0}/um/x64/kernel32.lib" -f $env:WindowsSdkVersion.TrimEnd('\'))
if (Test-Path $kernelLib) {
Write-Host "Found Windows SDK kernel32.lib at: $kernelLib"
} else {
Write-Host "::warning::kernel32.lib not found at expected path: $kernelLib"
}
}
$linker = "link.exe" $linker = "link.exe"
if ($env:MSVC_LINK_PATH -and (Test-Path $env:MSVC_LINK_PATH)) { if ($env:MSVC_LINK_PATH -and (Test-Path $env:MSVC_LINK_PATH)) {
$linker = $env:MSVC_LINK_PATH $linker = $env:MSVC_LINK_PATH

View File

@@ -295,6 +295,12 @@ jobs:
} }
Write-Host "MSVC developer environment variables exported (selected set)" Write-Host "MSVC developer environment variables exported (selected set)"
- name: "Ensure MSVC Dev Cmd (Windows)"
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: "Free Disk Space (Linux)" - name: "Free Disk Space (Linux)"
if: runner.os == 'Linux' if: runner.os == 'Linux'
shell: bash shell: bash
@@ -372,6 +378,17 @@ jobs:
} }
Write-Host "Using vcpkg toolchain: $env:CMAKE_TOOLCHAIN_FILE" Write-Host "Using vcpkg toolchain: $env:CMAKE_TOOLCHAIN_FILE"
if (-not $env:WindowsSdkDir -or -not $env:WindowsSdkVersion) {
Write-Host "::warning::Windows SDK environment variables not set (WindowsSdkDir/WindowsSdkVersion)"
} else {
$kernelLib = Join-Path $env:WindowsSdkDir ("Lib/{0}/um/x64/kernel32.lib" -f $env:WindowsSdkVersion.TrimEnd('\'))
if (Test-Path $kernelLib) {
Write-Host "Found Windows SDK kernel32.lib at: $kernelLib"
} else {
Write-Host "::warning::kernel32.lib not found at expected path: $kernelLib"
}
}
$linker = "link.exe" $linker = "link.exe"
if ($env:MSVC_LINK_PATH -and (Test-Path $env:MSVC_LINK_PATH)) { if ($env:MSVC_LINK_PATH -and (Test-Path $env:MSVC_LINK_PATH)) {
$linker = $env:MSVC_LINK_PATH $linker = $env:MSVC_LINK_PATH