Skip to content

fix: add Package@swift-6.1.swift for Xcode 26 compatibility#7768

Open
uny wants to merge 1 commit intogetsentry:v8.xfrom
uny:fix/xcode-26-spm-traits
Open

fix: add Package@swift-6.1.swift for Xcode 26 compatibility#7768
uny wants to merge 1 commit intogetsentry:v8.xfrom
uny:fix/xcode-26-spm-traits

Conversation

@uny
Copy link
Copy Markdown

@uny uny commented Apr 1, 2026

Problem

Xcode 26 (Swift 6.1) enforces SE-0450 Package Traits. When resolving SPM packages, it uses the version-specific manifest Package@swift-6.1.swift if available, and rejects packages that declare no traits with the error:

Disabled default traits on package 'sentry-cocoa' (Sentry) that declares no traits.
This is prohibited to allow packages to adopt traits initially without causing an API break.

This affects all users of sentry-cocoa 8.x on Xcode 26.

Solution

Add Package@swift-6.1.swift — a version-specific manifest that SPM uses when the Swift 6.1 compiler is active (Xcode 26). This is the same approach used on the main branch for 9.x.

The manifest:

  • Uses swift-tools-version:6.1 (required for traits parameter)
  • Declares traits: [.default(enabledTraits: [])] (satisfies SE-0450)
  • Adds swiftLanguageModes: [.v5] (maintains Swift 5 compatibility)
  • Points to the same 8.58.0 xcframework binaries (no SDK change)

The original Package.swift (swift-tools-version:5.3) is untouched and continues to work with older Xcode versions.

Verification

Tested on macOS 26 + Xcode 26 (Swift 6.1):

  • swift package dump-package
  • SPM resolution in Xcode 26 ✅ (no traits error)

Fixes: getsentry/sentry-kotlin-multiplatform#535

Xcode 26 uses Swift 6.1 which enforces SE-0450 Package Traits.
SPM selects version-specific manifests by swift-tools-version, so
Package@swift-6.1.swift is used when the Swift 6.1 compiler is active.

Changes:
- Add Package@swift-6.1.swift with swift-tools-version:6.1 and
  traits declaration (required by SE-0450)
- Keep original Package.swift (5.3) untouched for older toolchains
- Binary xcframework URLs remain at 8.58.0 (no SDK change)

Fixes: getsentry/sentry-kotlin-multiplatform#535
@sdk-maintainer-bot
Copy link
Copy Markdown

This PR has been automatically closed. The referenced issue is already assigned to someone else.

If you believe this assignment is outdated, please comment on the issue to discuss before opening a new PR.

Please review our contributing guidelines for more details.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


Bug Fixes 🐛


🤖 This preview updates automatically when you update the PR.

@itaybre
Copy link
Copy Markdown
Contributor

itaybre commented Apr 6, 2026

Looks like this got closed automatically

I am reopening it

@itaybre itaybre reopened this Apr 6, 2026
@uny uny marked this pull request as ready for review April 7, 2026 23:00
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2652b58. Configure here.

.binaryTarget(
name: "Sentry",
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.58.0/Sentry.xcframework.zip",
checksum: "d883f19575ab064633237c2c58ee16a1e596c58f5efe1c110f65998bc71b0389"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing checksum comment markers break release automation scripts

High Severity

The checksum lines in Package@swift-6.1.swift are missing the comment markers (e.g., //Sentry-Static, //Sentry-Dynamic, etc.) that Package.swift has. The release script scripts/update-package-sha.sh uses sed patterns matching these exact comments to update checksums during releases. Since the new file is discovered by the script (via find . -name "Package@swift-*.swift") but lacks the markers, the sed replacements will silently fail, leaving stale checksums. The scripts/verify-package-sha.sh script will then fail when it can't grep for these markers, blocking the release pipeline.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2652b58. Configure here.

.binaryTarget(
name: "Sentry",
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.58.0/Sentry.xcframework.zip",
checksum: "d883f19575ab064633237c2c58ee16a1e596c58f5efe1c110f65998bc71b0389"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

New manifest not in VersionBump files list

High Severity

The Utils/VersionBump/main.swift utility, which is invoked during releases via scripts/bump.sh, has a hardcoded files array that includes ./Package.swift but not ./Package@swift-6.1.swift. The updateVersion function does string replacement of the old version number with the new one in each listed file. Since the new manifest isn't listed, its download URLs (containing the version like 8.58.0) will remain stale after future version bumps, causing Xcode 26 users to download the wrong xcframework binaries.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2652b58. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants