Fix watchOS build failure on Xcode 27 - #52
Merged
Recouse merged 1 commit intoAug 27, 2026
Conversation
Xcode 27 raises the minimum watchOS deployment target from 4.0 to 9.0, so
the package's declared `.watchOS(.v6)` floor is clamped up to 9.0. That
collides exactly with the `obsoleted: 9.0` annotation on the private
`split(by:)` back-deployment fallback:
error: 'split(by:)' is unavailable in watchOS:
This method is not recommended on watchOS 9.0+
Sitting in the `else` of `if #available(..., watchOS 9.0, *)` does not help:
an `#available` else branch does not lower the availability context, so the
call is still checked against the deployment target and rejected.
Drop the `@available` attributes from the helper and rename it to
`legacySplit(by:)`. They were decorative on a fileprivate method nothing
outside the file could call, but they broke the build. This also removes the
need for the `#if os(visionOS)` special case added in 1c45c73, which worked
around the same root cause.
iOS and macOS are one OS release from hitting this too (clamped to 15.0/12.0
against `obsoleted:` 16.0/13.0), so removing the annotations avoids a repeat
on the next toolchain.
Deployment targets in Package.swift are unchanged; this is not a breaking
change for consumers.
Verified: clean builds on watchOS, iOS, tvOS, visionOS and macOS under
Xcode 27.0 beta (27A5252f); still builds under Xcode 26.6; all 7 tests pass.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Recouse
approved these changes
Aug 27, 2026
Owner
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The package fails to compile for watchOS with Xcode 27 beta:
Cause
Xcode 27 raises the minimum supported deployment targets, so the floors declared in
Package.swiftget clamped upward:obsoleted:atPackage.swiftdeclares.watchOS(.v6), so Xcode 26 compiled with-target arm64-apple-watchos6.0and the fallback was legal. Xcode 27 clamps towatchos9.0, which meetsobsoleted: 9.0exactly and makes the symbol a hard error.Being inside the
elseofif #available(..., watchOS 9.0, *)does not rescue it — an#availableelse branch does not lower the availability context, so the call is still checked against the deployment target.Fix
Remove the
@availableattributes from thefileprivatefallback and rename itlegacySplit(by:). They were decorative on a method nothing outside the file could call, but they broke the build. This also removes the need for the#if os(visionOS)special case added in 1c45c73, which worked around the same root cause on a different platform.iOS and macOS are only one OS release away from the same collision (clamped to 15.0/12.0 against
obsoleted:16.0/13.0), so removing the annotations rather than bumping them should prevent a repeat on the next toolchain.Deployment targets in
Package.swiftare unchanged — not a breaking change for consumers.Verification
One note: the fallback path isn't exercised by the test suite —
#availabletakes the modern branch on the test host — but the body is byte-identical to before, only renamed.🤖 Generated with Claude Code