Skip to content

Add Swift Macro Compatibility Check GitHub Action #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Matejkob
Copy link

@Matejkob Matejkob commented Oct 5, 2024

This pull request introduces the Swift Macro Compatibility Check GitHub Action into the CI workflow. This action verifies that the Swift package remains compatible with multiple versions of swift-syntax, which is critical for macro-based functionality.

Motivation for Adding This Check:

  1. swift-syntax Versioning Complexity: As detailed by Point-Free in their article, "Being a good citizen in the land of SwiftSyntax", swift-syntax employs a versioning scheme where minor versions of Swift correspond to major versions of swift-syntax (e.g., SwiftSyntax 509.0 maps to Swift 5.9). This scheme introduces complexity in maintaining compatibility across versions.

  2. Frequent Breaking Changes: Minor releases of swift-syntax have introduced breaking changes, which can cause issues with existing macros and dependencies. This action helps ensure that our macros remain functional across these versions.

  3. Dependency Graph Resolution: By testing against multiple versions, we can prevent dependency conflicts in the broader Swift ecosystem. This is essential, especially as more libraries are adopting macros and using swift-syntax, increasing the likelihood of conflicting dependencies.

  4. Proactive Development: Catching compatibility issues early in the development cycle allows us to resolve them before they become critical, reducing the risk of blocked releases or difficult debugging sessions later.

Important

To ensure the library can be used alongside others in the Swift packages, it need to support all versions of swift-syntax. Without this compatibility, users may face issues where they can't use several libraries together if they depend on different versions of swift-syntax.

kevin-kp added a commit to kevin-kp/papyrus that referenced this pull request Oct 7, 2024
@kevin-kp
Copy link
Contributor

kevin-kp commented Oct 8, 2024

@Matejkob

I copied your PR to my fork of this repository and it seemed that the formatting was a bit wrong.
I have fixed it in my fork but it will probably need fixing in your PR as well.

@Matejkob
Copy link
Author

Matejkob commented Oct 9, 2024

@kevin-kp Thanks for letting me know. I've updated the configuration file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants