fix(ci): support Visual Studio 2026 native builds#753
Conversation
📝 WalkthroughWalkthroughWindows CMake generator selection is centralized with ordered Visual Studio fallback support and adopted by several Windows build scripts. Whisper runtime CMake discovery is broadened, Windows build commands now check exit codes, and the Electron rebuild development dependency is updated. ChangesWindows CMake generator fallback
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant WindowsBuildScript
participant configureWithWindowsCmakeGenerator
participant CMake
WindowsBuildScript->>configureWithWindowsCmakeGenerator: provide generator configuration callback
configureWithWindowsCmakeGenerator->>WindowsBuildScript: clear CMake cache
configureWithWindowsCmakeGenerator->>CMake: configure with selected Visual Studio generator and toolset
CMake-->>configureWithWindowsCmakeGenerator: success or failure
configureWithWindowsCmakeGenerator->>CMake: retry next generator after failure
configureWithWindowsCmakeGenerator-->>WindowsBuildScript: return selected generator or final error
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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.
🧹 Nitpick comments (1)
scripts/windows-cmake-generators.mjs (1)
9-36: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftConsider centralizing
findCmakealongside the generator helper.The
findCmakefunction is duplicated acrossbuild-cursor-monitor.mjs,build-nvidia-cuda-compositor.mjs,build-windows-capture.mjs,build-windows-gpu-export.mjs, andbuild-whisper-runtime.mjswith minor variations (e.g., NVIDIA includes "Preview" edition, whisper-runtime omitsProgram Files (x86)and returns unquoted paths forexecFileSync). This PR centralizes generator selection but leaves CMake discovery copy-pasted. A sharedfindCmakewith parameters for edition list, roots, and quoting mode would eliminate this duplication and ensure theWINDOWS_VISUAL_STUDIO_INSTALL_DIRSfix propagates automatically.🤖 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 `@scripts/windows-cmake-generators.mjs` around lines 9 - 36, Centralize the duplicated findCmake implementations from the Windows build scripts into the shared generator helper module alongside configureWithWindowsCmakeGenerator. Make the shared findCmake configurable for edition lists, installation roots, and quoted versus unquoted paths, preserving the NVIDIA Preview edition and whisper-runtime execFileSync behavior, and update each caller to use it so WINDOWS_VISUAL_STUDIO_INSTALL_DIRS is consistently applied.
🤖 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.
Nitpick comments:
In `@scripts/windows-cmake-generators.mjs`:
- Around line 9-36: Centralize the duplicated findCmake implementations from the
Windows build scripts into the shared generator helper module alongside
configureWithWindowsCmakeGenerator. Make the shared findCmake configurable for
edition lists, installation roots, and quoted versus unquoted paths, preserving
the NVIDIA Preview edition and whisper-runtime execFileSync behavior, and update
each caller to use it so WINDOWS_VISUAL_STUDIO_INSTALL_DIRS is consistently
applied.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: c4b6d9a1-443f-470b-b749-e57b56684670
📒 Files selected for processing (8)
.github/workflows/build.ymlelectron/windowsCmakeGenerators.test.mjsscripts/build-cursor-monitor.mjsscripts/build-nvidia-cuda-compositor.mjsscripts/build-whisper-runtime.mjsscripts/build-windows-capture.mjsscripts/build-windows-gpu-export.mjsscripts/windows-cmake-generators.mjs
Description
Restore Windows native builds on GitHub's Visual Studio 2026 runner:
@electron/rebuildto 4.2.0 / node-gyp 12.4.0Motivation
windows-latestmigrated to VS 2026. Current main fails rebuildinguiohook-napiwith node-gyp 11.5; after that is fixed, Recordly's CMake scripts still request only VS 2022/2019. VS 2026's default MSVC 14.51 also rejects the C++/WinRT experimental coroutine header, so the generator uses the runner's installed v143 compatibility toolset. PowerShell previously continued after helper failure and produced a misleading green build step until packaged smoke found missing Whisper.Type of Change
Verification
electron-builder install-app-depsRisk
Build tooling only; no native helper source or product runtime behavior changes. The exact-head workflow must still prove VS 2026 + v143 and unaffected macOS/Linux paths before merge.
Related
Unblocks cross-platform validation for #752.
Checklist
Summary by CodeRabbit
Bug Fixes
Chores
Tests