Conversation
169d4a0 to
d0c1bc5
Compare
|
Are you saying that if your app depends on a local swift-syntax checkout, SwiftPM then uses that swift-syntax checkout for swift-macro-toolkit as well? |
|
Nope, for example:
Afair standard resolution checked out I simply cloned Sure it may not always work, but at least worked with 603 and likely to work in most cases as long as swift version matches ( |
stackotter
left a comment
There was a problem hiding this comment.
Sorry for the delay on this one. I've tested out your approach locally and it works great! In fact I've used it for multiple other packages during local development of packages with very nested dependencies (much easier than going and changing all the dependencies just to test a small change in a downstream package).
Just had a typo correction and some additional sentences that I think should provide useful context.
| > | `0.7.0` | `601.0.0` | | ||
| > | `0.8.0` | `602.0.0` | | ||
| > | ||
| > _It is also possible to use local [`swift-syntax`](https://github.com/swiftlang/swift-syntax) overrides if some other dependency pervents you from depending on newer [`swift-macro-toolkit`](https://github.com/stackotter/swift-macro-toolkit) version and vice versa. It requires cloning [`swift-syntax`](https://github.com/swiftlang/swift-syntax) into a local directory and depending your app on the local clone. Usually [`swift-syntax`](https://github.com/swiftlang/swift-syntax) updates don't break macros_ 💁♂️ |
There was a problem hiding this comment.
typo: pervents (meant to be prevents I believe)
| > | `0.7.0` | `601.0.0` | | ||
| > | `0.8.0` | `602.0.0` | | ||
| > | ||
| > _It is also possible to use local [`swift-syntax`](https://github.com/swiftlang/swift-syntax) overrides if some other dependency pervents you from depending on newer [`swift-macro-toolkit`](https://github.com/stackotter/swift-macro-toolkit) version and vice versa. It requires cloning [`swift-syntax`](https://github.com/swiftlang/swift-syntax) into a local directory and depending your app on the local clone. Usually [`swift-syntax`](https://github.com/swiftlang/swift-syntax) updates don't break macros_ 💁♂️ |
There was a problem hiding this comment.
... into a local directory and updating your app to depend on the local clone. This will force SwiftPM to use your local clone of swift-syntax throughout the whole package graph, allowing you to bypass conflicting version requirements. Note that this may fail if some macros depend on newer/older API variants. Usually swift-syntax...
Added a guide on bypassing
swift-syntaxversion resolutionNote
Some of my dependencies prevent me from using latest version of
swift-macro-toolkit, but by depending on local swift-syntax fork I managed to bypassswift-syntaxversion resolution. It's too small piece of knowledge to make some article about, but I think some folks may find it really helpful andswift-macro-toolkitlooks like a right place to mention it.