Skip to content

Re-land Windows VS 2026 (msvc145) toolchain migration; target windows2022 Jenkins agents - #18190

Merged
kevinushey merged 4 commits into
mainfrom
feature/reland-vs2026-toolchain
Jul 11, 2026
Merged

kevinushey merged 4 commits into
mainfrom
feature/reland-vs2026-toolchain

Conversation

@kevinushey

Copy link
Copy Markdown
Collaborator

Re-lands the Windows VS 2026 (MSVC 14.5) toolchain migration, and points the Windows build pipelines at the upgraded Jenkins agents.

The migration was backed out in 724a7ca (#18156) because the Jenkins Windows agents were still running Windows Server 2019, which cannot run the windowsservercore-ltsc2022-based build image under process isolation. The agents have since been upgraded to Windows Server 2022, so the migration can now re-land.

This PR:

  • Reverts 724a7ca, restoring the VS 2026 / MSVC 14.5 toolchain configuration (Docker base image windowsservercore-ltsc2022, VS 2026 Build Tools, windows-checks.cmake, msvc145 Boost/SOCI prebuilts, and the associated GHA workflow changes). The one conflict was in dependencies/windows/install-dependencies.cmd, where the MSVC_TOOLSET_VERSION default is restored to 145 while keeping the environment-override support and the NSISMULTIUSER_VERSION pin that landed after the revert.
  • Updates the Windows agent selection in jenkins/Jenkinsfile.windows and jenkins/Jenkinsfile.build to target the upgraded agents (labeled windows2022 x86_64 amd64) via windows2022 && x86_64, instead of the old windows label.

Addresses #17986.

The Windows Jenkins agents have been upgraded to Windows Server 2022 and are now labeled windows2022 / x86_64 / amd64. Update the Windows build pipelines to select agents via the new windows2022 label.
@kevinushey kevinushey added this to the 2026.08 (Yellow Yarrow) milestone Jul 10, 2026
@posit-snyk-bot

posit-snyk-bot commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@kevinushey
kevinushey requested a review from gtritchie July 10, 2026 17:25
@github-actions

github-actions Bot commented Jul 10, 2026 •

Copy link
Copy Markdown

RStudio E2E - all platforms

All tests passed!

#################### 100% pass rate

Passed Failed Skipped Flaky
1810 0 67 2
Platform ✅ Passed ❌ Failed ⚠️ Skipped 🔁 Flaky
✅ desktop-linux 455 0 14 1
✅ desktop-macos 460 0 10 0
✅ desktop-windows 456 0 16 0
✅ server-linux 439 0 27 1
View / download the full report

View report online -- opens in the browser, no download needed. Available for 14 days.

Download playwright-report.zip -- extract and open index.html

Includes screenshots, traces, and step-by-step details for every test. Expires in 15 days.


All platforms - commit 99e783a5c2d93774966ff8e6cfa59eb0fc2b28ee - Run #137

@gtritchie

Copy link
Copy Markdown
Member

Code review findings

Actionable items from an automated multi-agent review. Scope focused on the genuinely new content (the two Jenkinsfiles and the install-dependencies.cmd conflict resolution); the rest of the diff was verified to be a byte-for-byte inverse of the reverted commit.

Important

  1. jenkins/Jenkinsfile.build:175 — OS_FILTER='windows' now silently skips the "Build Windows" stage. labelForOS['windows'] was changed to 'windows2022' (line 8), which is correct for the node label at line 132, but the dispatch guard at line 175 (equals expected: labelForOS[params.OS_FILTER], actual: 'windows') then evaluates 'windows2022' == 'windows' → false. A targeted OS_FILTER='windows' build produces no Windows binaries with no error (the 'all' default path still works; Linux/macOS unaffected). Fix: compare OS_FILTER directly like the matrix stage at line 89 — equals expected: params.OS_FILTER, actual: 'windows' — or change the literal to actual: 'windows2022'.

  2. dependencies/windows/install-dependencies.cmd:40 — the comment advertises overriding MSVC_TOOLSET_VERSION "to select a different set of prebuilts (e.g. 143 for Visual Studio 2022)", but that path is dead: install-soci.R hardcodes 145 (so an override yields msvc143 Boost + msvc145 SOCI), and cmake/windows-checks.cmake:247 hard-fails unless the detected toolset is exactly 145. This also contradicts sibling install-boost.cmd, which hardcodes set MSVC_TOOLSET_VERSION=145. Fix: hardcode set MSVC_TOOLSET_VERSION=145 and drop the "143" suggestion from the comment.

Suggestions

  1. .github/workflows/os-build-dependencies-windows.yml:71 — comment says vcvarsall.bat is put on PATH "for later steps (e.g. make-package.bat)", but this workflow has no make-package.bat step (appears copy-pasted from the e2e workflow). The real consumer is install-boost.R's Sys.which("vcvarsall.bat"). Fix: reference the actual consumer.

  2. src/node/desktop/resources/vc_redist/README.md:23 — the x86 bullet points at the \x64\Microsoft.VC145.CRT folder (should be \x86\), and both bullets use C:\Program Files (x86)\...\BuildTools whereas this PR's own scripts install BuildTools under C:\Program Files\.... Pre-existing doc bugs, but the lines were edited here. Fix: correct the x86 path and drop (x86) from the BuildTools paths.

@gtritchie gtritchie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See feedback

Fix the Build Windows dispatch guard in Jenkinsfile.build to compare OS_FILTER directly (labelForOS[windows] is now windows2022, so the old comparison silently skipped the stage for targeted Windows builds). Hardcode MSVC_TOOLSET_VERSION=145 in install-dependencies.cmd since the environment override was a dead path (install-soci.R and windows-checks.cmake require 145). Fix a stale comment in os-build-dependencies-windows.yml to reference the actual vcvarsall.bat consumer, and correct the vc_redist README redist paths (x86 folder, BuildTools under Program Files).
Address findings from a build-pipeline review of the VS 2026 re-land. Include the MSVC toolset in the Windows docker image tag (getDockerTag) so a toolchain upgrade mints a new tag and stale images from a previous toolchain fail the pull loudly instead of being silently delivered to builds. Centralize the windows2022 agent label in a new utils.getAgentLabelForOS() helper and restore labelForOS (now familyForOS) to a pure OS-family map so all three build-dispatch guards share one idiom again. Enumerate all MSVC toolset pin sites in windows-checks.cmake, and deduplicate the vswhere MSVC setup step shared by the two Windows GitHub workflows into a composite action.
@gtritchie

Copy link
Copy Markdown
Member

Re-review: findings addressed

Confirmed against 99e783a5c2. All four findings from the previous comment are resolved:

  1. Jenkinsfile.build Windows dispatch guard — fixed. familyForOS['windows'] is now a pure OS-family value (windows) and the guard maps through it again, so OS_FILTER=windows correctly triggers the Build Windows stage. Node labels are derived separately via the new utils.getAgentLabelForOS() helper.
  2. install-dependencies.cmd toolset override — fixed. Hardcoded set MSVC_TOOLSET_VERSION=145 and dropped the misleading "143 for VS 2022" comment.
  3. os-build-dependencies-windows.yml comment — fixed. Now references the real consumer (install-boost.R's Sys.which("vcvarsall.bat")).
  4. vc_redist/README.md paths — fixed. x86 bullet points at the \x86\ folder and both paths use Program Files (not (x86)).

The additional hardening in 99e783a5c2 also holds up on review:

  • Docker tag -msvc145 suffix — producer (Jenkinsfile.build) and the Windows consumer (Jenkinsfile.windows) both compute the tag via getDockerTag(), and both resolve env.OS == 'windows', so the tag stays symmetric. A toolchain bump mints a new tag on both sides — no silent stale-image pull, which closes the failure mode behind the original revert.
  • setup-msvc-environment composite action — content matches the prior inline scripts; both consuming workflows check out the repo before referencing the local action.
  • windows-checks.cmake pin-site list — matches every hardcoded 145 site; the remaining references derive from the variable.

No further changes needed from my side.

@gtritchie gtritchie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@kevinushey
kevinushey merged commit 6f946e3 into main Jul 11, 2026
24 checks passed
@kevinushey
kevinushey deleted the feature/reland-vs2026-toolchain branch July 11, 2026 01:18
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.

3 participants