Skip to content

Conversation

dfed
Copy link

@dfed dfed commented Sep 2, 2025

Apollo V2 is currently enableExperimentalFeature swift settings that are meant for Package files using the Swift 5.9 and 5.10 toolchains. The packages in this repo are all using swift-tools-version:6.1.

Per Enabling Complete Concurrency Checking:

When using Swift 6.0 tools or later, use [SwiftSetting.enableUpcomingFeature](https://developer.apple.com/documentation/packagedescription/swiftsetting/enableupcomingfeature(_:_:)) in the Swift settings for the given target

We could change enableExperimentalFeature to enableUpcomingFeature, as suggested by the above. But based on local testing, the targets in the Package.swift files in this repo already build in Swift 6 Language Mode, so I enabled it.

Feel free to close this out if it's not what you want just yet – I know I'm jumping the gun going straight to a PR here. Note that this PR is against the v2-alpha branch, which may not be the right place. It seemed like the most up-to-date branch, but I may have missed something.

@AnthonyMDev
Copy link
Contributor

I actually had done this the other day locally, and then reverted it because I couldn't find any clear documentation of how this affected compatibility with Swift 5 code. Maybe you are more familiar with this than I am.

If we merge this PR and enable Swift 6 language mode, will the library still be able to be linked to user's code if they are using Swift 5? My understanding is that the answer is yes, but I haven't been able to find a definitive answer to that question, so I was hesitant to make the switch.

@AnthonyMDev AnthonyMDev changed the base branch from v2-alpha to v2-staging September 2, 2025 16:26
@AnthonyMDev
Copy link
Contributor

Also, changing this to be based on the v2-staging branch. :)

@dfed
Copy link
Author

dfed commented Sep 2, 2025

If we merge this PR and enable Swift 6 language mode, will the library still be able to be linked to user's code if they are using Swift 5? My understanding is that the answer is yes, but I haven't been able to find a definitive answer to that question, so I was hesitant to make the switch.

Yes! Swift 5 can depend on Swift 6 code, and visa versa. The bigger constraint is your swift-tools-version: by setting swift-tools-version:6.1, you are dropping support for Xcode versions that do not have the Swift 6.1 compiler available (Xcode 16.2 and earlier). My guess is that's intentional though.

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