Skip to content

Commit c7f73ff

Browse files
authored
Merge branch 'main' into queue_outbound_close
2 parents 7e7c6b9 + 0270310 commit c7f73ff

File tree

8 files changed

+48
-23
lines changed

8 files changed

+48
-23
lines changed

Diff for: .github/workflows/macos_tests.yml

+28-9
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ on:
9696
description: "Boolean to enable the Xcode test targeting visionOS. Defaults to false."
9797
default: false
9898

99+
runner_pool:
100+
type: string
101+
description: "The runner pool which will be requested."
102+
default: "nightly"
103+
99104
jobs:
100105
construct-matrix:
101106
name: Construct Darwin matrix
@@ -111,6 +116,7 @@ jobs:
111116
run: |
112117
cat >> "$GITHUB_OUTPUT" << EOM
113118
darwin-matrix=$(
119+
runner_pool="${MATRIX_RUNNER_POOL:="nightly"}"
114120
xcode_15_4_enabled="${MATRIX_MACOS_15_4_ENABLED:=true}"
115121
xcode_15_4_build_arguments_override="${MATRIX_MACOS_15_4_BUILD_ARGUMENTS_OVERRIDE:=""}"
116122
xcode_15_4_test_arguments_override="${MATRIX_MACOS_15_4_TEST_ARGUMENTS_OVERRIDE:=""}"
@@ -128,29 +134,42 @@ jobs:
128134
matrix='{"config": []}'
129135
130136
if [[ "$xcode_15_4_enabled" == "true" ]]; then
131-
matrix=$(echo "$matrix" | jq -c \
132-
'.config[.config| length] |= . + { "name": "Xcode 15.4", "xcode_version": "15.4", "build_arguments_override": "${xcode_15_4_build_arguments_override}", "test_arguments_override": "${xcode_15_4_test_arguments_override}", "os": "sequoia", "arch": "ARM64"}')
137+
matrix=$(echo "$matrix" | jq -c \
138+
--arg build_arguments_override "$xcode_15_4_build_arguments_override" \
139+
--arg test_arguments_override "$xcode_15_4_test_arguments_override" \
140+
--arg runner_pool "$runner_pool" \
141+
'.config[.config| length] |= . + { "name": "Xcode 15.4", "xcode_version": "15.4", "build_arguments_override": $build_arguments_override, "test_arguments_override": $test_arguments_override, "os": "sequoia", "arch": "ARM64", "pool": $runner_pool }')
133142
fi
134143
135144
if [[ "$xcode_16_0_enabled" == "true" ]]; then
136-
matrix=$(echo "$matrix" | jq -c \
137-
'.config[.config| length] |= . + { "name": "Xcode 16.0", "xcode_version": "16.0", "build_arguments_override": "${xcode_16_0_build_arguments_override}", "test_arguments_override": "${xcode_16_0_test_arguments_override}", "os": "sequoia", "arch": "ARM64"}')
145+
matrix=$(echo "$matrix" | jq -c \
146+
--arg build_arguments_override "$xcode_16_0_build_arguments_override" \
147+
--arg test_arguments_override "$xcode_16_0_test_arguments_override" \
148+
--arg runner_pool "$runner_pool" \
149+
'.config[.config| length] |= . + { "name": "Xcode 16.0", "xcode_version": "16.0", "build_arguments_override": $build_arguments_override, "test_arguments_override": $test_arguments_override, "os": "sequoia", "arch": "ARM64", "pool": $runner_pool }')
138150
fi
139151
140152
if [[ "$xcode_16_1_enabled" == "true" ]]; then
141-
matrix=$(echo "$matrix" | jq -c \
142-
'.config[.config| length] |= . + { "name": "Xcode 16.1", "xcode_version": "16.1", "build_arguments_override": "${xcode_16_1_build_arguments_override}", "test_arguments_override": "${xcode_16_1_test_arguments_override}", "os": "sequoia", "arch": "ARM64"}')
153+
matrix=$(echo "$matrix" | jq -c \
154+
--arg build_arguments_override "$xcode_16_1_build_arguments_override" \
155+
--arg test_arguments_override "$xcode_16_1_test_arguments_override" \
156+
--arg runner_pool "$runner_pool" \
157+
'.config[.config| length] |= . + { "name": "Xcode 16.1", "xcode_version": "16.1", "build_arguments_override": $build_arguments_override, "test_arguments_override": $test_arguments_override, "os": "sequoia", "arch": "ARM64", "pool": $runner_pool }')
143158
fi
144159
145160
if [[ "$xcode_16_2_enabled" == "true" ]]; then
146-
matrix=$(echo "$matrix" | jq -c \
147-
'.config[.config| length] |= . + { "name": "Xcode 16.2", "xcode_version": "16.2", "build_arguments_override": "${xcode_16_2_build_arguments_override}", "test_arguments_override": "${xcode_16_2_test_arguments_override}", "os": "sequoia", "arch": "ARM64"}')
161+
matrix=$(echo "$matrix" | jq -c \
162+
--arg build_arguments_override "$xcode_16_2_build_arguments_override" \
163+
--arg test_arguments_override "$xcode_16_2_test_arguments_override" \
164+
--arg runner_pool "$runner_pool" \
165+
'.config[.config| length] |= . + { "name": "Xcode 16.2", "xcode_version": "16.2", "build_arguments_override": $build_arguments_override, "test_arguments_override": $test_arguments_override, "os": "sequoia", "arch": "ARM64", "pool": $runner_pool }')
148166
fi
149167
150168
echo "$matrix" | jq -c
151169
)"
152170
EOM
153171
env:
172+
MATRIX_RUNNER_POOL: ${{ inputs.runner_pool }}
154173
MATRIX_MACOS_15_4_ENABLED: ${{ inputs.xcode_15_4_enabled }}
155174
MATRIX_MACOS_15_4_BUILD_ARGUMENTS_OVERRIDE: ${{ inputs.xcode_15_4_build_arguments_override }}
156175
MATRIX_MACOS_15_4_TEST_ARGUMENTS_OVERRIDE: ${{ inputs.xcode_15_4_test_arguments_override }}
@@ -167,7 +186,7 @@ jobs:
167186
darwin-job:
168187
name: ${{ matrix.config.name }}
169188
needs: construct-matrix
170-
runs-on: [self-hosted, macos, "${{ matrix.config.os }}", "${{ matrix.config.arch }}"]
189+
runs-on: [self-hosted, macos, "${{ matrix.config.os }}", "${{ matrix.config.arch }}", "${{ matrix.config.pool }}"]
171190
strategy:
172191
fail-fast: false
173192
matrix: ${{ fromJson(needs.construct-matrix.outputs.darwin-matrix) }}

Diff for: .github/workflows/main.yml

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ jobs:
6565
# Workaround https://github.com/nektos/act/issues/1875
6666
uses: apple/swift-nio/.github/workflows/macos_tests.yml@main
6767
with:
68+
runner_pool: nightly
6869
build_scheme: swift-nio-Package
6970
macos_xcode_test_enabled: false # Disabled because of an issue
7071
ios_xcode_test_enabled: true

Diff for: .github/workflows/pull_request.yml

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ jobs:
8282
# Workaround https://github.com/nektos/act/issues/1875
8383
uses: apple/swift-nio/.github/workflows/macos_tests.yml@main
8484
with:
85+
runner_pool: general
8586
build_scheme: swift-nio-Package
8687

8788
static-sdk:

Diff for: Package.swift

+6-3
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,8 @@ let package = Package(
363363
"NIOHTTP1",
364364
"NIOWebSocket",
365365
],
366-
exclude: ["README.md"]
366+
exclude: ["README.md"],
367+
swiftSettings: strictConcurrencySettings
367368
),
368369
.executableTarget(
369370
name: "NIOWebSocketClient",
@@ -373,7 +374,8 @@ let package = Package(
373374
"NIOHTTP1",
374375
"NIOWebSocket",
375376
],
376-
exclude: ["README.md"]
377+
exclude: ["README.md"],
378+
swiftSettings: strictConcurrencySettings
377379
),
378380
.executableTarget(
379381
name: "NIOMulticastChat",
@@ -407,7 +409,8 @@ let package = Package(
407409
"NIOPosix",
408410
"NIOCore",
409411
"NIOHTTP1",
410-
]
412+
],
413+
swiftSettings: strictConcurrencySettings
411414
),
412415

413416
// MARK: - Tests

Diff for: README.md

+4-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ It's like [Netty](https://netty.io), but written for Swift.
1111

1212
The SwiftNIO project is split across multiple repositories:
1313

14-
Repository | NIO 2 (Swift 5.7+)
14+
Repository | NIO 2
1515
--- | ---
1616
[https://github.com/apple/swift-nio][repo-nio] <br> SwiftNIO core | `from: "2.0.0"`
1717
[https://github.com/apple/swift-nio-ssl][repo-nio-ssl] <br> TLS (SSL) support | `from: "2.0.0"`
@@ -20,8 +20,6 @@ Repository | NIO 2 (Swift 5.7+)
2020
[https://github.com/apple/swift-nio-transport-services][repo-nio-transport-services] <br> first-class support for macOS, iOS, tvOS, and watchOS | `from: "1.0.0"`
2121
[https://github.com/apple/swift-nio-ssh][repo-nio-ssh] <br> SSH support | `.upToNextMinor(from: "0.2.0")`
2222

23-
NIO 2.29.0 and older support Swift 5.0+, NIO 2.39.0 and older support Swift 5.2+.
24-
2523
Within this repository we have a number of products that provide different functionality. This package contains the following products:
2624

2725
- `NIO`. This is an umbrella module exporting `NIOCore`, `NIOEmbedded` and `NIOPosix`.
@@ -73,10 +71,10 @@ This is the current version of SwiftNIO and will be supported for the foreseeabl
7371

7472
### Swift Versions
7573

76-
We commit to support the most recently released swift version (currently 5.10) and the last two minor releases before that unless this is impossible to do in one codebase.
77-
In addition checks are run against the latest beta release (if any) as well as the nightly swift builds and the intent is that these should pass.
74+
We commit to support the most recently released Swift version and the last two minor releases before that unless this is impossible to do in one codebase.
75+
In addition checks are run against the latest beta release (if any) as well as the nightly Swift builds and the intent is that these should pass.
7876

79-
The most recent versions of SwiftNIO support Swift 5.9 and newer. The minimum Swift version supported by SwiftNIO releases are detailed below:
77+
The minimum Swift version supported by SwiftNIO releases are detailed below:
8078

8179
SwiftNIO | Minimum Swift Version
8280
--------------------|----------------------

Diff for: Sources/NIOAsyncAwaitDemo/AsyncChannelIO.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import NIOCore
1616
import NIOHTTP1
1717

1818
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
19-
struct AsyncChannelIO<Request, Response> {
19+
struct AsyncChannelIO<Request: Sendable, Response: Sendable> {
2020
let channel: Channel
2121

2222
init(_ channel: Channel) {

Diff for: Sources/NIOAsyncAwaitDemo/FullRequestResponse.swift

+5-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import NIOCore
1818
import NIOHTTP1
1919

20-
public final class MakeFullRequestHandler: ChannelOutboundHandler {
20+
public final class MakeFullRequestHandler: ChannelOutboundHandler, Sendable {
2121
public typealias OutboundOut = HTTPClientRequestPart
2222
public typealias OutboundIn = HTTPRequestHead
2323

@@ -40,7 +40,7 @@ public final class MakeFullRequestHandler: ChannelOutboundHandler {
4040
///
4141
/// `RequestResponseHandler` requires that the `Response`s arrive on `Channel` in the same order as the `Request`s
4242
/// were submitted.
43-
public final class RequestResponseHandler<Request, Response>: ChannelDuplexHandler {
43+
public final class RequestResponseHandler<Request: Sendable, Response: Sendable>: ChannelDuplexHandler {
4444
public typealias InboundIn = Response
4545
public typealias InboundOut = Never
4646
public typealias OutboundIn = (Request, EventLoopPromise<Response>)
@@ -129,3 +129,6 @@ public final class RequestResponseHandler<Request, Response>: ChannelDuplexHandl
129129
}
130130
}
131131
}
132+
133+
@available(*, unavailable)
134+
extension RequestResponseHandler: Sendable {}

Diff for: scripts/install_static_sdk.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ if [[ -n "$branch" ]]; then
7878
elif [[ -n "$version" ]]; then
7979
if [[ "$version" == "latest" ]]; then
8080
log "Discovering latest version"
81-
version=$(curl -s https://www.swift.org/api/v1/install/releases.json | jq -r '.[-1].tag' | sed -E 's/swift-([0-9]+\.[0-9]+\.[0-9]+)-RELEASE/\1/')
81+
version=$(curl -s https://www.swift.org/api/v1/install/releases.json | jq -r '.[-1].tag' | sed -E 's/swift-([0-9]+\.[0-9]+\.?[0-9]*)-RELEASE/\1/')
8282
if [[ -z "$version" ]]; then
8383
fatal "Failed to discover latest Swift version"
8484
fi
@@ -132,4 +132,4 @@ log "Checking swift"
132132
swift --version
133133

134134
log "Installing Static SDK"
135-
swift sdk install "$static_sdk_path"
135+
swift sdk install "$static_sdk_path"

0 commit comments

Comments
 (0)