From 76bf7359aadf7699605dab161d154c657c99640f Mon Sep 17 00:00:00 2001 From: Marcin Radomski Date: Mon, 3 Feb 2025 20:37:34 +0100 Subject: [PATCH] Fix tests build on Swift 5.8 grpc-swift 1.4.1 depends on swift-nio-ssl 2.14.0+ [1]. swift-nio-ssl 2.29.1 published on 2025-01-30, introduced some code [2] that uses a "switch expression syntax" supported since Swift 5.9 [3]. Attempts to compile it with Swift 5.8 cause build errors. swift-nio-ssl project doesn't seem to support Swift 5.8. A commit from 2024-10-29 removes a "deprecated reference to a Swift 5.8 pipeline" [4]. swift-nio-ssl 2.29.0 is the last version that can be compiled with Swift 5.8. This commit pins it to that exact version. [1] https://github.com/grpc/grpc-swift/blob/66e27d7e84a2f51df6b8d5c4c3649639cfe478c1/Package.swift#L33 [2] https://github.com/apple/swift-nio-ssl/commit/3cb4d5ad12723b87f29d7031de902280f7084c81#diff-bc1db1321ff689c2819245dcce1a3080554f0fc13f81b8d326c97e7d42717c8fR54 [3] https://github.com/swiftlang/swift-evolution/blob/main/proposals/0380-if-switch-expressions.md [4] https://github.com/apple/swift-nio-ssl/commit/8a6b89d9a4079207dfdfb5c54e14f4d27301c306 --- tests/swift/tests/Package.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/swift/tests/Package.swift b/tests/swift/tests/Package.swift index c9a621e640e..723d4fc7270 100644 --- a/tests/swift/tests/Package.swift +++ b/tests/swift/tests/Package.swift @@ -26,6 +26,10 @@ let package = Package( dependencies: [ .package(path: "../../.."), .package(url: "https://github.com/grpc/grpc-swift.git", from: "1.4.1"), + // Prevent the build system from pulling 2.29.1 to prevent Swift 5.8 build breaks. + // The patch update introduced code that uses "switch expression syntax" that wasn't valid until Swift 5.9 [1]. + // [1] https://github.com/swiftlang/swift-evolution/blob/main/proposals/0380-if-switch-expressions.md + .package(url: "https://github.com/apple/swift-nio-ssl.git", exact: "2.29.0"), ], targets: [ .executableTarget(