Macro Adoption Concerns around SwiftSyntax

Just encountered another example of the issue. We have a package that we wanted to add an optional module to that introduced some swift-syntax code, but the act of depending on swift-syntax can cause downstream dependency resolution issues even if the optional module isn't explicitly depended on.

This means its impossible for a package to introduce a macro or other swift-syntax code without potentially breaking apps and libraries that depend on it, since they may already be depending on another version of swift-syntax. Instead we are forced to break out the optional code that needs to touch swift-syntax into its own package, which is quite a bit of work and quite laborious, both for us and for folks that want access to this new functionality.

This is really starting to feel like an impending nightmare with how pervasive swift-syntax will be in the package ecosystem, so it'd be nice to have some hope for the future of introducing dependencies on swift-syntax.

23 Likes