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

Adoption of Swift 6 features #310

Open
3 tasks
rebello95 opened this issue Oct 14, 2024 · 1 comment
Open
3 tasks

Adoption of Swift 6 features #310

rebello95 opened this issue Oct 14, 2024 · 1 comment

Comments

@rebello95
Copy link
Collaborator

I'm opening an issue to track some low-hanging fruit with regard to Swift 6 features that we should explore in Connect-Swift:

  • Enforcing strict concurrency: I believe all these warnings were fixed with Add more Sendable conformances to resolve warnings #309, but we should switch the toolchain to Swift 6 to enforce this
  • Typed throws: Would it make sense to add throws(ConnectError) in some places?
  • Utilize package visibility: The files in this directory are commented as internal-only but are public so they can be consumed by ConnectNIO. We can make these package instead once running on the updated toolchain to remove these from the public interface

We are currently blocked on fully adopting Swift 6 by apple/swift-protobuf#1729.

rebello95 added a commit that referenced this issue Oct 17, 2024
This PR adds deprecation warnings to APIs that are considered
package-internal but cannot yet be marked as `package` instead of
`public` until we adopt Swift 6 (see
#310). We can't make
these APIs _currently_ deprecated since that will introduce deprecation
warnings where they're used within the library, but we can at least add
_future deprecation_ warnings which will show up in the IDE as shown
below:

<img width="684" alt="Screenshot 2024-10-16 at 11 27 45 AM"
src="https://github.com/user-attachments/assets/be489f7f-bf32-466d-8aa3-1fc999bba0c6">

The goal of doing this is to help enable us to tag a 1.0 before adopting
Swift 6 so we can mark those APIs as `package` afterwards and reasonably
consider it a non-breaking change.

---------

Signed-off-by: Michael Rebello <[email protected]>
@rebello95
Copy link
Collaborator Author

rebello95 commented Jan 6, 2025

#331 will allow us to compile with Swift 6

rebello95 added a commit that referenced this issue Jan 9, 2025
After some discussion in
apple/swift-protobuf#1729, I noticed that the
compilation error when building with Swift 6 is actually an issue with
the config in `Tests/UnitTests/ConnectLibraryTests/buf.gen.yaml` which
was still running on `1.25.2` instead of `1.28.2` like other parts of
the project.

Changes in this PR:

- Updates that directory to run on `1.28.2` which includes
apple/swift-protobuf@3bc7630
and resolves the problem described in the aforementioned issue
- Switches CI to use Xcode 16.2 and macOS 15
- Switches our `Package.swift` to use Swift 6 when available via
`swiftLanguageVersions: [.version("6"), .v5]`
- Updates the Eliza SPM app to use Swift 6

This is related to
#310, but we will not
be able to actually implement those until we fully switch to using Swift
6 (a breaking change).

---------

Signed-off-by: Michael Rebello <[email protected]>
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

No branches or pull requests

1 participant