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 to Swift 5.9 #134

Merged
merged 5 commits into from
Jan 22, 2025
Merged

Update to Swift 5.9 #134

merged 5 commits into from
Jan 22, 2025

Conversation

fpseverino
Copy link
Member

@fpseverino fpseverino commented Jan 18, 2025

These changes are now available in 1.12.0

  • Update swift-tools-version to 5.9
  • Add common swiftSettings to targets
  • Fix unhandled files warnings
    • Templates folder in test target; added to target's resources
    • Docs.docc folder in main target; updating swift-tools-version fixes it
  • Lock was deprecated in favour of NIOLock
  • Add MUSL and iOS in CI

Copy link

codecov bot commented Jan 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.34%. Comparing base (f6a08a1) to head (20faf17).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #134      +/-   ##
==========================================
+ Coverage   82.09%   82.34%   +0.24%     
==========================================
  Files          25       25              
  Lines        2603     2617      +14     
==========================================
+ Hits         2137     2155      +18     
+ Misses        466      462       -4     
Files with missing lines Coverage Δ
Sources/LeafKit/LeafCache/DefaultLeafCache.swift 75.67% <ø> (ø)
Sources/LeafKit/LeafCache/LeafCache.swift 0.00% <ø> (ø)
Sources/LeafKit/LeafData/LeafData.swift 60.00% <100.00%> (ø)
Sources/LeafKit/LeafRenderer.swift 94.01% <100.00%> (ø)
Sources/LeafKit/LeafSerialize/LeafSerializer.swift 95.20% <100.00%> (ø)
...rces/LeafKit/LeafSerialize/ParameterResolver.swift 71.21% <ø> (ø)
Sources/LeafKit/LeafSource/LeafSources.swift 95.74% <100.00%> (+2.12%) ⬆️
Sources/LeafKit/LeafSource/NIOLeafFiles.swift 89.13% <100.00%> (-8.70%) ⬇️
Sources/LeafKit/LeafSyntax/LeafSyntax.swift 90.65% <100.00%> (ø)
Sources/LeafKit/LeafSyntax/LeafTag.swift 77.77% <ø> (-0.80%) ⬇️

... and 2 files with indirect coverage changes

Package.swift Outdated
@@ -1,4 +1,4 @@
// swift-tools-version:5.4
// swift-tools-version:5.8
Copy link
Member Author

Choose a reason for hiding this comment

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

The Docs.docc problem is solved with any version higher than 5.4, I put 5.8 only because vapor/leaf is on 5.8

Copy link
Member

Choose a reason for hiding this comment

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

The correct minimum to use at this point in time is 5.9.

Copy link
Member

Choose a reason for hiding this comment

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

Ideally you would also enable various Swift settings (most especially strict concurrency), but that would likely entail a good bit of work to clear up Sendable issues.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, I have added the common 5.9 Swift settings, the only one that required immediate changes is "ExistentialAny", strict concurrency just gives a bunch of warnings.
Should we keep the setting and warnings or should I disable it for now?

Copy link
Member Author

Choose a reason for hiding this comment

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

This PR could be revisited

Copy link
Member

Choose a reason for hiding this comment

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

Keep the warnings for now (they shouldn't appear in adopters packages I don't think) and then we can follow up with #125

@fpseverino fpseverino changed the title Fix unhandled files and NIOLock deprecation warnings Update to Swift 5.9 Jan 19, 2025
@0xTim 0xTim added the semver-minor Contains new APIs label Jan 22, 2025
@0xTim 0xTim merged commit 902c512 into vapor:main Jan 22, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-minor Contains new APIs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants