Skip to content

ci: scope cargo caches by runner image (fix macOS clang_rt.osx flake)#355

Merged
silverstein merged 1 commit into
mainfrom
fix/macos-ci-cache
Jun 25, 2026
Merged

ci: scope cargo caches by runner image (fix macOS clang_rt.osx flake)#355
silverstein merged 1 commit into
mainfrom
fix/macos-ci-cache

Conversation

@silverstein

Copy link
Copy Markdown
Owner

Problem (bead minutes-g6ql)

Test (macos-latest) started failing intermittently at the Build full workspace (macOS only) link step:

ld: warning: search path '/Applications/Xcode_16.4.app/.../clang/17/lib/darwin' not found
ld: library 'clang_rt.osx' not found
error: linking with `cc` failed

ubuntu and windows passed, and the same code built and tested clean locally on macOS, so it was not a code issue.

Root cause

macos-latest rotated from macOS 15 to macOS 26 (image macos-26-arm64, built 2026-06-10). That image ships only Xcode 26.x (26.0.1 through 26.5); there is no Xcode 16.4 on it. Yet the failing link referenced Xcode_16.4.app/.../clang/17/lib/darwin.

That path can only come from a stale cargo cache. The cache key was ${{ runner.os }}-cargo-..., where runner.os is just macOS for both image families. So when the image rotated 15 -> 26, the actions/cache restore matched the old macOS-15-era target/ (and registry) cache, whose build-script outputs and recorded linker search paths point at Xcode 16.4. Those paths do not exist on macOS 26, hence clang_rt.osx not found. It was intermittent because it depended on whether that stale cache happened to be restored for a given run.

Fix

Add ${{ env.ImageOS }} (e.g. macos26 vs macos15) to every cargo cache key in ci.yml and the three release workflows. An image-family rotation now produces a new cache key, so the runner builds fresh against its own toolchain instead of inheriting paths from a different image.

  • No runner change and no job-name change, so required status-check contexts are unaffected (this PR merges through normal protection).
  • Release workflows (release-macos.yml, release-cli.yml, release-windows-desktop.yml) had the same runner.os-only keys and would have hit this at tag time; fixed for consistency.

Verification

This PR touches ci.yml, so the full matrix runs here. The macOS job will miss the old cache (new key), rebuild cleanly on the image's native Xcode 26.5, and prove the fix. YAML validated locally for all four workflows.

`macos-latest` rotated from macOS 15 to macOS 26 (image built 2026-06-10).
macOS 26 ships only Xcode 26.x (no Xcode 16.4). The cargo cache key was
`${{ runner.os }}-...`, identical for both images, so the old macOS-15-era
target/ cache was restored onto macOS 26. Build-script and linker artifacts in
that cache referenced `/Applications/Xcode_16.4.app/.../clang/17/lib/darwin`,
which does not exist on macOS 26, so linking the Tauri binary failed with
`ld: library 'clang_rt.osx' not found`. Intermittent because it depended on
whether the stale cache was restored.

Add `${{ env.ImageOS }}` to every cargo cache key in CI and the release
workflows so an image rotation gets a fresh cache and never inherits toolchain
paths the new image no longer provides. No runner or job-name change, so
required status-check contexts are unaffected.
@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
useminutes.app Ready Ready Preview, Comment Jun 25, 2026 3:25am

@silverstein silverstein merged commit 447ab34 into main Jun 25, 2026
16 checks passed
@silverstein silverstein deleted the fix/macos-ci-cache branch June 25, 2026 03:46
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.

1 participant