Skip to content
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

Set Swift 6 as the minimum build tools version #610

Open
wants to merge 4 commits into
base: trunk
Choose a base branch
from

Conversation

andrewdmontgomery
Copy link
Contributor

@andrewdmontgomery andrewdmontgomery commented Dec 19, 2024

Closes #510

Description

  • Updates the Package.swift to require Swift 6 as the minimum toolchain
  • Sets each module to use the Swift 5 language
  • Updates .experimentalFeature("StrictConcurrency") (with the Swift 5 toolchain) to .enableUpcomingFeature("StrictConcurrency") (with the Swift 6 toolchain).
  • Updates the Demo project so that it explicitly uses the Swift 5 language with SWIFT_STRICT_CONCURRENCY set to complete

Testing Steps

  • TBD

@andrewdmontgomery andrewdmontgomery added the enhance New feature or request label Dec 19, 2024
@wpmobilebot
Copy link

wpmobilebot commented Dec 19, 2024

Gravatar Prototype Build📲 You can test the changes from this Pull Request in Gravatar Prototype Build by scanning the QR code below to install the corresponding build.
App NameGravatar Prototype Build Gravatar Prototype Build
Build Number1993
Version1.0
Bundle IDcom.automattic.gravatar-sdk-demo-uikit.prototype-build
Commit5bd0343
App Center BuildGravatar SDK Demo - UIKit #538
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@andrewdmontgomery andrewdmontgomery added the bug Something isn't working label Dec 20, 2024
Copy link
Contributor

@pinarol pinarol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 🎉

@andrewdmontgomery andrewdmontgomery marked this pull request as ready for review January 10, 2025 20:28
@andrewdmontgomery
Copy link
Contributor Author

andrewdmontgomery commented Jan 10, 2025

hmm... CocoaPods is problematic here.

CocoaPods does not make any distinction between "toolchain" and "language mode". We can only set SWIFT_VERSION, which is setting the "language mode".

If we leave it at 5.10, then clients with 5.10 will be able to integrate it, and they will get compile errors.

If we change it to 6.0, clients with 5.10 won't be eligible (which is good). But it applies the full Swift 6 language checks, and we get build errors when we try to use the pod (or in our case, when we lint it during CI).

With CocoaPods, we can't do what we had planned to do. There is no way to require clients to use the Swift 6.0 toolchain but still use the Swift 5 Language Mode.

We can either:

  • Leave the Podspecs on Swift 5.10 (which allows developers to use it in Swift 5.10 even though it doesn't compile)
  • Fix all the Swift 6 bugs and stop depending on Swift 5 Language Mode
  • Stop supporting CocoaPods entirely

The reasons to stop supporting CocoaPods continue to grow.

@andrewdmontgomery
Copy link
Contributor Author

I am going to revert the Podspec update so CI passes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhance New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants