From dba1e232d39bde1aa62cb9bac33dfeebfc676295 Mon Sep 17 00:00:00 2001 From: Austin Wang Date: Sat, 28 Feb 2026 23:18:21 -0800 Subject: [PATCH] Fix SwiftPM binary artifact cache collision in CI (#716) 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 --- .github/workflows/ci.yml | 1 + .github/workflows/nightly.yml | 1 + .github/workflows/release.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 145bc80e..37ba0110 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -144,6 +144,7 @@ jobs: if [ "$EXIT_CODE" -ne 0 ] && echo "$OUTPUT" | grep -q "Could not resolve package dependencies"; then echo "SwiftPM package resolution failed, clearing caches and retrying once" rm -rf ~/Library/Caches/org.swift.swiftpm + mkdir -p ~/Library/Caches/org.swift.swiftpm rm -rf ~/Library/Developer/Xcode/DerivedData/GhosttyTabs-* set +e OUTPUT=$(run_unit_tests) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 052e67e3..a3cb18f8 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -128,6 +128,7 @@ jobs: - name: Clear SPM cache run: | rm -rf ~/Library/Caches/org.swift.swiftpm + mkdir -p ~/Library/Caches/org.swift.swiftpm rm -rf ~/Library/Developer/Xcode/DerivedData/GhosttyTabs-* - name: Configure SwiftPM cache diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7adf546a..84825b5f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -123,6 +123,7 @@ jobs: if: steps.guard_release_assets.outputs.skip_all != 'true' run: | rm -rf ~/Library/Caches/org.swift.swiftpm + mkdir -p ~/Library/Caches/org.swift.swiftpm rm -rf ~/Library/Developer/Xcode/DerivedData/GhosttyTabs-* - name: Configure SwiftPM cache