From 64b9d11ee6ae38c1f4463d3e64486a1b95fc5d6c Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Sat, 11 Jul 2026 11:35:08 +0200 Subject: [PATCH] fix(ci/windows): reclaim runner disk before building MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A full Windows CI pass writes ~50 GB of cargo target output into the shared C:\t (x64) / C:\t-a64 (arm64) scratch dirs on the intentionally-small (100 GB) windows-amd64 runner. Left to accumulate across runs, that overflowed the disk and every build died with "no space on device" (os error 112) — bytemuck_derive, cc, bindgen, windows, tracing-subscriber, fs4 all failing mid-compile, taking down pf-vdisplay/host builds. ensure-windows-toolchain.ps1 already runs first in every Windows job, so reclaim disk there before provisioning/building: call the runner-baked reclaimer (unom/infra installs C:\Users\Public\act-runner\clean-runner-disk.ps1 + a scheduled task) in threshold mode so THIS job starts with headroom regardless of when that task last ran, and keep incremental caches warm when there's room. A small inline fallback covers a runner not yet re-baked with the reclaimer. The whole step is best-effort — a cleanup hiccup never fails the build. Co-Authored-By: Claude Opus 4.8 --- scripts/ci/ensure-windows-toolchain.ps1 | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/scripts/ci/ensure-windows-toolchain.ps1 b/scripts/ci/ensure-windows-toolchain.ps1 index 8146182d..7c20ecca 100644 --- a/scripts/ci/ensure-windows-toolchain.ps1 +++ b/scripts/ci/ensure-windows-toolchain.ps1 @@ -16,6 +16,34 @@ trap { exit 1 } +# --- reclaim disk before building ----------------------------------------------------------------- +# The windows-amd64 runner's system volume is intentionally small (100 GB) and a full Windows CI pass +# writes ~50 GB of cargo target output into C:\t (x64) / C:\t-a64 (arm64). Left to accumulate across +# runs that overflows the disk and the build dies with "no space on device" (os error 112) - exactly +# what took the Windows host build down. The runner bakes in a reclaimer + a scheduled task that keeps +# an idle box lean (unom/infra's setup-gitea-runner-base.ps1 -> +# C:\Users\Public\act-runner\clean-runner-disk.ps1); call it here too so THIS job starts with headroom +# regardless of when that task last ran. Threshold mode (no -Force): it only prunes when actually low, +# so incremental-compile caches survive when there's room. Best-effort - a cleanup hiccup must never +# fail the build. +$reclaimer = 'C:\Users\Public\act-runner\clean-runner-disk.ps1' +try { + if (Test-Path $reclaimer) { + & powershell.exe -NoProfile -ExecutionPolicy Bypass -File $reclaimer + } + else { + # Fallback for a runner not yet re-baked with the infra reclaimer: prune the big target dirs when low. + $freeGb = [math]::Round((Get-PSDrive C).Free / 1GB, 1) + Write-Host "[ensure-toolchain] clean-runner-disk.ps1 absent; C: free ${freeGb} GB" + if ($freeGb -lt 35) { + foreach ($d in 'C:\t', 'C:\t-a64') { + if (Test-Path $d) { Write-Host " reclaiming $d"; Remove-Item $d -Recurse -Force -ErrorAction SilentlyContinue } + } + } + } +} +catch { Write-Warning "disk reclaim step failed (non-fatal): $_" } + $ciDir = $PSScriptRoot & "$ciDir\provision-windows-wdk.ps1" & "$ciDir\provision-windows-punktfunk-extras.ps1"