Skip to content

fix(build-windows): tolerate dead sccache server in CUDA retry path - #604

Merged
michaelneale merged 1 commit into
mainfrom
micn/sccache-stop-tolerant
May 20, 2026
Merged

fix(build-windows): tolerate dead sccache server in CUDA retry path#604
michaelneale merged 1 commit into
mainfrom
micn/sccache-stop-tolerant

Conversation

@michaelneale

Copy link
Copy Markdown
Collaborator

The CUDA ABI build has a retry-once-after-sccache-restart path in Invoke-CmakeBuild. It calls sccache --stop-server to clean up before retrying cmake. When the sccache server has already crashed (which is precisely the case this retry path exists to handle), sccache --stop-server exits non-zero with 'couldn't connect to server'.

Because the script runs under $ErrorActionPreference = 'Stop', the non-zero native exit is promoted to a terminating PowerShell error and the catch block re-throws before the retry cmake invocation ever runs. mesh-llm.exe is therefore never produced and the downstream package-release.ps1 fails with 'Required file not found'.

Wrap the --stop-server call in a localized
$ErrorActionPreference = 'Continue' block (and restore the prior value) so a dead server is silently ignored and the retry proceeds. Reset-SccacheStats further down already uses this exact pattern for the same reason.

Observed in the v0.66.0-rc5 release run on Build Windows CUDA:
sccache: error: failed to execute compile
sccache: caused by: An existing connection was forcibly closed
by the remote host. (os error 10054)
WARNING: CUDA ABI build failed while using sccache; restarting
sccache and retrying once.
sccache: error: couldn't connect to server
error: recipe release-build-cuda-windows failed on line 173

The CUDA ABI build has a retry-once-after-sccache-restart path in
`Invoke-CmakeBuild`. It calls `sccache --stop-server` to clean up
before retrying cmake. When the sccache server has already crashed
(which is precisely the case this retry path exists to handle),
`sccache --stop-server` exits non-zero with 'couldn't connect to
server'.

Because the script runs under `$ErrorActionPreference = 'Stop'`,
the non-zero native exit is promoted to a terminating PowerShell
error and the catch block re-throws before the retry cmake invocation
ever runs. `mesh-llm.exe` is therefore never produced and the
downstream `package-release.ps1` fails with 'Required file not found'.

Wrap the `--stop-server` call in a localized
`$ErrorActionPreference = 'Continue'` block (and restore the prior
value) so a dead server is silently ignored and the retry proceeds.
`Reset-SccacheStats` further down already uses this exact pattern
for the same reason.

Observed in the v0.66.0-rc5 release run on Build Windows CUDA:
  sccache: error: failed to execute compile
  sccache: caused by: An existing connection was forcibly closed
    by the remote host. (os error 10054)
  WARNING: CUDA ABI build failed while using sccache; restarting
    sccache and retrying once.
  sccache: error: couldn't connect to server
  error: recipe `release-build-cuda-windows` failed on line 173
Copilot AI review requested due to automatic review settings May 20, 2026 07:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the Windows CUDA build retry flow in Invoke-CmakeBuild so that a crashed/dead sccache server does not prevent the retry from running, ensuring the build can still produce mesh-llm.exe for downstream packaging.

Changes:

  • Wraps sccache --stop-server in a localized $ErrorActionPreference = "Continue" block during the CUDA retry path.
  • Restores the prior $ErrorActionPreference via try/finally to avoid impacting subsequent script behavior.

@michaelneale
michaelneale merged commit 13f34f9 into main May 20, 2026
24 checks passed
@michaelneale
michaelneale deleted the micn/sccache-stop-tolerant branch May 20, 2026 08:31
michaelneale added a commit that referenced this pull request May 20, 2026
The Windows CUDA release lane has been failing deterministically because
`scripts/install-windows-sdk.ps1` does `choco install cuda` which pulls
the latest CUDA Toolkit (currently 13.2). sccache 0.15.0 cannot parse
nvcc 13.2 output and crashes mid-build with:

  sccache: error: failed to execute compile
  sccache: caused by: An existing connection was forcibly closed by the
    remote host. (os error 10054)

This is the documented incompatibility in mozilla/sccache#2470 (CUDA +
MSVC + Ninja). PR #604 made the in-script retry tolerate a dead sccache
server, which let the retry actually run — but the retry hits the same
deterministic crash on the same file (argsort.cu), so the workflow
still failed on rc6.

CI's Windows CUDA lane has been working because it pins CUDA via
`Jimver/cuda-toolkit@v0.2.35` to `vars.CUDA_VERSION || '12.6.3'`
(currently 12.8.0 in repo vars). Mirror that setup here for the
release lane: install CUDA via the same pinned action for the cuda
matrix entry, and keep `install-windows-sdk.ps1` for rocm/vulkan
where it works correctly.

Validated by:
- PR #604 PR CI Windows CUDA succeeded with the same Jimver+12.8.0 path
- Release rc5/rc6 Windows CUDA failed with choco+13.2 path

Other Windows lanes (CPU, ROCm, Vulkan) keep using
`install-windows-sdk.ps1` unchanged.
michaelneale added a commit that referenced this pull request May 21, 2026
Brings in #579 advisory capacity, #583 hardened materialization cache,
#562 version bump, #606/#604 Windows CUDA build fixes, #608 lint rule,
and #560 UI mockup.

* origin/main:
  fix(ci): small update for lint rule (#608)
  mockup: Reserves high-fidelity UI mockup (#560)
  Add advisory capacity evaluation for model targets (#579)
  Harden Skippy layer package materialization cache (#583)
  fix(release): pin Windows CUDA to sccache-compatible version (#606)
  fix(build-windows): tolerate dead sccache server in CUDA retry path (#604)
  chore(version): synchronize version bump everywhere (#562)
michaelneale added a commit that referenced this pull request May 21, 2026
* main:
  docs(AGENTS): add confidence-testing recipe for routing/MoA/gossip changes (#613)
  ci(sdk-smoke): install lld in macOS swift smoke job (#610)
  MoA: mesh mode and many inference critical fixes, and quic keep alive (#566)
  fix(ci): small update for lint rule (#608)
  mockup: Reserves high-fidelity UI mockup (#560)
  Add advisory capacity evaluation for model targets (#579)
  Harden Skippy layer package materialization cache (#583)
  fix(release): pin Windows CUDA to sccache-compatible version (#606)
  fix(build-windows): tolerate dead sccache server in CUDA retry path (#604)
  chore(version): synchronize version bump everywhere (#562)
  fix(mesh): skip filtered peers in gossip dial loop to unwedge `--auto` (#602)
  docs(agents): clarify just build vs release-build for serious testing (#599)
  build: ozempic — slim binary -42 MB / -47 MB (#592)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants