Fix CI: detect Windows MSVC toolchain#14869
Conversation
✅ clang-tidy: No findings on changed linesCompleted in 0.0s. |
Codex Code Review - OBSOLETESuperseded by a newer AI review. Expand to see the original review.🟡 Codex Code ReviewAuto-triggered after CI passed — reviewing commit e90c4d0 ❌ Codex review failed before producing findings. ℹ️ About this responseGenerated by Codex CLI. Limitations:
Commands:
|
Claude Code Review - OBSOLETESuperseded by a newer AI review. Expand to see the original review.✅ Claude Code ReviewAuto-triggered after CI passed — reviewing commit e90c4d0 SummaryCI-only PR that adds VS2022 Build Tools auto-installation to the Windows composite action and a diagnostic job to audit the High-severity findings (1):
Full review (click to expand)Findings🔴 HIGHH1.
|
| Component | Impacted? | Analysis |
|---|---|---|
build-windows-vs2022 (PR) |
YES | Will use updated composite action; currently skipped due to ONLY_JOB |
build-windows-vs2022-avx2 (nightly) |
YES | Uses same composite action; runs on windows-2022 which already has VS2022, so the detect step will skip installation |
| All other PR jobs | BLOCKED | All disabled by ONLY_JOB='detect-windows-8-core-software' |
detect-windows-8-core-software |
NEW | Only job that runs; diagnostic only, no repo checkout, no build |
Positive Observations
- The detect-before-install pattern in the composite action is well-structured: check with
vswhere, install if missing, verify after install, fail explicitly if verification fails. - The
vs-version: "[17.0,18.0)"pin forsetup-msbuildcorrectly constrains it to VS2022 (major version 17), preventing accidental pickup of VS2019 or a future VS2025. - The diagnostic job is thorough and would provide valuable information about the runner environment.
ℹ️ About this response
Generated by Claude Code.
Review methodology: claude_md/code_review.md
Limitations:
- Claude may miss context from files not in the diff
- Large PRs may be truncated
- Always apply human judgment to AI suggestions
Commands:
/claude-review [context]— Request a code review/claude-query <question>— Ask about the PR or codebase
Codex Code Review - OBSOLETESuperseded by a newer AI review. Expand to see the original review.🟡 Codex Code ReviewAuto-triggered after CI passed — reviewing commit deab4f7 ❌ Codex review failed before producing findings. ℹ️ About this responseGenerated by Codex CLI. Limitations:
Commands:
|
Claude Code Review - OBSOLETESuperseded by a newer AI review. Expand to see the original review.✅ Claude Code ReviewAuto-triggered after CI passed — reviewing commit deab4f7 SummaryCI-only PR that auto-detects Visual Studio and Java on Windows runners, replaces High-severity findings (2):
Full review (click to expand)Findings🔴 HIGHH1.
|
| Context | Affected? | Notes |
|---|---|---|
| PR CI (all jobs) | YES - H1 | ONLY_JOB breaks all non-Windows jobs |
| PR CI (Windows tests) | YES - H2 | Only db_test shard runs |
| Nightly CI (Windows) | YES | Runner changed, auto-detection. Action defaults cover all tests |
| Fork CI | NO | Already skipped |
| Build correctness | MAYBE - M3 | Depends on productLineVersion value |
Positive Observations
- Auto-detecting VS installation is a sound approach for portability across runner images.
- Replacing
msbuildwithcmake --buildis good modernization. - The PATH fix from
$env:JAVA_HOME + ";"to"$env:JAVA_HOME\bin;"corrects a real bug. $ErrorActionPreference = "Stop"ensures early failure detection.-products *in vswhere correctly handles both full VS and Build Tools.
ℹ️ About this response
Generated by Claude Code.
Review methodology: claude_md/code_review.md
Limitations:
- Claude may miss context from files not in the diff
- Large PRs may be truncated
- Always apply human judgment to AI suggestions
Commands:
/claude-review [context]— Request a code review/claude-query <question>— Ask about the PR or codebase
Codex Code Review - OBSOLETESuperseded by a newer AI review. Expand to see the original review.🟡 Codex Code ReviewAuto-triggered after CI passed — reviewing commit a045e42 ❌ Codex review failed before producing findings. ℹ️ About this responseGenerated by Codex CLI. Limitations:
Commands:
|
Claude Code Review - OBSOLETESuperseded by a newer AI review. Expand to see the original review.✅ Claude Code ReviewAuto-triggered after CI passed — reviewing commit a045e42 SummaryCI-only PR that modernizes Windows build infrastructure: auto-detects VS version, replaces High-severity findings (2):
Full review (click to expand)Findings🔴 HIGHH1.
|
| Aspect | Status | Notes |
|---|---|---|
| ONLY_JOB interaction | BROKEN | All non-Windows PR jobs disabled |
| Job name references | Needs check | Branch protection rules may reference old names |
| Runner compatibility | OK | windows-8-core already used in pr-jobs.yml |
| CMAKE_GENERATOR propagation | OK | GITHUB_ENV is available to subsequent steps |
| setup-msbuild v2 compatibility | OK | v2 supports vs-version with version range format |
| Java availability on runners | Fragile | Depends on runner image; no fallback install |
| cmake --build compatibility | OK | Drop-in replacement for msbuild with CMake projects |
Positive Observations
- Auto-detecting VS version is a forward-looking improvement that will ease migration to future VS versions.
- Using
cmake --buildinstead ofmsbuilddirectly is more portable and aligns with modern CMake best practices. - The vswhere detection step has good error handling with
throwon each failure case and$ErrorActionPreference = "Stop". - Removing the Chocolatey install step speeds up CI.
- The path fix (
$env:JAVA_HOME\bininstead of$env:JAVA_HOME) is a genuine bug fix.
ℹ️ About this response
Generated by Claude Code.
Review methodology: claude_md/code_review.md
Limitations:
- Claude may miss context from files not in the diff
- Large PRs may be truncated
- Always apply human judgment to AI suggestions
Commands:
/claude-review [context]— Request a code review/claude-query <question>— Ask about the PR or codebase
Codex Code Review - OBSOLETESuperseded by a newer AI review. Expand to see the original review.🟡 Codex Code ReviewAuto-triggered after CI passed — reviewing commit 85424e5 ❌ Codex review failed before producing findings. ℹ️ About this responseGenerated by Codex CLI. Limitations:
Commands:
|
Claude Code Review - OBSOLETESuperseded by a newer AI review. Expand to see the original review.✅ Claude Code ReviewAuto-triggered after CI passed — reviewing commit 85424e5 SummarySolid CI improvement that decouples Windows builds from a specific VS version and modernizes the build commands. The changes are well-structured and the dynamic detection approach is the right direction. A few issues worth addressing before merge. High-severity findings (1):
Full review (click to expand)Findings🔴 HIGHH1. No JDK installation fallback —
|
| Concern | Assessment |
|---|---|
| ccache compatibility with cmake --build | Safe |
| Java test matrix | At risk — auto-detected JDK version may differ from old liberica8jdk (JDK 8) |
| CMAKE_GENERATOR propagation via GITHUB_ENV | Safe — takes effect in subsequent steps |
| only_job filter mechanism | Works with new names; old name build-windows-vs2022 no longer matches |
Positive Observations
- Dynamic VS detection is the right architectural direction for future-proofing.
cmake --buildinstead of directmsbuildis more portable and follows CMake best practices.- The PATH fix (
$env:JAVA_HOME\bin;instead of$env:JAVA_HOME;) is a genuine bug fix. - Good diagnostic output added (java/javac version, VS detection logging).
ℹ️ About this response
Generated by Claude Code.
Review methodology: claude_md/code_review.md
Limitations:
- Claude may miss context from files not in the diff
- Large PRs may be truncated
- Always apply human judgment to AI suggestions
Commands:
/claude-review [context]— Request a code review/claude-query <question>— Ask about the PR or codebase
|
@xingbowang has imported this pull request. If you are a Meta employee, you can view this in D109176291. |
|
@xingbowang has imported this pull request. If you are a Meta employee, you can view this in D109176291. |
Detect the installed Visual Studio C++ toolchain on Windows runners and derive the matching CMake generator/setup-msbuild version instead of hardcoding VS2022. Keep PR and nightly Windows jobs on windows-8-core with version-neutral MSVC job names. Use the preinstalled JDK and build generated CMake projects through cmake --build so project file names do not depend on the selected VS generator.
|
@xingbowang has imported this pull request. If you are a Meta employee, you can view this in D109176291. |
🟡 Codex Code ReviewAuto-triggered after CI passed — reviewing commit 9c297b0 ❌ Codex review failed before producing findings. ℹ️ About this responseGenerated by Codex CLI. Limitations:
Commands:
|
✅ Claude Code ReviewAuto-triggered after CI passed — reviewing commit 9c297b0 SummaryCI-only change that makes Windows builds toolchain-agnostic. The approach is sound: dynamic detection via vswhere is the canonical way to find VS installations. One potential correctness issue with High-severity findings (0): No high-severity findings. Full review (click to expand)Findings🟡 MEDIUMM1.
|
|
@xingbowang merged this pull request in 5b324a2. |
Summary
Update Windows CI to stop hardcoding Visual Studio 2022. The Windows build action now detects the installed Visual Studio C++ toolchain with vswhere, derives the matching CMake generator, and passes the corresponding version range to microsoft/setup-msbuild@v2.
Also update the Windows build steps to use the preinstalled JDK instead of installing Liberica JDK8 through Chocolatey, and build Snappy/RocksDB through cmake --build, instead of assuming fixed .sln names. Rename Windows CI jobs from VS2022-specific names to MSVC-neutral names, and move the nightly AVX2 Windows job to windows-8-core so PR and nightly CI use the same runner/toolchain path.
Testing