Skip to content

fix(ci): support Visual Studio 2026 native builds#753

Merged
meiiie merged 3 commits into
mainfrom
ci/windows-vs2026-native-build
Jul 11, 2026
Merged

fix(ci): support Visual Studio 2026 native builds#753
meiiie merged 3 commits into
mainfrom
ci/windows-vs2026-native-build

Conversation

@meiiie

@meiiie meiiie commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Description

Restore Windows native builds on GitHub's Visual Studio 2026 runner:

  • update @electron/rebuild to 4.2.0 / node-gyp 12.4.0
  • try CMake generators VS 2026 with v143 -> VS 2022 -> VS 2019, clearing cache between attempts
  • apply the same contract to WGC, GPU export, cursor, NVIDIA, and Whisper
  • stop the Windows workflow immediately after a failed helper, TypeScript, or Vite command

Motivation

windows-latest migrated to VS 2026. Current main fails rebuilding uiohook-napi with 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

  • Bug Fix

Verification

  • npm 10 exact clean install and electron-builder install-app-deps
  • generator selection/fallback/toolset/final-error tests: 3 passed
  • full suite: 995 passed, 1 skipped
  • strict TypeScript, targeted Biome lint, Node syntax checks
  • local VS 2022: controlled VS 2026 attempt -> cache clear -> VS 2022 fallback; helper chain reaches Whisper
  • Electron 39 production build/CJS smoke, Windows directory package, packaged-binary smoke
  • audit: 13 findings, 0 critical (was 15)

Risk

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

  • Self-reviewed
  • No UI screenshot applies
  • No changelog entry is needed

Summary by CodeRabbit

  • Bug Fixes

    • Improved Windows build reliability by automatically discovering and selecting a compatible CMake generator across supported Visual Studio versions.
    • Standardized cache cleanup, generator fallback, and configure-time error reporting across Windows build scripts.
    • Enhanced generator configuration for newer Visual Studio tooling (including toolset handling where applicable).
  • Chores

    • Windows builds now stop immediately when key build commands fail (preventing cascading errors).
    • Updated a development dependency used for Electron rebuild.
  • Tests

    • Added tests covering generator selection order, fallback behavior, and failure handling on Windows.

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Windows 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.

Changes

Windows CMake generator fallback

Layer / File(s) Summary
Generator helper and coverage
scripts/windows-cmake-generators.mjs, electron/windowsCmakeGenerators.test.mjs
Adds ordered, frozen Visual Studio generator metadata and a helper that clears cache, retries generators, logs failures, and rethrows the final error; tests cover these behaviors.
Native Windows script migration
scripts/build-cursor-monitor.mjs, scripts/build-nvidia-cuda-compositor.mjs, scripts/build-windows-capture.mjs, scripts/build-windows-gpu-export.mjs
Replaces hardcoded generator fallback logic with the shared helper and Visual Studio installation directory list.
Whisper runtime configuration
scripts/build-whisper-runtime.mjs
Expands CMake discovery across Visual Studio installations and passes the selected generator and optional toolset through Windows configuration while retaining the non-Windows path.
Windows build validation and tooling
.github/workflows/build.yml, package.json
Adds immediate $LASTEXITCODE checks after native helper, TypeScript, and Vite builds, and updates @electron/rebuild to ^4.2.0.

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
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: restoring Windows native builds for Visual Studio 2026.
Description check ✅ Passed The description covers the required sections and includes purpose, motivation, type, verification, risk, related issue, and checklist.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/windows-vs2026-native-build

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
scripts/windows-cmake-generators.mjs (1)

9-36: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Consider centralizing findCmake alongside the generator helper.

The findCmake function is duplicated across build-cursor-monitor.mjs, build-nvidia-cuda-compositor.mjs, build-windows-capture.mjs, build-windows-gpu-export.mjs, and build-whisper-runtime.mjs with minor variations (e.g., NVIDIA includes "Preview" edition, whisper-runtime omits Program Files (x86) and returns unquoted paths for execFileSync). This PR centralizes generator selection but leaves CMake discovery copy-pasted. A shared findCmake with parameters for edition list, roots, and quoting mode would eliminate this duplication and ensure the WINDOWS_VISUAL_STUDIO_INSTALL_DIRS fix 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

📥 Commits

Reviewing files that changed from the base of the PR and between ec82094 and 0d614bc.

📒 Files selected for processing (8)
  • .github/workflows/build.yml
  • electron/windowsCmakeGenerators.test.mjs
  • scripts/build-cursor-monitor.mjs
  • scripts/build-nvidia-cuda-compositor.mjs
  • scripts/build-whisper-runtime.mjs
  • scripts/build-windows-capture.mjs
  • scripts/build-windows-gpu-export.mjs
  • scripts/windows-cmake-generators.mjs

@meiiie meiiie merged commit 0933eec into main Jul 11, 2026
9 checks passed
@meiiie meiiie deleted the ci/windows-vs2026-native-build branch July 11, 2026 08:17
@meiiie meiiie mentioned this pull request Jul 11, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant