SwiftLint: Xcode cannot resolve package dependencies for Swift Package project with version 0.50.0
New Issue Checklist
- Updated SwiftLint to the latest version
- I searched for existing GitHub issues
Describe the bug
When trying to use SwiftLint 0.50.0 in a Swift Package project, Xcode 14.1 fails to resolve dependencies because SwiftLint is dependent on an unstable version of SwiftSyntax.
Environment
- SwiftLint version 0.50.0
- Xcode 14.1
- Swift Package Manager
.package(url: "https://github.com/realm/SwiftLint.git", from: "0.50.0")
Error: “Failed to resolve dependencies Dependencies could not be resolved because root depends on ‘swiftlint’ 0.50.0…<1.0.0. ‘swiftlint’ >= 0.50.0 cannot be used because no versions of ‘swiftlint’ match the requirement 0.50.1…<1.0.0 and package ‘swiftlint’ is required using a stable-version but ‘swiftlint’ depends on an unstable-version package ‘swift-syntax’.”
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 4
- Comments: 19 (2 by maintainers)
I think you can work around this by pinning to an exact version of SwiftLint:
So instead of
from:userevision:.@jpsim FWIW: I can’t use revision because I’m using it on several internal libraries, which then means anything that imports those libraries has to use revision, because it then has a dependency on SwiftLint, which is unstable.
This also goes for any OSS lib that wants to use SwiftLint via SPM. I don’t think leaving it at “just point to a specific revision” is going to be a long term workable solution.
LMK if I can help twist some arms to get a release cut somewhere.
Apple shenanigans 🤷