ci: scope cargo caches by runner image (fix macOS clang_rt.osx flake)#355
Merged
Conversation
`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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem (bead
minutes-g6ql)Test (macos-latest)started failing intermittently at theBuild full workspace (macOS only)link step: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-latestrotated from macOS 15 to macOS 26 (imagemacos-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 referencedXcode_16.4.app/.../clang/17/lib/darwin.That path can only come from a stale cargo cache. The cache key was
${{ runner.os }}-cargo-..., whererunner.osis justmacOSfor both image families. So when the image rotated 15 -> 26, the actions/cache restore matched the old macOS-15-eratarget/(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, henceclang_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.macos26vsmacos15) to every cargo cache key inci.ymland 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.release-macos.yml,release-cli.yml,release-windows-desktop.yml) had the samerunner.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.