Skip to content

Commit 313a547

Browse files
committed
ci: use msvc-dev-cmd and fail-fast Windows build step
The hardcoded VS2022 vcvars64.bat path does not exist on the windows-2025-vs2026 image, so cl never reached PATH and CMake failed with 'Could not find the compiler specified in CXX: cl'. Use ilammy/msvc-dev-cmd (as the main repo's ci-workflow does) to locate VS via vswhere. Also chain the build as 'make ... && ccache -s' so a make failure fails the step; previously the trailing 'ccache -s' (exit 0) masked build failures and the step stayed green while tests failed downstream with MODULE_NOT_FOUND.
1 parent 735372c commit 313a547

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,21 +124,26 @@ jobs:
124124
'C:\Program Files\OpenSSL\bin' >> $env:GITHUB_PATH
125125
Get-ChildItem D:\openssl -Recurse | ForEach-Object { $_.FullName }
126126
127+
- name: Set up MSVC environment (Windows)
128+
if: ${{ matrix.platform == 'win32' }}
129+
uses: ilammy/msvc-dev-cmd@v1
130+
with:
131+
arch: x64
132+
127133
- name: Build Node.js native module (Windows)
128134
if: ${{ matrix.platform == 'win32' }}
129135
shell: cmd
130136
env:
131137
EXTRA_CMAKE_FLAGS: -DLBUG_NODEJS_ENABLE_TEST_EXPORTS=ON
132138
# windows-2025 images ship mingw64 in PATH, which CMake would
133139
# otherwise prefer over MSVC (breaking ws2_32 linking and ar).
140+
# (cl itself comes from msvc-dev-cmd above via vswhere.)
134141
CC: cl
135142
CXX: cl
136143
run: |
137144
powershell.exe -Command "Add-MpPreference -ExclusionPath '${{ github.workspace }}'"
138-
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
139-
ccache -s
140-
make GEN=Ninja nodejs
141145
ccache -s
146+
make GEN=Ninja nodejs && ccache -s
142147
143148
- name: Build Node.js native module (non-Windows)
144149
if: ${{ matrix.platform != 'win32' }}

0 commit comments

Comments
 (0)