Skip to content

Commit 741b6e8

Browse files
committed
Merge remote-tracking branch 'apple/main'
* apple/main: (26 commits) [GHA] Only format Swift files that are in Git index (apple#2797) Ignore format commit from git blame (apple#2796) Adopt swift-format (apple#2794) Disable warnings as errors on Swift 6 and main (apple#2793) ChannelHandler: provide static (un)wrap(In|Out)bound(In|Out) (apple#2791) Add manual control to NIOLockedValueBox (apple#2786) [GHA] Cxx interoperability compatibility and integration tests check (apple#2790) [GHA] Introduce reusable matrix workflow (apple#2789) Fix benchmark thresholds update script (apple#2783) [GHA] Broken symlink and format check (apple#2787) [GHA] Add license header check (apple#2781) Improved documentation for HTTP Parts to clarify how often each part is received (apple#2775) [GHA] Download the scripts to make workflow reusable (apple#2785) Combine the two NIOAsyncChannel channel handlers (apple#2779) [GHA] Benchmark job (apple#2780) [GHA] Move docs check to script (apple#2776) Add benchmark for creating NIOAsyncChannel (apple#2774) Avoid creating a yield ID counter per async writer (apple#2768) [GHA] Unacceptable language check (apple#2766) Allow in-place mutation of `NIOLoopBoundBox.value` (apple#2771) ... # Conflicts: # Sources/NIOPosix/BSDSocketAPICommon.swift # Sources/NIOPosix/GetaddrinfoResolver.swift # Sources/NIOPosix/HappyEyeballs.swift
2 parents e469385 + 2841257 commit 741b6e8

File tree

426 files changed

+26092
-15879
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

426 files changed

+26092
-15879
lines changed

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Adopt swift-format
2+
c9756e108351a1def2e2c83ff5ee6fb9bcbc3bbf

.github/workflows/pull_request.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Pull Request
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, synchronize]
6+
7+
jobs:
8+
call-pull-request-soundness-workflow:
9+
name: Soundness
10+
uses: ./.github/workflows/pull_request_soundness.yml
11+
with:
12+
license_header_check_project_name: "SwiftNIO"
13+
14+
call-pull-request-unit-tests-workflow:
15+
name: Unit tests
16+
uses: ./.github/workflows/pull_request_swift_matrix.yml
17+
with:
18+
name: "Unit tests"
19+
matrix_linux_command: "swift test -Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
20+
# Disable warnings as errors: Swift 6 emits sendability warnings that haven't been dealt with yet.
21+
matrix_linux_nightly_main_command_override: "swift test --explicit-target-dependency-import-check error"
22+
matrix_linux_nightly_6_0_command_override: "swift test --explicit-target-dependency-import-check error"
23+
24+
call-pull-request-benchmark-workflow:
25+
name: Benchmarks
26+
uses: ./.github/workflows/pull_request_swift_matrix.yml
27+
with:
28+
name: "Benchmarks"
29+
matrix_linux_command: "apt-get update -y -q && apt-get install -y -q libjemalloc-dev && swift package --package-path Benchmarks/ --disable-sandbox benchmark baseline check --check-absolute-path Benchmarks/Thresholds/${SWIFT_VERSION}/"
30+
31+
call-pull-request-cxx-interop-workflow:
32+
name: Cxx interop
33+
uses: ./.github/workflows/pull_request_swift_matrix.yml
34+
with:
35+
name: "Cxx interop"
36+
matrix_linux_command: "apt-get update -y -q && apt-get install -y -q jq && ./scripts/check-cxx-interop-compatibility.sh"
37+
38+
call-pull-request-integration-tests-workflow:
39+
name: Integration tests
40+
uses: ./.github/workflows/pull_request_swift_matrix.yml
41+
with:
42+
name: "Integration tests"
43+
matrix_linux_command: "apt-get update -y -q && apt-get install -y -q lsof dnsutils netcat-openbsd net-tools curl jq && ./scripts/integration_tests.sh"
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
name: Pull Request
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
api_breakage_check_enabled:
7+
type: boolean
8+
description: "Boolean to enable the API breakage check job. Defaults to true."
9+
default: true
10+
docs_check_enabled:
11+
type: boolean
12+
description: "Boolean to enable the docs check job. Defaults to true."
13+
default: true
14+
unacceptable_language_check_enabled:
15+
type: boolean
16+
description: "Boolean to enable the acceptable language check job. Defaults to true."
17+
default: true
18+
unacceptable_language_check_word_list:
19+
type: string
20+
description: "List of unacceptable words. Defaults to a sensible list of words."
21+
default: "blacklist whitelist slave master sane sanity insane insanity kill killed killing hang hung hanged hanging" #ignore-unacceptable-language
22+
license_header_check_enabled:
23+
type: boolean
24+
description: "Boolean to enable the license header check job. Defaults to true."
25+
default: true
26+
license_header_check_project_name:
27+
type: string
28+
description: "Name of the project called out in the license header."
29+
required: true
30+
broken_symlink_check_enabled:
31+
type: boolean
32+
description: "Boolean to enable the broken symlink check job. Defaults to true."
33+
default: true
34+
format_check_enabled:
35+
type: boolean
36+
description: "Boolean to enable the format check job. Defaults to true."
37+
default: true
38+
39+
## We are cancelling previously triggered workflow runs
40+
concurrency:
41+
group: ${{ github.workflow }}-${{ github.ref }}-soundness
42+
cancel-in-progress: true
43+
44+
jobs:
45+
api-breakage-check:
46+
name: API breakage check
47+
if: ${{ inputs.api_breakage_check_enabled }}
48+
runs-on: ubuntu-latest
49+
container:
50+
image: swift:5.10-noble
51+
timeout-minutes: 20
52+
steps:
53+
- name: Checkout repository
54+
uses: actions/checkout@v4
55+
with:
56+
# We need to fetch everything otherwise only the head commit will be fetched.
57+
fetch-depth: 0
58+
- name: Mark the workspace as safe
59+
# https://github.com/actions/checkout/issues/766
60+
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
61+
- name: Run API breakage check
62+
run: swift package diagnose-api-breaking-changes origin/main
63+
64+
docs-check:
65+
name: Documentation check
66+
if: ${{ inputs.docs_check_enabled }}
67+
runs-on: ubuntu-latest
68+
container:
69+
image: swift:5.10-noble
70+
timeout-minutes: 20
71+
steps:
72+
- name: Checkout repository
73+
uses: actions/checkout@v4
74+
- name: Run documentation check
75+
run: |
76+
apt-get -qq update && apt-get -qq -y install curl
77+
curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-docs.sh | bash
78+
79+
unacceptable-language-check:
80+
name: Unacceptable language check
81+
if: ${{ inputs.unacceptable_language_check_enabled }}
82+
runs-on: ubuntu-latest
83+
timeout-minutes: 1
84+
steps:
85+
- name: Checkout repository
86+
uses: actions/checkout@v4
87+
- name: Run unacceptable language check
88+
env:
89+
UNACCEPTABLE_WORD_LIST: ${{ inputs.unacceptable_language_check_word_list}}
90+
run: curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-unacceptable-language.sh | bash
91+
92+
license-header-check:
93+
name: License headers check
94+
if: ${{ inputs.license_header_check_enabled }}
95+
runs-on: ubuntu-latest
96+
timeout-minutes: 1
97+
steps:
98+
- name: Checkout repository
99+
uses: actions/checkout@v4
100+
- name: Run license header check
101+
env:
102+
PROJECT_NAME: ${{ inputs.license_header_check_project_name }}
103+
run: curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-license-header.sh | bash
104+
105+
broken-symlink-check:
106+
name: Broken symlinks check
107+
if: ${{ inputs.broken_symlink_check_enabled }}
108+
runs-on: ubuntu-latest
109+
timeout-minutes: 1
110+
steps:
111+
- name: Checkout repository
112+
uses: actions/checkout@v4
113+
- name: Run broken symlinks check
114+
run: curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-broken-symlinks.sh | bash
115+
116+
format-check:
117+
name: Format check
118+
if: ${{ inputs.format_check_enabled }}
119+
runs-on: ubuntu-latest
120+
container:
121+
image: swiftlang/swift:nightly-6.0-jammy
122+
timeout-minutes: 5
123+
steps:
124+
- name: Checkout repository
125+
uses: actions/checkout@v4
126+
- name: Mark the workspace as safe
127+
# https://github.com/actions/checkout/issues/766
128+
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
129+
- name: Format Swift files
130+
run: git ls-files -z '*.swift' | xargs -0 swift format format --parallel --in-place
131+
- name: Lint Swift files
132+
run: git ls-files -z '*.swift' | xargs -0 swift format lint --strict --parallel
133+
- name: Check format produced no diff
134+
run: GIT_PAGER= git diff --exit-code '*.swift'
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Pull Request
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
name:
7+
type: string
8+
description: "The name of the workflow used for the concurrency group."
9+
required: true
10+
matrix_linux_command:
11+
type: string
12+
description: "The command of the current Swift version linux matrix job to execute."
13+
required: true
14+
matrix_linux_5_8_enabled:
15+
type: boolean
16+
description: "Boolean to enable the 5.8 Swift version matrix job. Defaults to true."
17+
default: true
18+
matrix_linux_5_8_command_override:
19+
type: string
20+
description: "The command of the 5.8 Swift version linux matrix job to execute."
21+
matrix_linux_5_9_enabled:
22+
type: boolean
23+
description: "Boolean to enable the 5.9 Swift version matrix job. Defaults to true."
24+
default: true
25+
matrix_linux_5_9_command_override:
26+
type: string
27+
description: "The command of the 5.9 Swift version linux matrix job to execute."
28+
matrix_linux_5_10_enabled:
29+
type: boolean
30+
description: "Boolean to enable the 5.10 Swift version matrix job. Defaults to true."
31+
default: true
32+
matrix_linux_5_10_command_override:
33+
type: string
34+
description: "The command of the 5.10 Swift version linux matrix job to execute."
35+
matrix_linux_nightly_6_0_enabled:
36+
type: boolean
37+
description: "Boolean to enable the nightly 6.0 Swift version matrix job. Defaults to true."
38+
default: true
39+
matrix_linux_nightly_6_0_command_override:
40+
type: string
41+
description: "The command of the nightly 6.0 Swift version linux matrix job to execute."
42+
matrix_linux_nightly_main_enabled:
43+
type: boolean
44+
description: "Boolean to enable the nightly main Swift version matrix job. Defaults to true."
45+
default: true
46+
matrix_linux_nightly_main_command_override:
47+
type: string
48+
description: "The command of the nightly main Swift version linux matrix job to execute."
49+
50+
## We are cancelling previously triggered workflow runs
51+
concurrency:
52+
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.name }}
53+
cancel-in-progress: true
54+
55+
jobs:
56+
linux:
57+
name: ${{ matrix.swift.swift_version }}
58+
runs-on: ubuntu-latest
59+
strategy:
60+
fail-fast: false
61+
matrix:
62+
# We are specifying only the major and minor of the docker images to automatically pick up the latest patch release
63+
swift:
64+
- image: swift:5.8-jammy
65+
swift_version: "5.8"
66+
enabled: ${{ inputs.matrix_linux_5_8_enabled }}
67+
- image: swift:5.9-jammy
68+
swift_version: "5.9"
69+
enabled: ${{ inputs.matrix_linux_5_9_enabled }}
70+
- image: swift:5.10-jammy
71+
swift_version: "5.10"
72+
enabled: ${{ inputs.matrix_linux_5_10_enabled }}
73+
- image: swiftlang/swift:nightly-6.0-jammy
74+
swift_version: "nightly-6.0"
75+
enabled: ${{ inputs.matrix_linux_nightly_6_0_enabled }}
76+
- image: swiftlang/swift:nightly-main-jammy
77+
swift_version: "nightly-main"
78+
enabled: ${{ inputs.matrix_linux_nightly_main_enabled }}
79+
container:
80+
image: ${{ matrix.swift.image }}
81+
steps:
82+
- name: Checkout repository
83+
uses: actions/checkout@v4
84+
- name: Run matrix job
85+
if: ${{ matrix.swift.enabled }}
86+
env:
87+
SWIFT_VERSION: ${{ matrix.swift.swift_version }}
88+
COMMAND: ${{ inputs.matrix_linux_command }}
89+
COMMAND_OVERRIDE_5_8: ${{ inputs.matrix_linux_5_8_command_override }}
90+
COMMAND_OVERRIDE_5_9: ${{ inputs.matrix_linux_5_9_command_override }}
91+
COMMAND_OVERRIDE_5_10: ${{ inputs.matrix_linux_5_10_command_override }}
92+
COMMAND_OVERRIDE_NIGHTLY_6_0: ${{ inputs.matrix_linux_nightly_6_0_command_override }}
93+
COMMAND_OVERRIDE_NIGHTLY_MAIN: ${{ inputs.matrix_linux_nightly_main_command_override }}
94+
run: |
95+
apt-get -qq update && apt-get -qq -y install curl
96+
curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-matrix-job.sh | bash

.licenseignore

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
.gitignore
2+
**/.gitignore
3+
.licenseignore
4+
.gitattributes
5+
.git-blame-ignore-revs
6+
.mailfilter
7+
.mailmap
8+
.spi.yml
9+
.swift-format
10+
.github/*
11+
*.md
12+
*.txt
13+
*.yml
14+
*.yaml
15+
*.json
16+
Package.swift
17+
**/Package.swift
18+
Package@-*.swift
19+
**/Package@-*.swift
20+
Package.resolved
21+
**/Package.resolved
22+
Makefile
23+
*.modulemap
24+
**/*.modulemap
25+
**/*.docc/*
26+
*.xcprivacy
27+
**/*.xcprivacy
28+
*.symlink
29+
**/*.symlink
30+
Dockerfile
31+
**/Dockerfile
32+
Snippets/*
33+
Sources/CNIOAtomics/src/cpp_magic.h
34+
Sources/CNIOLLHTTP/LICENSE-MIT
35+
Sources/CNIOLLHTTP/c_nio_api.c
36+
Sources/CNIOLLHTTP/c_nio_http.c
37+
Sources/CNIOLLHTTP/c_nio_llhttp.c
38+
Sources/CNIOLLHTTP/include/c_nio_llhttp.h
39+
Sources/CNIOSHA1/c_nio_sha1.c
40+
Sources/CNIOSHA1/include/CNIOSHA1.h
41+
dev/alloc-limits-from-test-output
42+
dev/boxed-existentials.d
43+
dev/git.commit.template
44+
dev/lldb-smoker
45+
dev/make-single-file-spm
46+
dev/malloc-aggregation.d
47+
dev/update-alloc-limits-to-last-completed-ci-build
48+
scripts/nio-diagnose

.swift-format

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"version" : 1,
3+
"indentation" : {
4+
"spaces" : 4
5+
},
6+
"tabWidth" : 4,
7+
"fileScopedDeclarationPrivacy" : {
8+
"accessLevel" : "private"
9+
},
10+
"spacesAroundRangeFormationOperators" : false,
11+
"indentConditionalCompilationBlocks" : false,
12+
"indentSwitchCaseLabels" : false,
13+
"lineBreakAroundMultilineExpressionChainComponents" : false,
14+
"lineBreakBeforeControlFlowKeywords" : false,
15+
"lineBreakBeforeEachArgument" : true,
16+
"lineBreakBeforeEachGenericRequirement" : true,
17+
"lineLength" : 120,
18+
"maximumBlankLines" : 1,
19+
"respectsExistingLineBreaks" : true,
20+
"prioritizeKeepingFunctionOutputTogether" : true,
21+
"rules" : {
22+
"AllPublicDeclarationsHaveDocumentation" : false,
23+
"AlwaysUseLiteralForEmptyCollectionInit" : false,
24+
"AlwaysUseLowerCamelCase" : false,
25+
"AmbiguousTrailingClosureOverload" : true,
26+
"BeginDocumentationCommentWithOneLineSummary" : false,
27+
"DoNotUseSemicolons" : true,
28+
"DontRepeatTypeInStaticProperties" : true,
29+
"FileScopedDeclarationPrivacy" : true,
30+
"FullyIndirectEnum" : true,
31+
"GroupNumericLiterals" : true,
32+
"IdentifiersMustBeASCII" : true,
33+
"NeverForceUnwrap" : false,
34+
"NeverUseForceTry" : false,
35+
"NeverUseImplicitlyUnwrappedOptionals" : false,
36+
"NoAccessLevelOnExtensionDeclaration" : true,
37+
"NoAssignmentInExpressions" : true,
38+
"NoBlockComments" : true,
39+
"NoCasesWithOnlyFallthrough" : true,
40+
"NoEmptyTrailingClosureParentheses" : true,
41+
"NoLabelsInCasePatterns" : true,
42+
"NoLeadingUnderscores" : false,
43+
"NoParensAroundConditions" : true,
44+
"NoVoidReturnOnFunctionSignature" : true,
45+
"OmitExplicitReturns" : true,
46+
"OneCasePerLine" : true,
47+
"OneVariableDeclarationPerLine" : true,
48+
"OnlyOneTrailingClosureArgument" : true,
49+
"OrderedImports" : true,
50+
"ReplaceForEachWithForLoop" : true,
51+
"ReturnVoidInsteadOfEmptyTuple" : true,
52+
"UseEarlyExits" : false,
53+
"UseExplicitNilCheckInConditions" : false,
54+
"UseLetInEveryBoundCaseVariable" : false,
55+
"UseShorthandTypeNames" : true,
56+
"UseSingleLinePropertyGetter" : false,
57+
"UseSynthesizedInitializer" : false,
58+
"UseTripleSlashForDocumentationComments" : true,
59+
"UseWhereClausesInForLoops" : false,
60+
"ValidateDocumentationComments" : false
61+
}
62+
}

0 commit comments

Comments
 (0)