fix: resolve MSVC toolset mismatch causing DLL load failure on Windo…#94
Conversation
📝 WalkthroughWalkthroughThe Windows CI workflow gains explicit Windows CI MSVC Toolset Pinning
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/build.ps1:
- Around line 18-20: The override path in the build script bypasses the
fast-fail availability check, so a stale or injected VCToolsVersion can reach
phpsdk-starter.bat and fail later with a weaker error. In the build.ps1 flow
around the VCToolsVersion selection, keep the existing toolset availability
guard for the override branch by validating the selected toolset before using
it, and preserve the current fallback behavior when no override is set.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 3dd84a55-24ab-4a30-a210-93f616d0b1cc
📒 Files selected for processing (2)
.github/workflows/build.ps1.github/workflows/windows.yaml
| if ($env:VCToolsVersion) { | ||
| $selectedToolset = $env:VCToolsVersion.Trim() | ||
| } else { |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Keep the fast-fail availability check on the override path.
Any non-empty VCToolsVersion now bypasses the "toolset not available" guard and is passed straight to phpsdk-starter.bat. A stale or manually injected value will fail later with a less actionable error.
Suggested fix
if ($env:VCToolsVersion) {
$selectedToolset = $env:VCToolsVersion.Trim()
+ $MSVCDirectory = vswhere -latest -products * -find "VC\Tools\MSVC"
+ if (-not $selectedToolset -or -not (Test-Path (Join-Path $MSVCDirectory $selectedToolset))) {
+ throw "toolset not available"
+ }
} else {
$MSVCDirectory = vswhere -latest -products * -find "VC\Tools\MSVC"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if ($env:VCToolsVersion) { | |
| $selectedToolset = $env:VCToolsVersion.Trim() | |
| } else { | |
| if ($env:VCToolsVersion) { | |
| $selectedToolset = $env:VCToolsVersion.Trim() | |
| $MSVCDirectory = vswhere -latest -products * -find "VC\Tools\MSVC" | |
| if (-not $selectedToolset -or -not (Test-Path (Join-Path $MSVCDirectory $selectedToolset))) { | |
| throw "toolset not available" | |
| } | |
| } else { |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/build.ps1 around lines 18 - 20, The override path in the
build script bypasses the fast-fail availability check, so a stale or injected
VCToolsVersion can reach phpsdk-starter.bat and fail later with a weaker error.
In the build.ps1 flow around the VCToolsVersion selection, keep the existing
toolset availability guard for the override branch by validating the selected
toolset before using it, and preserve the current fallback behavior when no
override is set.
…ws CI
Summary by CodeRabbit