From 4bf17975910d0f1f70b59dbb22bfb0f2bbc32d03 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Wed, 2 Dec 2026 00:22:33 -0800 Subject: [PATCH 1/2] CI: a stuck CUDA redist staging directory no longer fails the Windows CUDA job --- .github/workflows/unsloth-sd-prebuilt.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unsloth-sd-prebuilt.yml b/.github/workflows/unsloth-sd-prebuilt.yml index 71ccff4f8..346a845d9 100644 --- a/.github/workflows/unsloth-sd-prebuilt.yml +++ b/.github/workflows/unsloth-sd-prebuilt.yml @@ -825,7 +825,17 @@ jobs: if ($LASTEXITCODE -ne 0) { throw "extract failed: $name" } robocopy (Join-Path $stage $name) $prefix /E /NFL /NDL /NJH /NJS /NP | Out-Null if ($LASTEXITCODE -ge 8) { throw "copy failed: $name ($LASTEXITCODE)" } - Remove-Item -Recurse -Force $zip, (Join-Path $stage $name) + # The cleanup only frees runner disk. A file still held open in the extracted tree has + # failed the cuda_crt step ("directory is not empty") and dropped the CUDA 13 assets. + for ($i = 1; $i -le 3; $i++) { + $left = @($zip, (Join-Path $stage $name)) | Where-Object { Test-Path $_ } + if (-not $left) { break } + try { Remove-Item -Recurse -Force $left -ErrorAction Stop; break } + catch { + if ($i -lt 3) { Start-Sleep -Seconds 5 } + else { Write-Warning "staging cleanup left $name behind: $_" } + } + } } "$prefix\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append "CUDA_PATH=$prefix" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append From dc7cf786150b8a6bd93538386ec33ac3e4a76cc4 Mon Sep 17 00:00:00 2001 From: Daniel Han <23090290+danielhanchen@users.noreply.github.com> Date: Wed, 2 Dec 2026 00:25:42 -0800 Subject: [PATCH 2/2] Shorten CUDA redist cleanup comment --- .github/workflows/unsloth-sd-prebuilt.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/unsloth-sd-prebuilt.yml b/.github/workflows/unsloth-sd-prebuilt.yml index 346a845d9..2c31e6e04 100644 --- a/.github/workflows/unsloth-sd-prebuilt.yml +++ b/.github/workflows/unsloth-sd-prebuilt.yml @@ -825,8 +825,7 @@ jobs: if ($LASTEXITCODE -ne 0) { throw "extract failed: $name" } robocopy (Join-Path $stage $name) $prefix /E /NFL /NDL /NJH /NJS /NP | Out-Null if ($LASTEXITCODE -ge 8) { throw "copy failed: $name ($LASTEXITCODE)" } - # The cleanup only frees runner disk. A file still held open in the extracted tree has - # failed the cuda_crt step ("directory is not empty") and dropped the CUDA 13 assets. + # Cleanup only frees disk; a held-open file here once failed the job and dropped the CUDA 13 assets. for ($i = 1; $i -le 3; $i++) { $left = @($zip, (Join-Path $stage $name)) | Where-Object { Test-Path $_ } if (-not $left) { break }