Swift 6.2 / Xcode 26 compatibility: swift-syntax upper bound excludes 620.x #278
Replies: 2 comments 7 replies
|
Hi @mjcaboose001,
This is not how versioning works for Swift Syntax. The release "602.0.0" corresponds to Swift 6.2. You can see this by looking at the release page for Swift Syntax: https://github.com/swiftlang/swift-syntax/releases
This sounds more like a misconfigured project than something wrong with this library. You will need to provide a reproducing project for us to understand what issue you are running into. But I'm pretty sure this isn't an issue with the library, so I am going to convert it to a discussion. Please feel free to continue the conversation over there! |
|
Gotcha - was also able to reproduce cleanly on a blank Flutter with just sqlite-data added. It's failing on two macro packages:
Reproduction: bash Then add sqlite-data 1.5.1 from https://github.com/pointfreeco/sqlite-data as a Swift Package dependency to the Runner target in Xcode. bash Environment: Flutter 3.41.4 Result: Build fails with "Unable to find module dependency" for SwiftSyntax, SwiftBasicFormat, SwiftParser etc. in both swift-structured-queries and swift-perception macro targets. No custom code, just a blank Flutter app. |
Uh oh!
There was an error while loading. Please reload this page.
Description
The current Package.swift constrains swift-syntax to "600.0.0"..<"603.0.0", which excludes Swift 6.2 (620.x) shipped with Xcode 26. This causes Swift macro compilation to fail with "malformed response" errors on Xcode 26.2 and 26.3.
The fix is a one-line change to expand the upper bound:
swift
// current
.package(url: "https://github.com/swiftlang/swift-syntax", "600.0.0"..<"603.0.0")
// suggested
.package(url: "https://github.com/swiftlang/swift-syntax", "600.0.0"..<"621.0.0")
This affects downstream consumers including sqlite-data and immich-app/immich whose iOS app uses sqlite-data. The same fix is needed in sqlite-data's Package.swift once swift-structured-queries ships a new release.
Environment:
Xcode 26.2 and 26.3
Swift 6.2 (620.x)
swift-structured-queries 0.31.0
sqlite-data 1.6.0
Checklist
mainbranch of this package.Expected behavior
Adding swift-structured-queries as a dependency and building a project with Swift macros should succeed on Xcode 26 / Swift 6.2.
Actual behavior
Building fails with Swift compiler errors:
Swift Compiler Error: External macro implementation type 'StructuredQueriesMacros.TableMacro' could not be found; '...StructuredQueriesMacros' produced malformed response
This affects all macro types including TableMacro, ColumnMacro, SelectionMacro, etc. The root cause is that Package.swift constrains swift-syntax to "600.0.0"..<"603.0.0", which excludes Swift 6.2 (620.x). Swift macro plugins must be built with a swift-syntax version matching the host compiler, so the macro binary produces a malformed response when run under Swift 6.2.
Reproducing project
No standalone project needed. The issue is directly visible in Package.swift:
swift.package(url: "https://github.com/swiftlang/swift-syntax", "600.0.0"..<"603.0.0")
The upper bound needs to be extended to include 620.x. Suggested fix:
swift.package(url: "https://github.com/swiftlang/swift-syntax", "600.0.0"..<"621.0.0")
Structured Queries version information
0.31.0
Destination operating system
iOS
Xcode version information
26.2 (17C52) and 26.3 (17C529)
Swift Compiler version information
All reactions