Skip to content

Commit 9718427

Browse files
committed
ci(windows): clear stale CMake cache to fix VS18 generator mismatch
The restored Windows build cache (C:/t) holds a CMakeCache.txt generated with VS 17 2022; the runner image moved to VS 18 2026, so whisper-rs-sys's CMake build aborts with "generator does not match the generator used previously". Drop CMakeCache.txt/CMakeFiles under C:/t before building in release, nightly and ci workflows. sccache still caches the C++ compiles.
1 parent 5eaaabe commit 9718427

3 files changed

Lines changed: 48 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,22 @@ jobs:
231231
# an absolute path — use `cache-directories` instead.
232232
cache-directories: ${{ matrix.platform == 'windows-latest' && 'C:/t' || '' }}
233233

234+
# A restored Windows build cache (C:/t) may hold a CMakeCache.txt from an
235+
# older VS generator (e.g. VS 17 2022). When the runner image moves to a
236+
# newer VS (18 2026), CMake aborts: "generator does not match the generator
237+
# used previously". Drop the stale CMake config so whisper-rs-sys
238+
# reconfigures against the current toolchain (sccache still caches the
239+
# actual compiles, so the rebuild cost is minimal).
240+
- name: Clear stale CMake cache (Windows)
241+
if: matrix.platform == 'windows-latest'
242+
shell: pwsh
243+
run: |
244+
if (Test-Path C:/t) {
245+
Get-ChildItem -Path C:/t -Recurse -Force -ErrorAction SilentlyContinue |
246+
Where-Object { $_.Name -eq 'CMakeCache.txt' -or $_.Name -eq 'CMakeFiles' } |
247+
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
248+
}
249+
234250
- name: Create dist stub for include_dir
235251
shell: bash
236252
run: mkdir -p dist && echo '<html></html>' > dist/index.html

.github/workflows/nightly.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,22 @@ jobs:
143143
workspaces: './src-tauri -> target'
144144
cache-directories: ${{ matrix.platform == 'windows-latest' && 'C:/t' || '' }}
145145

146+
# A restored Windows build cache (C:/t) may hold a CMakeCache.txt from an
147+
# older VS generator (e.g. VS 17 2022). When the runner image moves to a
148+
# newer VS (18 2026), CMake aborts: "generator does not match the generator
149+
# used previously". Drop the stale CMake config so whisper-rs-sys
150+
# reconfigures against the current toolchain (sccache still caches the
151+
# actual compiles, so the rebuild cost is minimal).
152+
- name: Clear stale CMake cache (Windows)
153+
if: matrix.platform == 'windows-latest'
154+
shell: pwsh
155+
run: |
156+
if (Test-Path C:/t) {
157+
Get-ChildItem -Path C:/t -Recurse -Force -ErrorAction SilentlyContinue |
158+
Where-Object { $_.Name -eq 'CMakeCache.txt' -or $_.Name -eq 'CMakeFiles' } |
159+
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
160+
}
161+
146162
- name: Install frontend dependencies
147163
run: pnpm install --frozen-lockfile
148164

.github/workflows/release.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,22 @@ jobs:
8888
workspaces: './src-tauri -> target'
8989
cache-directories: ${{ matrix.platform == 'windows-latest' && 'C:/t' || '' }}
9090

91+
# A restored Windows build cache (C:/t) may hold a CMakeCache.txt from an
92+
# older VS generator (e.g. VS 17 2022). When the runner image moves to a
93+
# newer VS (18 2026), CMake aborts: "generator does not match the generator
94+
# used previously". Drop the stale CMake config so whisper-rs-sys
95+
# reconfigures against the current toolchain (sccache still caches the
96+
# actual compiles, so the rebuild cost is minimal).
97+
- name: Clear stale CMake cache (Windows)
98+
if: matrix.platform == 'windows-latest'
99+
shell: pwsh
100+
run: |
101+
if (Test-Path C:/t) {
102+
Get-ChildItem -Path C:/t -Recurse -Force -ErrorAction SilentlyContinue |
103+
Where-Object { $_.Name -eq 'CMakeCache.txt' -or $_.Name -eq 'CMakeFiles' } |
104+
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
105+
}
106+
91107
- name: Install frontend dependencies
92108
run: pnpm install --frozen-lockfile
93109

0 commit comments

Comments
 (0)