SwiftPackageIndex / SwiftPackageIndex-Server

The Swift Package Index is the place to find Swift packages!
https://swiftpackageindex.com
Apache License 2.0
547 stars 43 forks source link

Adopting Swift 6 language mode #3156

Closed gwynne closed 2 months ago

gwynne commented 3 months ago

This work is not complete in its present form. The main app itself builds in Swift 6 language mode with these changes, but due to problems with transitive language mode affecting dependencies, the tests do not yet build.

finestructure commented 3 months ago

I think we're really close now, or we might even be there with what we can do given the remaining warnings and expected upstream compiler changes.

I've added the output of a swift build --build-tests run to a gist for reference:

https://gist.github.com/finestructure/37cecd4c1b8b2c38c2850ff61358bb56

Total: 187 warnings

Xcode 16b2 counts this as a total of 41 warnings:

It's weird that Xcode counts differently and unfortunate that swift build doesn't give a count summary but that's what we've got.

@gwynne , I believe the converting non-sendable function value to '@Sendable warning is one that should go away with a compiler change/update, isn't it? I believe there was also a simple fix that we don't want to deploy because it'll be redundant with the compiler fix?

finestructure commented 3 months ago

As to the tests failures, which I'm looking into, there are currently

The Fluent issue probably affects at least some if not all of the remaining 26 test failures, TBD.

I'm in the process of preparing an easier reproducer for the SnapshotTesting crash. Brandon and Stephen haven't seen a crash like this in their testing.

finestructure commented 3 months ago

I've updated the gist after the last commit, we're now down to 0 concurrency warnings in our code 🎉

finestructure commented 2 months ago

All tests are now passing with Xcode 16b3. It's possible now to use Xcode 16b3 as the daily driver for development. (We already build and run with Swift 6 in the base image for deployment, so 15.4 was technically lagging behind.)