-
Notifications
You must be signed in to change notification settings - Fork 420
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
Swift 6-ify the package manifest #1955
Conversation
Motivation: v2 will require the Swift 6 language mode. In order to continue developing v1 and v2 on main we'll need a Swift 6 specific manifest version in addition to the 5.x version. Moving forward we'll have two package manifests, `Package.swift` for 5.x containing only v1, and `[email protected]` using tools version 6.0 targetting v1 and v2. Modifications: - Remove v2 targets from Package.swift - Add a second manifest and make it warning free with Swift 6, this requires turning `static let`s to `static var`s. - Conditionalise some imports in `protoc-gen-grpc-swift` (as it is shared by v1 and v2) - Fix an error in the plugin for Swift 6 Result: v2 now only compiles with a Swift 6 compiler
.atomics | ||
], | ||
path: "Sources/GRPCCore", | ||
swiftSettings: [.swiftLanguageVersion(.v5)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to adopt Swift 6 language version for the v2 packages? Or not yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to make the changes in a separate PR to keep the diff small(er). This way we can do it module by module (or at least do the larger ones separately)
if options.v2 { | ||
#if compiler(>=6.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we fatalError
(or error in some other way) if the compiler is not Swift 6+ but the v2 option is set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, good question. I think we should actually put the v2 option behind the compiler guard too tbh.
Motivation:
v2 will require the Swift 6 language mode. In order to continue developing v1 and v2 on main we'll need a Swift 6 specific manifest version in addition to the 5.x version.
Moving forward we'll have two package manifests,
Package.swift
for 5.x containing only v1, and[email protected]
using tools version 6.0 targetting v1 and v2.Modifications:
static let
s tostatic var
s.protoc-gen-grpc-swift
(as it is shared by v1 and v2)Result:
v2 now only compiles with a Swift 6 compiler