diff --git a/TLSify/Package.swift b/TLSify/Package.swift index 2420756..c1b4ec7 100644 --- a/TLSify/Package.swift +++ b/TLSify/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.9 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftNIO open source project @@ -19,10 +19,6 @@ let strictConcurrencyDevelopment = false let strictConcurrencySettings: [SwiftSetting] = { var initialSettings: [SwiftSetting] = [] - initialSettings.append(contentsOf: [ - .enableUpcomingFeature("StrictConcurrency"), - .enableUpcomingFeature("InferSendableFromCaptures"), - ]) if strictConcurrencyDevelopment { // -warnings-as-errors here is a workaround so that IDE-based development can diff --git a/UniversalBootstrapDemo/Package.swift b/UniversalBootstrapDemo/Package.swift index 0b7b566..3887cbd 100644 --- a/UniversalBootstrapDemo/Package.swift +++ b/UniversalBootstrapDemo/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.9 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftNIO open source project @@ -19,10 +19,6 @@ let strictConcurrencyDevelopment = false let strictConcurrencySettings: [SwiftSetting] = { var initialSettings: [SwiftSetting] = [] - initialSettings.append(contentsOf: [ - .enableUpcomingFeature("StrictConcurrency"), - .enableUpcomingFeature("InferSendableFromCaptures"), - ]) if strictConcurrencyDevelopment { // -warnings-as-errors here is a workaround so that IDE-based development can diff --git a/backpressure-file-io-channel/Package.swift b/backpressure-file-io-channel/Package.swift index 60b3302..989c197 100644 --- a/backpressure-file-io-channel/Package.swift +++ b/backpressure-file-io-channel/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.9 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftNIO open source project @@ -19,10 +19,6 @@ let strictConcurrencyDevelopment = false let strictConcurrencySettings: [SwiftSetting] = { var initialSettings: [SwiftSetting] = [] - initialSettings.append(contentsOf: [ - .enableUpcomingFeature("StrictConcurrency"), - .enableUpcomingFeature("InferSendableFromCaptures"), - ]) if strictConcurrencyDevelopment { // -warnings-as-errors here is a workaround so that IDE-based development can diff --git a/backpressure-file-io-channel/Tests/BackpressureChannelToFileIOTests/IntegrationTest.swift b/backpressure-file-io-channel/Tests/BackpressureChannelToFileIOTests/IntegrationTest.swift index 90383a0..524de26 100644 --- a/backpressure-file-io-channel/Tests/BackpressureChannelToFileIOTests/IntegrationTest.swift +++ b/backpressure-file-io-channel/Tests/BackpressureChannelToFileIOTests/IntegrationTest.swift @@ -72,7 +72,7 @@ final class IntegrationTest: XCTestCase { // And write a byte. self.testToChannel.write(Data("X".utf8)) - final class InjectReadHandler: ChannelInboundHandler { + final class InjectReadHandler: ChannelInboundHandler, Sendable { typealias InboundIn = ByteBuffer func handlerAdded(context: ChannelHandlerContext) { @@ -88,7 +88,9 @@ final class IntegrationTest: XCTestCase { // To make sure that EOF is seen, we'll inject a `read()` because otherwise there won't be reads because the // HTTP server implements backpressure correctly... The read injection handler has to go at the very beginning // of the pipeline so the HTTP server can't hold that `read()`. - XCTAssertNoThrow(try self.channel.pipeline.addHandler(InjectReadHandler(), position: .first).wait()) + XCTAssertNoThrow( + try self.channel.pipeline.addHandler(InjectReadHandler(), position: .first).wait() + ) XCTAssertNoThrow(try self.channel.closeFuture.wait()) self.channel = nil // So tearDown doesn't close it again. @@ -138,19 +140,21 @@ extension IntegrationTest { var maybeChannel: Channel? = nil XCTAssertNoThrow( try maybeChannel = NIOPipeBootstrap(group: group) - .channelInitializer { channel in + .channelInitializer { [fileIO, tempDir] channel in channel.pipeline.configureHTTPServerPipeline(withErrorHandling: false).flatMap { - channel.pipeline.addHandler( - SaveEverythingHTTPServer( - fileIO: self.fileIO, - uploadDirectory: self.tempDir + channel.eventLoop.makeCompletedFuture { + try channel.pipeline.syncOperations.addHandler( + SaveEverythingHTTPServer( + fileIO: fileIO, + uploadDirectory: tempDir + ) ) - ) + } } } - .withPipes( - inputDescriptor: dup(testToChannel.fileHandleForReading.fileDescriptor), - outputDescriptor: dup(channelToTest.fileHandleForWriting.fileDescriptor) + .takingOwnershipOfDescriptors( + input: dup(testToChannel.fileHandleForReading.fileDescriptor), + output: dup(channelToTest.fileHandleForWriting.fileDescriptor) ) .wait() ) diff --git a/connect-proxy/Package.swift b/connect-proxy/Package.swift index f983b80..60956c3 100644 --- a/connect-proxy/Package.swift +++ b/connect-proxy/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.9 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftNIO open source project @@ -19,10 +19,6 @@ let strictConcurrencyDevelopment = false let strictConcurrencySettings: [SwiftSetting] = { var initialSettings: [SwiftSetting] = [] - initialSettings.append(contentsOf: [ - .enableUpcomingFeature("StrictConcurrency"), - .enableUpcomingFeature("InferSendableFromCaptures"), - ]) if strictConcurrencyDevelopment { // -warnings-as-errors here is a workaround so that IDE-based development can diff --git a/http-responsiveness-server/Package.swift b/http-responsiveness-server/Package.swift index 391e612..3a9373a 100644 --- a/http-responsiveness-server/Package.swift +++ b/http-responsiveness-server/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.9 +// swift-tools-version: 6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftNIO open source project @@ -19,10 +19,6 @@ let strictConcurrencyDevelopment = false let strictConcurrencySettings: [SwiftSetting] = { var initialSettings: [SwiftSetting] = [] - initialSettings.append(contentsOf: [ - .enableUpcomingFeature("StrictConcurrency"), - .enableUpcomingFeature("InferSendableFromCaptures"), - ]) if strictConcurrencyDevelopment { // -warnings-as-errors here is a workaround so that IDE-based development can @@ -49,7 +45,6 @@ let package = Package( url: "https://github.com/apple/swift-nio-extras.git", revision: "4804de1953c14ce71cfca47a03fb4581a6b3301c" ), - .package(url: "https://github.com/apple/swift-http-types.git", from: "1.1.0"), .package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.4.0"), .package(url: "https://github.com/swift-extras/swift-extras-json.git", from: "0.6.0"), .package(url: "https://github.com/apple/swift-nio-transport-services.git", from: "1.23.0"), diff --git a/http2-client/Package.swift b/http2-client/Package.swift index 1a071bd..959f9fa 100644 --- a/http2-client/Package.swift +++ b/http2-client/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.9 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftNIO open source project @@ -19,10 +19,6 @@ let strictConcurrencyDevelopment = false let strictConcurrencySettings: [SwiftSetting] = { var initialSettings: [SwiftSetting] = [] - initialSettings.append(contentsOf: [ - .enableUpcomingFeature("StrictConcurrency"), - .enableUpcomingFeature("InferSendableFromCaptures"), - ]) if strictConcurrencyDevelopment { // -warnings-as-errors here is a workaround so that IDE-based development can diff --git a/http2-server/Package.swift b/http2-server/Package.swift index 7ae97bf..229843f 100644 --- a/http2-server/Package.swift +++ b/http2-server/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.9 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftNIO open source project @@ -19,10 +19,6 @@ let strictConcurrencyDevelopment = false let strictConcurrencySettings: [SwiftSetting] = { var initialSettings: [SwiftSetting] = [] - initialSettings.append(contentsOf: [ - .enableUpcomingFeature("StrictConcurrency"), - .enableUpcomingFeature("InferSendableFromCaptures"), - ]) if strictConcurrencyDevelopment { // -warnings-as-errors here is a workaround so that IDE-based development can diff --git a/json-rpc/Package.swift b/json-rpc/Package.swift index 545a7be..fffaae7 100644 --- a/json-rpc/Package.swift +++ b/json-rpc/Package.swift @@ -19,10 +19,6 @@ let strictConcurrencyDevelopment = false let strictConcurrencySettings: [SwiftSetting] = { var initialSettings: [SwiftSetting] = [] - initialSettings.append(contentsOf: [ - .enableUpcomingFeature("StrictConcurrency"), - .enableUpcomingFeature("InferSendableFromCaptures"), - ]) if strictConcurrencyDevelopment { // -warnings-as-errors here is a workaround so that IDE-based development can diff --git a/json-rpc/Tests/JsonRpcTests/JsonRpcTests.swift b/json-rpc/Tests/JsonRpcTests/JsonRpcTests.swift index de58b85..9d6b7fb 100644 --- a/json-rpc/Tests/JsonRpcTests/JsonRpcTests.swift +++ b/json-rpc/Tests/JsonRpcTests/JsonRpcTests.swift @@ -123,8 +123,8 @@ final class JSONRPCTests: XCTestCase { let expectedResponse = RPCObject("ok") for expectedParam in expectedParams { // start server - let server = TCPServer(group: eventLoopGroup) { _, params, callback in - XCTAssertEqual(expectedParams, params, "expected params to match") + let server = TCPServer(group: eventLoopGroup) { _, param, callback in + XCTAssertEqual(expectedParam, param, "expected params to match") callback(.success(expectedResponse)) } _ = try! server.start(host: address.0, port: address.1).wait() @@ -132,7 +132,7 @@ final class JSONRPCTests: XCTestCase { let client = TCPClient(group: eventLoopGroup) _ = try! client.connect(host: address.0, port: address.1).wait() // perform the method call - let result = try! client.call(method: "test", params: expectedParams).wait() + let result = try! client.call(method: "test", params: expectedParam).wait() switch result { case .success(let response): XCTAssertEqual(expectedResponse, response, "expected result ot match") diff --git a/nio-launchd/Package.swift b/nio-launchd/Package.swift index 5830291..2d159b9 100644 --- a/nio-launchd/Package.swift +++ b/nio-launchd/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.9 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftNIO open source project @@ -19,10 +19,6 @@ let strictConcurrencyDevelopment = false let strictConcurrencySettings: [SwiftSetting] = { var initialSettings: [SwiftSetting] = [] - initialSettings.append(contentsOf: [ - .enableUpcomingFeature("StrictConcurrency"), - .enableUpcomingFeature("InferSendableFromCaptures"), - ]) if strictConcurrencyDevelopment { // -warnings-as-errors here is a workaround so that IDE-based development can