Skip to content

Fix Windows CI against Visual Studio 2026 - #1001

Open
X-Guardian wants to merge 1 commit into
mapbox:masterfrom
X-Guardian:chore/fix-vs2026
Open

X-Guardian wants to merge 1 commit into
mapbox:masterfrom
X-Guardian:chore/fix-vs2026

Conversation

@X-Guardian

Copy link
Copy Markdown
Contributor

Closes #998

Changes

Drop the hardcoded --msvs_version=2022 from test/run.util.js and let node-gyp detect the toolchain. Each runner image carries exactly one Visual Studio, so there is nothing to disambiguate: the flag only ever asserted a year that happened to match. It was not deliberate either: it began as --msvs_version=2015 with the comment "since that is more edge case than 2013", and the 2022 value arrived via a mechanical bump in #707, needing an edit on every image change since.

Add windows-2022 to both matrices. VS 2022 remains widely used and is the image GitHub directs users to when they need it, so it is worth covering alongside VS 2026 rather than testing only the newest toolchain.

Add scripts/upgrade-node-gyp.js, run on Windows via npm run upgrade-node-gyp. It reads the version of the node-gyp that node-pre-gyp will actually invoke and installs a newer one only when that version predates VS 2026 support.

Keying off the resolved node-gyp rather than the Node version matters because the matrix uses floating aliases. lts/-1 is Node 22 today and becomes Node 24 when Node 26 enters LTS, at which point the script finds node-gyp 12 and does nothing, with no annual edit and no comment that goes stale.

lib/util/compile.js exports which_node_gyp so the script resolves node-gyp exactly as the build does.

Result

15 jobs in ci.yml and 12 in s3-bucket.yml, with Windows covered on both toolchains:

Node Currently windows-latest (VS 2026) windows-2022 (VS 2022)
lts/-1 22.23.2 node-gyp upgraded bundled node-gyp
lts/* 24.21.0 bundled node-gyp bundled node-gyp
latest 26.9.0 bundled node-gyp bundled node-gyp

Non-Windows jobs are unaffected. The upgrade step is guarded by runner.os == 'Windows', and --msvs_version was only ever passed under a win32 check.

Other Changes

@X-Guardian
X-Guardian requested a review from a team as a code owner September 17, 2026 11:48
@ox-security

ox-security Bot commented Sep 17, 2026

Copy link
Copy Markdown

OX Security Logo

OX Security reviewed this pull request — nothing to fix.

No issues found

Branch chore/fix-vs2026master

View scan in OX Security →

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.

All Windows CI jobs fail: due to windows-latest now shipping Visual Studio 2026

1 participant