ITADN

SwiftPM’s implementation of package traits is incomplete or buggy

#262Opengmcusaro 创建于 2026-01-26
G
gmcusarocommented
### Description <img width="1710" height="804" alt="Image" src="https://github.com/user-attachments/assets/a39e3ed5-8829-4619-8307-cc1814e81a68" /> SwiftPM’s implementation of package traits is incomplete or buggy: • traits are ignored by the resolver • traits do not add the corresponding products All this cause the impossibility to use the package. Even if the SwiftTools version and the syntax are correct, Xcode not actually do what the docs say — yet. In addition traits may be applied at the package level, not per product. So using StructuredQueriesCasePaths or SQLiteData make impossible use it into Xcode standard project, forcing to adopt a local wrapper package. Why relying on an *experimental* Xcode feature, available only starting from version 6.1 and accessible only via Swift Package Manager, that currently doesn't work, for a dependency that also prevents using SQLiteData (great work, by the way) with [Enum tables](https://www.pointfree.co/blog/posts/186-new-in-sqlitedata-column-groups-and-inheritance)? ### Checklist - [x] I have determined whether this bug is also reproducible in a vanilla SwiftUI project. - [x] If possible, I've reproduced the issue using the `main` branch of this package. - [x] This issue hasn't been addressed in an [existing GitHub issue](https://github.com/pointfreeco/swift-structured-queries/issues) or [discussion](https://github.com/pointfreeco/swift-structured-queries/discussions). ### Expected behavior When adding swift-structured-queries as a dependency with the documented package traits enabled: ```swift .package( url: "https://github.com/pointfreeco/swift-structured-queries", from: "0.22.0", traits: [ "StructuredQueriesCasePaths", "StructuredQueriesTagged", ] ) ``` Xcode / SwiftPM should: Successfully resolve the package Apply the selected traits Allow the consuming package to build normally Not interfere with resolution or usage of other dependencies (e.g. SQLiteData) ### Actual behavior _No response_ ### Reproducing project [AquaCore.zip](https://github.com/user-attachments/files/24863952/AquaCore.zip) ### Structured Queries version information 0.2.8 ### Destination operating system iOS 26 ### Xcode version information Version 26.2 (17C52) ### Swift Compiler version information ```shell swift-driver version: 1.127.14.1 Apple Swift version 6.2.3 (swiftlang-6.2.3.3.21 clang-1700.6.3.2) Target: arm64-apple-macosx26.0 ```
2 条评论