Skip to content

Fix SwiftPM binary artifact cache collision in CI - #716

Merged
austinywang merged 1 commit into
mainfrom
fix-spm-cache-artifacts
Mar 1, 2026
Merged

austinywang merged 1 commit into
mainfrom
fix-spm-cache-artifacts

Conversation

@austinywang

@austinywang austinywang commented Mar 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • After rm -rf ~/Library/Caches/org.swift.swiftpm, immediately mkdir -p the directory so SwiftPM gets a clean empty cache instead of colliding with stale binary artifact paths on the self-hosted runner.
  • Applied to all three workflows: nightly.yml, release.yml, and ci.yml.
  • Fixes: failed downloading 'Sentry.xcframework.zip': ...already exists in file system error from nightly run 22538356196.

Test plan

  • Merge and re-trigger nightly build
  • Verify the "Build app (Release)" step passes without SPM artifact collision

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Improved build pipeline reliability by ensuring proper cache directory handling across continuous integration, nightly, and release workflows.

After rm -rf of the SPM cache dir, recreate it as an empty directory
so binary target downloads (e.g. Sentry.xcframework.zip) don't hit
"already exists in file system" errors from stale artifacts on the
self-hosted runner.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Mar 1, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
cmux Building Building Preview, Comment Mar 1, 2026 7:17am

@coderabbitai

coderabbitai Bot commented Mar 1, 2026 •

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9d00ae9 and c926252.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml
  • .github/workflows/nightly.yml
  • .github/workflows/release.yml

📝 Walkthrough

Walkthrough

Three GitHub workflow files receive identical additions that create the SwiftPM cache directory after clearing it. The change ensures the required cache directory path exists before subsequent workflow steps execute, applied consistently across CI, nightly, and release pipelines.

Changes

Cohort / File(s) Summary
SwiftPM Cache Directory Recreation
.github/workflows/ci.yml, .github/workflows/nightly.yml, .github/workflows/release.yml
Added mkdir -p ~/Library/Caches/org.swift.swiftpm command after cache clearing to ensure the directory exists for subsequent pipeline steps.

Estimated Code Review Effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly Related PRs

Poem

🐰 A cache cleared, but lo! The path must remain,
mkdir hops in with paws to sustain,
Three workflows now skip and never shall strain,
For the directory awaits, through sun and through rain! 🌤️

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-spm-cache-artifacts

Comment @coderabbitai help to get the list of available commands and usage tips.

@austinywang
austinywang merged commit dba1e23 into main Mar 1, 2026
8 of 9 checks passed
@greptile-apps

greptile-apps Bot commented Mar 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds mkdir -p ~/Library/Caches/org.swift.swiftpm immediately after rm -rf in all three CI workflows to ensure SwiftPM receives a clean empty cache directory. This prevents binary artifact collision errors (Sentry.xcframework.zip already exists in file system) that occurred on self-hosted runners when the cache was cleared but not recreated. The fix is applied consistently to nightly.yml, release.yml, and ci.yml workflows.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Simple defensive fix that adds directory creation after cache removal. The change is idempotent (mkdir -p won't fail if directory exists), consistent across all workflows, and directly addresses a documented production error without introducing complexity or side effects.
  • No files require special attention

Important Files Changed

Filename Overview
.github/workflows/nightly.yml Added mkdir -p after cache removal to ensure clean empty directory for SwiftPM
.github/workflows/ci.yml Added mkdir -p in retry logic to ensure clean cache directory after removal
.github/workflows/release.yml Added mkdir -p after cache removal to prevent artifact collision issues

Last reviewed commit: c926252

@coderabbitai coderabbitai Bot mentioned this pull request Mar 6, 2026
2 tasks
bn-l pushed a commit to bn-l/cmux that referenced this pull request Apr 3, 2026
After rm -rf of the SPM cache dir, recreate it as an empty directory
so binary target downloads (e.g. Sentry.xcframework.zip) don't hit
"already exists in file system" errors from stale artifacts on the
self-hosted runner.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview — c9262527 Deployed Mar 1, 2026 by vercel[bot]
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