Skip to content

Fix SPM binary artifact cache conflict on macos-26 runners#119

Merged
sozercan merged 2 commits intosozercan:mainfrom
Goooler:fix-action-run-error
Feb 28, 2026
Merged

Fix SPM binary artifact cache conflict on macos-26 runners#119
sozercan merged 2 commits intosozercan:mainfrom
Goooler:fix-action-run-error

Conversation

@Goooler
Copy link
Contributor

@Goooler Goooler commented Feb 28, 2026

Description

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

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

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 📚 Documentation update
  • 🎨 UI/UX improvement
  • ♻️ Refactoring (no functional changes)
  • 🧪 Test update
  • 🔧 Build/CI configuration

Testing

  • Unit tests pass (xcodebuild test -only-testing:KasetTests)
  • Manual testing performed
  • UI tested on macOS 26+

Checklist

  • My code follows the project's style guidelines
  • I have run swiftlint --strict && swiftformat .
  • I have added tests that prove my fix/feature works
  • New and existing unit tests pass locally
  • I have updated documentation if needed
  • I have checked for any performance implications
  • My changes generate no new warnings

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>
Copilot AI review requested due to automatic review settings February 28, 2026 03:37
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/artifacts before running unit tests on macos-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.

Comment on lines +41 to +42
- name: Clear SPM artifacts cache
run: rm -rf ~/Library/Caches/org.swift.swiftpm/artifacts
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~ should be fine.

run: swift --version

- name: Clear SPM artifacts cache
run: rm -rf ~/Library/Caches/org.swift.swiftpm/artifacts
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
run: rm -rf ~/Library/Caches/org.swift.swiftpm/artifacts
run: rm -rf "$HOME/Library/Caches/org.swift.swiftpm/artifacts"

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~ should be fine.

sozercan added a commit that referenced this pull request Feb 28, 2026
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.
@sozercan sozercan merged commit f9ab586 into sozercan:main Feb 28, 2026
4 checks passed
@Goooler Goooler deleted the fix-action-run-error branch February 28, 2026 05:53
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.

4 participants