Fix SPM binary artifact cache conflict on macos-26 runners#119
Fix SPM binary artifact cache conflict on macos-26 runners#119sozercan merged 2 commits intosozercan:mainfrom
Conversation
The `macos-26` GitHub Actions runner image pre-populates `~/Library/Caches/org.swift.swiftpm/artifacts` with a conflicting path for the Sparkle 2.9.0 binary target. SPM detects the existing path and hard-fails rather than overwriting it: ``` error: failed downloading 'Sparkle-for-Swift-Package-Manager.zip': .../artifacts/https___github_com_sparkle_project_Sparkle_releases_download_2_9_0_... already exists in file system ``` --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Goooler <10363352+Goooler@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates CI workflows to avoid SwiftPM binary artifact download failures on macos-26 runners caused by a pre-populated, conflicting artifacts cache path.
Changes:
- Clear
~/Library/Caches/org.swift.swiftpm/artifactsbefore running unit tests onmacos-26. - Clear the same SwiftPM artifacts cache before building/running UI tests on
macos-26. - Clear the artifacts cache before the dev build workflow runs on
macos-26.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| .github/workflows/tests.yml | Adds an artifacts-cache cleanup step to both unit-test and UI-test jobs to prevent Sparkle binary target cache conflicts. |
| .github/workflows/dev-build.yml | Adds the same artifacts-cache cleanup step to prevent SwiftPM binary artifact conflicts during dev builds. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Clear SPM artifacts cache | ||
| run: rm -rf ~/Library/Caches/org.swift.swiftpm/artifacts |
There was a problem hiding this comment.
This cache-clearing step is duplicated in both macOS jobs in this workflow. To reduce future drift, consider factoring it into a YAML anchor/alias (within this file) or a small composite action reused by both jobs.
There was a problem hiding this comment.
This is fine for now. However, it looks more like a workaround.
| run: swift --version | ||
|
|
||
| - name: Clear SPM artifacts cache | ||
| run: rm -rf ~/Library/Caches/org.swift.swiftpm/artifacts |
There was a problem hiding this comment.
Using an unquoted ~ path relies on shell-specific tilde expansion. Prefer "$HOME/Library/Caches/org.swift.swiftpm/artifacts" (quoted) to be more robust/portable across shells.
| run: swift --version | ||
|
|
||
| - name: Clear SPM artifacts cache | ||
| run: rm -rf ~/Library/Caches/org.swift.swiftpm/artifacts |
There was a problem hiding this comment.
Using an unquoted ~ path relies on shell-specific tilde expansion. Prefer "$HOME/Library/Caches/org.swift.swiftpm/artifacts" (quoted) to be more robust/portable across shells.
| run: rm -rf ~/Library/Caches/org.swift.swiftpm/artifacts | |
| run: rm -rf "$HOME/Library/Caches/org.swift.swiftpm/artifacts" |
Match the fix from PR #119 for dev-build and tests workflows. The macos-26 runner image can pre-populate SPM binary artifact caches that cause Sparkle download failures.
Description
The
macos-26GitHub Actions runner image pre-populates~/Library/Caches/org.swift.swiftpm/artifactswith a conflicting path for the Sparkle 2.9.0 binary target. SPM detects the existing path and hard-fails rather than overwriting it:For more details, see https://github.com/Goooler/kaset/actions/runs/22512301281/job/65223785012.
AI Prompt (Optional)
Addressed from Goooler#7.
🤖 AI Prompt Used
https://github.com/Goooler/kaset/tasks/22489069-a89b-4c37-a87f-b5e4b81f2eaf?author=Goooler
AI Tool:
Type of Change
Testing
xcodebuild test -only-testing:KasetTests)Checklist
swiftlint --strict && swiftformat .