Skip to content

Commit 1c7dc70

Browse files
committed
ci(windows): expand runner disk cleanup to prevent TeX Live OOS
The Windows container build has failed intermittently (2026-04-05, 03-29, 03-08) during TeX Live installation with: re-exec error: exit status 1: output: write ... \texlive\tlpkg\tlgs\Resource\Font\putri8a.pfb: There is not enough space on the disk. The pre-build cleanup step was only removing six toolchains. Expand the allowlist to cover more pre-installed SDKs and package-manager caches that the Quarto Windows container build does not use. Added removals: - Android SDK, ANDROID_HOME, ANDROID_SDK_ROOT - Go, Java, JDK variants, dotnet SDKs - Unity Hub, Windows Kits ExtensionSDKs - PHP, Ruby, Julia, Miniconda, Rust toolchains - Cargo/rustup user caches, vcpkg, Selenium drivers - NuGet / npm / pip / Chocolatey HTTP caches - Windows Update download cache Added post-prune operations: - Clear-RecycleBin - docker builder prune -af - docker volume prune -f Explicitly does NOT touch: C:\ProgramData\chocolatey (scoop fallback), C:\Users\runneradmin\scoop (build state), Docker binaries, or any installation step in the Dockerfile.
1 parent a4dd64c commit 1c7dc70

1 file changed

Lines changed: 45 additions & 4 deletions

File tree

.github/workflows/infra-container-windows.yml

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,24 +165,65 @@ jobs:
165165
Write-Host "📊 Disk space BEFORE cleanup:"
166166
Get-PSDrive -PSProvider FileSystem | Where-Object { $_.Used -gt 0 } | Format-Table Name, @{N='Used(GB)';E={[math]::Round($_.Used/1GB,1)}}, @{N='Free(GB)';E={[math]::Round($_.Free/1GB,1)}}
167167
168-
# Remove pre-installed tools we don't need
168+
# Pre-installed toolchains and SDKs not used by the Quarto Windows container build.
169+
# NOTE: Do NOT remove anything from C:\ProgramData\chocolatey (scoop uses choco fallback),
170+
# do NOT touch C:\Users\runneradmin\scoop (scoop state for the build),
171+
# and do NOT touch Docker binaries or Windows container images already pulled.
169172
$paths = @(
173+
# Original toolchain removals
170174
"C:\hostedtoolcache",
171175
"C:\mingw64",
172176
"C:\ghcup",
173177
"C:\cabal",
174178
"C:\Strawberry",
175-
"$env:LOCALAPPDATA\Temp\*"
179+
"$env:LOCALAPPDATA\Temp\*",
180+
181+
# Additional pre-installed SDKs the Quarto build does not use
182+
"C:\Android",
183+
"$env:ANDROID_HOME",
184+
"$env:ANDROID_SDK_ROOT",
185+
"C:\Program Files\Android",
186+
"C:\Program Files (x86)\Android",
187+
"C:\Program Files\Go",
188+
"C:\Program Files\Microsoft\jdk-*",
189+
"C:\Program Files\Java",
190+
"C:\Program Files\dotnet\sdk\*",
191+
"C:\Program Files\Unity Hub",
192+
"C:\Program Files (x86)\Windows Kits\10\ExtensionSDKs",
193+
"C:\tools\php*",
194+
"C:\tools\ruby*",
195+
"C:\Julia",
196+
"C:\Miniconda",
197+
"C:\Rust",
198+
"C:\Users\runneradmin\.cargo",
199+
"C:\Users\runneradmin\.rustup",
200+
"C:\vcpkg",
201+
"C:\SeleniumWebDrivers",
202+
203+
# Package manager caches that the Quarto build does not consume
204+
"$env:LOCALAPPDATA\NuGet\Cache",
205+
"$env:LOCALAPPDATA\NuGet\v3-cache",
206+
"$env:APPDATA\npm-cache",
207+
"$env:LOCALAPPDATA\pip\Cache",
208+
"$env:LOCALAPPDATA\ChocolateyHttpCache",
209+
210+
# Windows update download cache (re-fetched on demand if needed)
211+
"C:\Windows\SoftwareDistribution\Download\*"
176212
)
177213
foreach ($p in $paths) {
178-
if (Test-Path $p) {
214+
if ($p -and (Test-Path $p)) {
179215
Write-Host "Removing $p ..."
180216
Remove-Item -Recurse -Force $p -ErrorAction SilentlyContinue
181217
}
182218
}
183219
184-
# Prune any stale Docker data
220+
# Empty recycle bin in case prior cleanup sent large dirs there
221+
try { Clear-RecycleBin -Force -ErrorAction SilentlyContinue } catch {}
222+
223+
# Prune any stale Docker data (safe: no image has been built yet this run)
185224
docker system prune -af 2>$null
225+
docker builder prune -af 2>$null
226+
docker volume prune -f 2>$null
186227
187228
Write-Host "📊 Disk space AFTER cleanup:"
188229
Get-PSDrive -PSProvider FileSystem | Where-Object { $_.Used -gt 0 } | Format-Table Name, @{N='Used(GB)';E={[math]::Round($_.Used/1GB,1)}}, @{N='Free(GB)';E={[math]::Round($_.Free/1GB,1)}}

0 commit comments

Comments
 (0)