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

update: Raise minimum Swift tools version to 5.7 #2695

Merged
merged 1 commit into from
Dec 2, 2022

Conversation

calvincestari
Copy link
Member

Closes #2688

Apollo iOS contains code that will only build with Swift 5.7, such as the new if let shorthand from SE-0435. It's not a great experience to have the project load only to result a build error if you're using a version of Xcode that doesn't support Swift 5.7; < 14.0.

This PR simply raises the required version of Swift to build the project making the user aware earlier of their tool versioning mismatch.

@netlify
Copy link

netlify bot commented Nov 30, 2022

Deploy Preview for apollo-ios-docs canceled.

Name Link
🔨 Latest commit 099c5d1
🔍 Latest deploy log https://app.netlify.com/sites/apollo-ios-docs/deploys/6386aa670f760300090c4182

@@ -16,7 +16,7 @@ struct SwiftPackageManagerModuleTemplate: TemplateRenderer {
let casedSchemaName = config.schemaName.firstUppercased

return TemplateString("""
// swift-tools-version:5.6
// swift-tools-version:5.7
Copy link
Member Author

Choose a reason for hiding this comment

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

There's nothing in ApolloAPI at the moment that would warrant this but there is no reason we couldn't use those new Swift features there.

@calvincestari calvincestari merged commit 2f1b960 into main Dec 2, 2022
@calvincestari calvincestari deleted the update/swift-tools-version branch December 2, 2022 20:59
@corymosiman12
Copy link

hmm. This doesn't feel like it should've been part of a patch release IMO. Just got the error that I can no longer build with it...just as an fyi

@calvincestari
Copy link
Member Author

That's a fair point @corymosiman12, thanks for the feedback.

It was viewed as a patch release because the current state, at the time, was broken builds on older versions of Xcode. Had this been a minor version release the situation then would have still been to stay on a broken patch release or migrate to the next minor bump.

@calvincestari
Copy link
Member Author

In retrospect we maybe should have left the generated package on 5.6, in SwiftPackageManagerTemplate.swift, since the failed builds were in ApolloCodegenLib which is not used in production shipping apps. So, my apologies for that.

@corymosiman12
Copy link

all good, I'm no pro at this either, just wanted to relay my feedback

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.

Pod install fails for versions after 1.0.3 due to VersionChecker.swift
3 participants