Skip to content

Support watchOS arm64_32 build variants for String.UTF8View#20

Merged
agnosticdev merged 1 commit into
mainfrom
agnosticdev/watchOS_32Bit_SpanSupport
Jun 16, 2026
Merged

Support watchOS arm64_32 build variants for String.UTF8View#20
agnosticdev merged 1 commit into
mainfrom
agnosticdev/watchOS_32Bit_SpanSupport

Conversation

@agnosticdev

Copy link
Copy Markdown
Collaborator

SwiftNIO QUIC has a macOS Tests Swift 6.3 build variant that is failing due to arm64_32 builds for the watchOS toolchain tripping up on Span in the String.UTF8View type.

/Users/runner/Library/Developer/Xcode/DerivedData/swift-nio-quic-aizjhmmkhpwybjavsacfgpunzsnd/SourcePackages/checkouts/swift-network-evolution/Sources/SwiftNetwork/Utilities/Serializer.swift:545:36: error: 'span' is unavailable in watchOS
        let utf8Bytes = value.utf8.span.bytes
                                   ^~~~
Swift.String.UTF8View.span:4:16: note: 'span' has been explicitly marked unavailable here
    public var span: Span<UTF8.CodeUnit> { get }  }
               ^
/Users/runner/Library/Developer/Xcode/DerivedData/swift-nio-quic-aizjhmmkhpwybjavsacfgpunzsnd/SourcePackages/checkouts/swift-network-evolution/Sources/SwiftNetwork/Utilities/Serializer.swift:760:36: error: 'span' is unavailable in watchOS
        let utf8Bytes = value.utf8.span.bytes.extracting(first: byteCount)
                                   ^~~~
Swift.String.UTF8View.span:4:16: note: 'span' has been explicitly marked unavailable here
    public var span: Span<UTF8.CodeUnit> { get }  }

This is in-fact not supported by the compiler, see here:
https://github.com/swiftlang/swift/blob/51b0b4aa41f28eae7d96af6f98c1fbd2b4b63958/stdlib/public/core/StringUTF8View.swift#L386

This change adds a compiler directive to check for arm64_32 variants of watchOS and provide compatibility support there. All other 64 bit variants and other platforms use Span in a normal fashion.

@agnosticdev agnosticdev requested a review from rnro June 16, 2026 14:39
@agnosticdev agnosticdev merged commit 1b7579b into main Jun 16, 2026
20 checks passed
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.

3 participants