Showing preview only (9,110K chars total). Download the full file or copy to clipboard to get everything.
Repository: apple/swift-nio
Branch: main
Commit: 66c50a79a393
Files: 766
Total size: 8.5 MB
Directory structure:
gitextract_lx9o5bau/
├── .editorconfig
├── .git-blame-ignore-revs
├── .gitattributes
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ └── bug-report.md
│ ├── PULL_REQUEST_TEMPLATE.md
│ ├── actions/
│ │ └── pull_request_semver_label_checker/
│ │ └── action.yml
│ ├── dependabot.yml
│ ├── release.yml
│ └── workflows/
│ ├── android_swift_sdk.yml
│ ├── benchmarks.yml
│ ├── cmake_tests.yml
│ ├── cxx_interop.yml
│ ├── macos_benchmarks.yml
│ ├── macos_tests.yml
│ ├── main.yml
│ ├── pull_request.yml
│ ├── pull_request_label.yml
│ ├── release_builds.yml
│ ├── static_sdk.yml
│ ├── swift_6_language_mode.yml
│ ├── swift_load_test_matrix.yml
│ ├── swift_matrix.yml
│ ├── swift_test_matrix.yml
│ ├── unit_tests.yml
│ └── wasm_swift_sdk.yml
├── .gitignore
├── .licenseignore
├── .mailfilter
├── .mailmap
├── .spi.yml
├── .swift-format
├── Benchmarks/
│ ├── .gitignore
│ ├── Benchmarks/
│ │ ├── NIOCoreBenchmarks/
│ │ │ └── Benchmarks.swift
│ │ └── NIOPosixBenchmarks/
│ │ ├── Benchmarks.swift
│ │ ├── NIOThreadPoolBenchmark.swift
│ │ ├── TCPEcho.swift
│ │ ├── TCPEchoAsyncChannel.swift
│ │ ├── UDPEcho.swift
│ │ └── Util/
│ │ └── GlobalExecutor.swift
│ ├── Package.swift
│ └── Thresholds/
│ ├── 5.10/
│ │ ├── NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json
│ │ ├── NIOCoreBenchmarks.WaitOnPromise.p90.json
│ │ ├── NIOPosixBenchmarks.TCPEcho.p90.json
│ │ └── NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json
│ ├── 6.0/
│ │ ├── NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json
│ │ ├── NIOPosixBenchmarks.TCPEcho.p90.json
│ │ └── NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json
│ ├── 6.1/
│ │ ├── NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json
│ │ ├── NIOPosixBenchmarks.TCPEcho.p90.json
│ │ └── NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json
│ ├── 6.2/
│ │ ├── NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json
│ │ ├── NIOPosixBenchmarks.TCPEcho.p90.json
│ │ └── NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json
│ ├── nightly-main/
│ │ ├── NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json
│ │ ├── NIOPosixBenchmarks.TCPEcho.p90.json
│ │ └── NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json
│ └── nightly-next/
│ ├── NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json
│ ├── NIOPosixBenchmarks.TCPEcho.p90.json
│ └── NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── CONTRIBUTORS.txt
├── IntegrationTests/
│ ├── allocation-counter-tests-framework/
│ │ ├── run-allocation-counter.sh
│ │ └── template/
│ │ ├── AtomicCounter/
│ │ │ ├── Package.swift
│ │ │ └── Sources/
│ │ │ └── AtomicCounter/
│ │ │ ├── include/
│ │ │ │ └── atomic-counter.h
│ │ │ └── src/
│ │ │ └── atomic-counter.c
│ │ ├── HookedFunctionsDoHook/
│ │ │ ├── Package.swift
│ │ │ └── Sources/
│ │ │ └── HookedFunctions/
│ │ │ ├── include/
│ │ │ │ └── hooked-functions.h
│ │ │ └── src/
│ │ │ ├── hooked-functions-darwin.c
│ │ │ └── hooked-functions-unix.c
│ │ ├── HookedFunctionsDoNotHook/
│ │ │ ├── Package.swift
│ │ │ └── Sources/
│ │ │ └── HookedFunctions/
│ │ │ ├── include/
│ │ │ │ └── hooked-functions.h
│ │ │ └── src/
│ │ │ └── hooked-functions.c
│ │ ├── Sources/
│ │ │ ├── bootstrapDoHook/
│ │ │ │ └── main.c
│ │ │ └── bootstrapDoNotHook/
│ │ │ └── main.c
│ │ └── scaffolding.swift
│ ├── plugin_echo.sh
│ ├── plugin_junit_xml.sh
│ ├── run-single-test.sh
│ ├── run-tests.sh
│ ├── test_functions.sh
│ ├── tests_01_http/
│ │ ├── defines.sh
│ │ ├── test_01_get_file.sh
│ │ ├── test_02_get_random_bytes.sh
│ │ ├── test_03_post_random_bytes.sh
│ │ ├── test_04_keep_alive_works.sh
│ │ ├── test_05_repeated_reqs_work.sh
│ │ ├── test_06_http_1.0.sh
│ │ ├── test_07_headers_work.sh
│ │ ├── test_08_survive_signals.sh
│ │ ├── test_09_curl_happy_with_trailers.sh
│ │ ├── test_10_connection_drop_in_body_ok.sh
│ │ ├── test_11_res_body_streaming.sh
│ │ ├── test_12_headers_too_large.sh
│ │ ├── test_13_http_pipelining.sh
│ │ ├── test_14_strict_mode_assertion.sh
│ │ ├── test_15_post_in_chunked_encoding.sh
│ │ ├── test_16_tcp_client_ip.sh
│ │ ├── test_17_serve_massive_sparse_file.sh
│ │ ├── test_18_close_with_no_keepalive.sh
│ │ ├── test_19_connection_drop_while_waiting_for_response_uds.sh
│ │ ├── test_20_connection_drop_while_waiting_for_response_tcp.sh
│ │ ├── test_21_connection_reset_tcp.sh
│ │ ├── test_22_http_1.0_keep_alive.sh
│ │ ├── test_23_repeated_reqs_with_half_closure.sh
│ │ └── test_24_http_over_stdio.sh
│ ├── tests_02_syscall_wrappers/
│ │ ├── defines.sh
│ │ ├── test_01_syscall_wrapper_fast.sh
│ │ ├── test_02_unacceptable_errnos.sh
│ │ └── test_03_unacceptable_read_errnos.sh
│ ├── tests_03_debug_binary_checks/
│ │ ├── defines.sh
│ │ ├── test_01_check_we_do_not_link_Foundation.sh
│ │ └── test_02_expected_crashes_work.sh
│ ├── tests_04_performance/
│ │ ├── Thresholds/
│ │ │ ├── 5.10.json
│ │ │ ├── 5.8.json
│ │ │ ├── 6.0.json
│ │ │ ├── 6.1.json
│ │ │ ├── 6.2.json
│ │ │ ├── nightly-main.json
│ │ │ └── nightly-next.json
│ │ ├── defines.sh
│ │ ├── test_01_allocation_counts.sh
│ │ └── test_01_resources/
│ │ ├── README.md
│ │ ├── run-nio-alloc-counter-tests.sh
│ │ ├── shared.swift
│ │ ├── test_10000000_asyncsequenceproducer.swift
│ │ ├── test_1000000_asyncwriter.swift
│ │ ├── test_1000_addHandlers.swift
│ │ ├── test_1000_addHandlers_sync.swift
│ │ ├── test_1000_addRemoveHandlers.swift
│ │ ├── test_1000_autoReadGetAndSet.swift
│ │ ├── test_1000_autoReadGetAndSet_sync.swift
│ │ ├── test_1000_copying_bytebufferview_to_array.swift
│ │ ├── test_1000_copying_circularbuffer_to_array.swift
│ │ ├── test_1000_getHandlers.swift
│ │ ├── test_1000_getHandlers_sync.swift
│ │ ├── test_1000_reqs_1_conn.swift
│ │ ├── test_1000_rst_connections.swift
│ │ ├── test_1000_tcpbootstraps.swift
│ │ ├── test_1000_tcpconnections.swift
│ │ ├── test_1000_udp_reqs.swift
│ │ ├── test_1000_udpbootstraps.swift
│ │ ├── test_1000_udpconnections.swift
│ │ ├── test_1_reqs_1000_conn.swift
│ │ ├── test_assume_isolated_scheduling_10000_executions.swift
│ │ ├── test_bytebuffer_lots_of_rw.swift
│ │ ├── test_creating_10000_headers.swift
│ │ ├── test_decode_1000_ws_frames.swift
│ │ ├── test_encode_1000_ws_frames.swift
│ │ ├── test_execute_hop_10000_tasks.swift
│ │ ├── test_flat_schedule_10000_tasks.swift
│ │ ├── test_flat_schedule_assume_isolated_10000_tasks.swift
│ │ ├── test_future_assume_isolated_lots_of_callbacks.swift
│ │ ├── test_future_erase_result.swift
│ │ ├── test_future_lots_of_callbacks.swift
│ │ ├── test_get_100000_headers_canonical_form.swift
│ │ ├── test_modifying_1000_circular_buffer_elements.swift
│ │ ├── test_modifying_byte_buffer_view.swift
│ │ ├── test_ping_pong_1000_reqs_1_conn.swift
│ │ ├── test_read_10000_chunks_from_file.swift
│ │ ├── test_schedule_10000_tasks.swift
│ │ ├── test_schedule_and_run_10000_tasks.swift
│ │ ├── test_schedule_assume_isolated_10000_tasks.swift
│ │ ├── test_schedule_with_deadline_10000_tasks.swift
│ │ ├── test_schedule_with_deadline_assume_isolated_10000_tasks.swift
│ │ ├── test_scheduling_10000_executions.swift
│ │ ├── test_submit_10000_tasks.swift
│ │ ├── test_submit_assume_isolated_10000_tasks.swift
│ │ ├── test_udp_1000_reqs_1_conn.swift
│ │ └── test_udp_1_reqs_1000_conn.swift
│ └── tests_05_assertions/
│ ├── defines.sh
│ └── test_01_syscall_wrapper_fast.sh
├── LICENSE.txt
├── NOTICE.txt
├── Package.swift
├── README.md
├── SECURITY.md
├── Snippets/
│ └── NIOFileSystemTour.swift
├── Sources/
│ ├── CNIOAtomics/
│ │ ├── include/
│ │ │ └── CNIOAtomics.h
│ │ └── src/
│ │ ├── c-atomics.c
│ │ ├── c-nioatomics.c
│ │ └── cpp_magic.h
│ ├── CNIODarwin/
│ │ ├── include/
│ │ │ └── CNIODarwin.h
│ │ └── shim.c
│ ├── CNIOLLHTTP/
│ │ ├── LICENSE
│ │ ├── c_nio_api.c
│ │ ├── c_nio_http.c
│ │ ├── c_nio_llhttp.c
│ │ ├── include/
│ │ │ ├── CNIOLLHTTP.h
│ │ │ └── c_nio_llhttp.h
│ │ └── update_and_patch_llhttp.sh
│ ├── CNIOLinux/
│ │ ├── include/
│ │ │ ├── CNIOLinux.h
│ │ │ └── liburing_nio.h
│ │ ├── liburing_shims.c
│ │ └── shim.c
│ ├── CNIOOpenBSD/
│ │ ├── include/
│ │ │ └── CNIOOpenBSD.h
│ │ └── shim.c
│ ├── CNIOPosix/
│ │ ├── event_loop_id.c
│ │ └── include/
│ │ └── CNIOPosix.h
│ ├── CNIOSHA1/
│ │ ├── c_nio_sha1.c
│ │ ├── include/
│ │ │ └── CNIOSHA1.h
│ │ └── update_and_patch_sha1.sh
│ ├── CNIOWASI/
│ │ ├── CNIOWASI.c
│ │ └── include/
│ │ └── CNIOWASI.h
│ ├── CNIOWindows/
│ │ ├── WSAStartup.c
│ │ ├── include/
│ │ │ ├── CNIOWindows.h
│ │ │ └── module.modulemap
│ │ └── shim.c
│ ├── NIO/
│ │ ├── Docs.docc/
│ │ │ ├── Articles/
│ │ │ │ ├── Debugging Allocation Regressions.md
│ │ │ │ └── Running Alloction Counting Tests.md
│ │ │ └── index.md
│ │ └── Exports.swift
│ ├── NIOAsyncAwaitDemo/
│ │ ├── AsyncChannelIO.swift
│ │ ├── FullRequestResponse.swift
│ │ └── main.swift
│ ├── NIOChatClient/
│ │ ├── README.md
│ │ └── main.swift
│ ├── NIOChatServer/
│ │ ├── README.md
│ │ └── main.swift
│ ├── NIOConcurrencyHelpers/
│ │ ├── NIOAtomic.swift
│ │ ├── NIOLock.swift
│ │ ├── NIOLockedValueBox.swift
│ │ ├── NIOThreadPoolWorkAvailable.swift
│ │ ├── atomics.swift
│ │ └── lock.swift
│ ├── NIOCore/
│ │ ├── AddressedEnvelope.swift
│ │ ├── AsyncAwaitSupport.swift
│ │ ├── AsyncChannel/
│ │ │ ├── AsyncChannel.swift
│ │ │ ├── AsyncChannelHandler.swift
│ │ │ ├── AsyncChannelInboundStream.swift
│ │ │ └── AsyncChannelOutboundWriter.swift
│ │ ├── AsyncSequences/
│ │ │ ├── NIOAsyncSequenceProducer.swift
│ │ │ ├── NIOAsyncSequenceProducerStrategies.swift
│ │ │ ├── NIOAsyncWriter.swift
│ │ │ └── NIOThrowingAsyncSequenceProducer.swift
│ │ ├── BSDSocketAPI.swift
│ │ ├── ByteBuffer-aux.swift
│ │ ├── ByteBuffer-binaryEncodedLengthPrefix.swift
│ │ ├── ByteBuffer-conversions.swift
│ │ ├── ByteBuffer-core.swift
│ │ ├── ByteBuffer-hex.swift
│ │ ├── ByteBuffer-int.swift
│ │ ├── ByteBuffer-lengthPrefix.swift
│ │ ├── ByteBuffer-multi-int.swift
│ │ ├── ByteBuffer-quicBinaryEncodingStrategy.swift
│ │ ├── ByteBuffer-views.swift
│ │ ├── Channel.swift
│ │ ├── ChannelHandler.swift
│ │ ├── ChannelHandlers.swift
│ │ ├── ChannelInvoker.swift
│ │ ├── ChannelOption.swift
│ │ ├── ChannelPipeline.swift
│ │ ├── CircularBuffer.swift
│ │ ├── Codec.swift
│ │ ├── ConvenienceOptionSupport.swift
│ │ ├── DeadChannel.swift
│ │ ├── DispatchQueue+WithFuture.swift
│ │ ├── Docs.docc/
│ │ │ ├── ByteBuffer-lengthPrefix.md
│ │ │ ├── index.md
│ │ │ ├── loops-futures-concurrency.md
│ │ │ └── swift-concurrency.md
│ │ ├── EventLoop+Deprecated.swift
│ │ ├── EventLoop+SerialExecutor.swift
│ │ ├── EventLoop.swift
│ │ ├── EventLoopFuture+AssumeIsolated.swift
│ │ ├── EventLoopFuture+Deprecated.swift
│ │ ├── EventLoopFuture+WithEventLoop.swift
│ │ ├── EventLoopFuture.swift
│ │ ├── FileDescriptor.swift
│ │ ├── FileHandle.swift
│ │ ├── FileRegion.swift
│ │ ├── GlobalSingletons.swift
│ │ ├── IO.swift
│ │ ├── IOData.swift
│ │ ├── IPProtocol.swift
│ │ ├── IntegerBitPacking.swift
│ │ ├── IntegerTypes.swift
│ │ ├── Interfaces.swift
│ │ ├── Linux.swift
│ │ ├── MarkedCircularBuffer.swift
│ │ ├── MulticastChannel.swift
│ │ ├── NIOAny.swift
│ │ ├── NIOCloseOnErrorHandler.swift
│ │ ├── NIOCoreSendableMetatype.swift
│ │ ├── NIODecodedAsyncSequence.swift
│ │ ├── NIOLoopBound.swift
│ │ ├── NIOPooledRecvBufferAllocator.swift
│ │ ├── NIOScheduledCallback.swift
│ │ ├── NIOSendable.swift
│ │ ├── NIOSplitLinesMessageDecoder.swift
│ │ ├── NIOTransportAccessibleChannelCore.swift
│ │ ├── RecvByteBufferAllocator.swift
│ │ ├── SingleStepByteToMessageDecoder.swift
│ │ ├── SocketAddresses.swift
│ │ ├── SocketOptionProvider.swift
│ │ ├── SystemCallHelpers.swift
│ │ ├── TimeAmount+Duration.swift
│ │ ├── TypeAssistedChannelHandler.swift
│ │ ├── UniversalBootstrapSupport.swift
│ │ └── Utilities.swift
│ ├── NIOCrashTester/
│ │ ├── CrashTestSuites.swift
│ │ ├── CrashTests+ByteBuffer.swift
│ │ ├── CrashTests+EventLoop.swift
│ │ ├── CrashTests+HTTP.swift
│ │ ├── CrashTests+LoopBound.swift
│ │ ├── CrashTests+Strict.swift
│ │ ├── CrashTests+System.swift
│ │ ├── OutputGrepper.swift
│ │ └── main.swift
│ ├── NIOEchoClient/
│ │ ├── README.md
│ │ └── main.swift
│ ├── NIOEchoServer/
│ │ ├── README.md
│ │ └── main.swift
│ ├── NIOEmbedded/
│ │ ├── AsyncTestingChannel.swift
│ │ ├── AsyncTestingEventLoop.swift
│ │ └── Embedded.swift
│ ├── NIOFS/
│ │ ├── Array+FileSystem.swift
│ │ ├── ArraySlice+FileSystem.swift
│ │ ├── BufferedReader.swift
│ │ ├── BufferedWriter.swift
│ │ ├── ByteBuffer+FileSystem.swift
│ │ ├── ByteCount.swift
│ │ ├── Convenience.swift
│ │ ├── DirectoryEntries.swift
│ │ ├── DirectoryEntry.swift
│ │ ├── Exports.swift
│ │ ├── FileChunks.swift
│ │ ├── FileHandle.swift
│ │ ├── FileHandleProtocol.swift
│ │ ├── FileInfo.swift
│ │ ├── FileSystem.swift
│ │ ├── FileSystemError+Syscall.swift
│ │ ├── FileSystemError.swift
│ │ ├── FileSystemProtocol.swift
│ │ ├── FileType.swift
│ │ ├── IOStrategy.swift
│ │ ├── Internal/
│ │ │ ├── BufferedOrAnyStream.swift
│ │ │ ├── BufferedStream.swift
│ │ │ ├── Cancellation.swift
│ │ │ ├── Concurrency Primitives/
│ │ │ │ └── TokenBucket.swift
│ │ │ ├── ParallelDirCopy.swift
│ │ │ ├── ParallelRemoval.swift
│ │ │ ├── String+UnsafeUnititializedCapacity.swift
│ │ │ ├── System Calls/
│ │ │ │ ├── CInterop.swift
│ │ │ │ ├── Errno.swift
│ │ │ │ ├── FileDescriptor+Syscalls.swift
│ │ │ │ ├── Mocking.swift
│ │ │ │ ├── Syscall.swift
│ │ │ │ └── Syscalls.swift
│ │ │ ├── SystemFileHandle.swift
│ │ │ └── Utilities.swift
│ │ ├── NIOFilePath.swift
│ │ ├── NIOFileSystemSendableMetatype.swift
│ │ ├── OpenOptions.swift
│ │ ├── PrivacyInfo.xcprivacy
│ │ └── String+FileSystem.swift
│ ├── NIOFSFoundationCompat/
│ │ ├── Data+FileSystem.swift
│ │ └── Date+FileInfo.swift
│ ├── NIOFileSystem/
│ │ ├── Docs.docc/
│ │ │ └── index.md
│ │ └── Exports.swift
│ ├── NIOFoundationCompat/
│ │ ├── ByteBuffer-foundation.swift
│ │ ├── Codable+ByteBuffer.swift
│ │ ├── JSONSerialization+ByteBuffer.swift
│ │ └── WaitSpinningRunLoop.swift
│ ├── NIOHTTP1/
│ │ ├── ByteCollectionUtils.swift
│ │ ├── HTTPDecoder.swift
│ │ ├── HTTPEncoder.swift
│ │ ├── HTTPHeaderValidator.swift
│ │ ├── HTTPHeaders+Validation.swift
│ │ ├── HTTPPipelineSetup.swift
│ │ ├── HTTPServerPipelineHandler.swift
│ │ ├── HTTPServerProtocolErrorHandler.swift
│ │ ├── HTTPServerUpgradeHandler.swift
│ │ ├── HTTPTypedPipelineSetup.swift
│ │ ├── HTTPTypes.swift
│ │ ├── NIOHTTPClientUpgradeHandler.swift
│ │ ├── NIOHTTPObjectAggregator.swift
│ │ ├── NIOTypedHTTPClientUpgradeHandler.swift
│ │ ├── NIOTypedHTTPClientUpgraderStateMachine.swift
│ │ ├── NIOTypedHTTPServerUpgradeHandler.swift
│ │ └── NIOTypedHTTPServerUpgraderStateMachine.swift
│ ├── NIOHTTP1Client/
│ │ ├── README.md
│ │ └── main.swift
│ ├── NIOHTTP1Server/
│ │ ├── README.md
│ │ └── main.swift
│ ├── NIOMulticastChat/
│ │ └── main.swift
│ ├── NIOPerformanceTester/
│ │ ├── Benchmark.swift
│ │ ├── ByteBufferViewContainsBenchmark.swift
│ │ ├── ByteBufferViewCopyToArrayBenchmark.swift
│ │ ├── ByteBufferViewIteratorBenchmark.swift
│ │ ├── ByteBufferWriteMultipleBenchmarks.swift
│ │ ├── ByteToMessageDecoderDecodeManySmallsBenchmark.swift
│ │ ├── ChannelPipelineBenchmark.swift
│ │ ├── ChannelPipelineInstantiationBenchmark.swift
│ │ ├── CircularBufferCopyToArrayBenchmark.swift
│ │ ├── CircularBufferIntoByteBufferBenchmark.swift
│ │ ├── DeadlineNowBenchmark.swift
│ │ ├── ExecuteBenchmark.swift
│ │ ├── LockBenchmark.swift
│ │ ├── NIOAsyncSequenceProducerBenchmark.swift
│ │ ├── NIOAsyncWriterSingleWritesBenchmark.swift
│ │ ├── NIOThreadPoolSubmitBenchmark.swift
│ │ ├── RunIfActiveBenchmark.swift
│ │ ├── SchedulingAndRunningBenchmark.swift
│ │ ├── TCPThroughputBenchmark.swift
│ │ ├── UDPBenchmark.swift
│ │ ├── WebSocketFrameDecoderBenchmark.swift
│ │ ├── WebSocketFrameEncoderBenchmark.swift
│ │ ├── main.swift
│ │ └── resources.swift
│ ├── NIOPosix/
│ │ ├── BSDSocketAPICommon.swift
│ │ ├── BSDSocketAPIPosix.swift
│ │ ├── BSDSocketAPIWindows.swift
│ │ ├── BaseSocket.swift
│ │ ├── BaseSocketChannel+AccessibleTransport.swift
│ │ ├── BaseSocketChannel+SocketOptionProvider.swift
│ │ ├── BaseSocketChannel.swift
│ │ ├── BaseStreamSocketChannel.swift
│ │ ├── Bootstrap.swift
│ │ ├── ControlMessage.swift
│ │ ├── DatagramVectorReadManager.swift
│ │ ├── Docs.docc/
│ │ │ ├── GSO-GRO-Linux.md
│ │ │ └── index.md
│ │ ├── Errors+Any.swift
│ │ ├── FileDescriptor.swift
│ │ ├── GetaddrinfoResolver.swift
│ │ ├── HappyEyeballs.swift
│ │ ├── IO.swift
│ │ ├── IntegerBitPacking.swift
│ │ ├── IntegerTypes.swift
│ │ ├── Linux.swift
│ │ ├── LinuxCPUSet.swift
│ │ ├── LinuxUring.swift
│ │ ├── MultiThreadedEventLoopGroup.swift
│ │ ├── NIOPosixSendableMetatype.swift
│ │ ├── NIOThreadPool.swift
│ │ ├── NonBlockingFileIO.swift
│ │ ├── PendingDatagramWritesManager.swift
│ │ ├── PendingWritesManager.swift
│ │ ├── PipeChannel.swift
│ │ ├── PipePair.swift
│ │ ├── Pool.swift
│ │ ├── PosixSingletons+ConcurrencyTakeOver.swift
│ │ ├── PosixSingletons.swift
│ │ ├── PrivacyInfo.xcprivacy
│ │ ├── RawSocketBootstrap.swift
│ │ ├── Resolver.swift
│ │ ├── Selectable.swift
│ │ ├── SelectableChannel.swift
│ │ ├── SelectableEventLoop.swift
│ │ ├── SelectorEpoll.swift
│ │ ├── SelectorGeneric.swift
│ │ ├── SelectorKqueue.swift
│ │ ├── SelectorUring.swift
│ │ ├── SelectorWSAPoll.swift
│ │ ├── ServerSocket.swift
│ │ ├── Socket.swift
│ │ ├── SocketChannel.swift
│ │ ├── SocketProtocols.swift
│ │ ├── StructuredConcurrencyHelpers.swift
│ │ ├── System.swift
│ │ ├── Thread.swift
│ │ ├── ThreadPosix.swift
│ │ ├── ThreadWindows.swift
│ │ ├── Utilities.swift
│ │ ├── VsockAddress.swift
│ │ ├── VsockChannelEvents.swift
│ │ └── Windows.swift
│ ├── NIOTCPEchoClient/
│ │ ├── Client.swift
│ │ └── README.md
│ ├── NIOTCPEchoServer/
│ │ ├── README.md
│ │ └── Server.swift
│ ├── NIOTLS/
│ │ ├── ApplicationProtocolNegotiationHandler.swift
│ │ ├── NIOTypedApplicationProtocolNegotiationHandler.swift
│ │ ├── ProtocolNegotiationHandlerStateMachine.swift
│ │ ├── SNIHandler.swift
│ │ └── TLSEvents.swift
│ ├── NIOTestUtils/
│ │ ├── ByteToMessageDecoderVerifier.swift
│ │ ├── EventCounterHandler.swift
│ │ ├── ManualTaskExecutor.swift
│ │ └── NIOHTTP1TestServer.swift
│ ├── NIOUDPEchoClient/
│ │ ├── README.md
│ │ └── main.swift
│ ├── NIOUDPEchoServer/
│ │ ├── README.md
│ │ └── main.swift
│ ├── NIOWebSocket/
│ │ ├── NIOWebSocketClientUpgrader.swift
│ │ ├── NIOWebSocketFrameAggregator.swift
│ │ ├── NIOWebSocketServerUpgrader.swift
│ │ ├── SHA1.swift
│ │ ├── WebSocketErrorCodes.swift
│ │ ├── WebSocketFrame.swift
│ │ ├── WebSocketFrameDecoder.swift
│ │ ├── WebSocketFrameEncoder.swift
│ │ ├── WebSocketOpcode.swift
│ │ └── WebSocketProtocolErrorHandler.swift
│ ├── NIOWebSocketClient/
│ │ ├── Client.swift
│ │ └── README.md
│ ├── NIOWebSocketServer/
│ │ ├── README.md
│ │ └── Server.swift
│ ├── _NIOBase64/
│ │ └── Base64.swift
│ ├── _NIOConcurrency/
│ │ └── Empty.swift
│ ├── _NIODataStructures/
│ │ ├── Heap.swift
│ │ ├── PriorityQueue.swift
│ │ └── _TinyArray.swift
│ ├── _NIOFileSystem/
│ │ ├── Array+FileSystem.swift
│ │ ├── ArraySlice+FileSystem.swift
│ │ ├── BufferedReader.swift
│ │ ├── BufferedWriter.swift
│ │ ├── ByteBuffer+FileSystem.swift
│ │ ├── ByteCount.swift
│ │ ├── Convenience.swift
│ │ ├── DirectoryEntries.swift
│ │ ├── DirectoryEntry.swift
│ │ ├── Docs.docc/
│ │ │ ├── Extensions/
│ │ │ │ ├── DirectoryFileHandleProtocol.md
│ │ │ │ ├── FileHandleProtocol.md
│ │ │ │ ├── FileSystemProtocol.md
│ │ │ │ ├── ReadableFileHandleProtocol.md
│ │ │ │ └── WritableFileHandleProtocol.md
│ │ │ └── index.md
│ │ ├── Exports.swift
│ │ ├── FileChunks.swift
│ │ ├── FileHandle.swift
│ │ ├── FileHandleProtocol.swift
│ │ ├── FileInfo.swift
│ │ ├── FileSystem.swift
│ │ ├── FileSystemError+Syscall.swift
│ │ ├── FileSystemError.swift
│ │ ├── FileSystemProtocol.swift
│ │ ├── FileType.swift
│ │ ├── IOStrategy.swift
│ │ ├── Internal/
│ │ │ ├── BufferedOrAnyStream.swift
│ │ │ ├── BufferedStream.swift
│ │ │ ├── Cancellation.swift
│ │ │ ├── Concurrency Primitives/
│ │ │ │ └── TokenBucket.swift
│ │ │ ├── ParallelDirCopy.swift
│ │ │ ├── ParallelRemoval.swift
│ │ │ ├── String+UnsafeUnititializedCapacity.swift
│ │ │ ├── System Calls/
│ │ │ │ ├── CInterop.swift
│ │ │ │ ├── Errno.swift
│ │ │ │ ├── FileDescriptor+Syscalls.swift
│ │ │ │ ├── Mocking.swift
│ │ │ │ ├── Syscall.swift
│ │ │ │ └── Syscalls.swift
│ │ │ ├── SystemFileHandle.swift
│ │ │ └── Utilities.swift
│ │ ├── NIOFilePath.swift
│ │ ├── NIOFileSystemSendableMetatype.swift
│ │ ├── OpenOptions.swift
│ │ ├── PrivacyInfo.xcprivacy
│ │ └── String+FileSystem.swift
│ └── _NIOFileSystemFoundationCompat/
│ ├── Data+FileSystem.swift
│ └── Date+FileInfo.swift
├── Tests/
│ ├── NIOBase64Tests/
│ │ └── Base64Test.swift
│ ├── NIOConcurrencyHelpersTests/
│ │ └── NIOConcurrencyHelpersTests.swift
│ ├── NIOCoreTests/
│ │ ├── AddressedEnvelopeTests.swift
│ │ ├── AsyncChannel/
│ │ │ ├── AsyncChannelInboundStreamTests.swift
│ │ │ ├── AsyncChannelOutboundWriterTests.swift
│ │ │ └── AsyncChannelTests.swift
│ │ ├── AsyncSequenceTests.swift
│ │ ├── AsyncSequences/
│ │ │ ├── NIOAsyncSequenceProducer+HighLowWatermarkBackPressureStrategyTests.swift
│ │ │ ├── NIOAsyncSequenceTests.swift
│ │ │ ├── NIOAsyncWriterTests.swift
│ │ │ └── NIOThrowingAsyncSequenceTests.swift
│ │ ├── BaseObjectsTest.swift
│ │ ├── ByteBufferBinaryEncodedLengthPrefixTests.swift
│ │ ├── ByteBufferCustomAllocatorTest.swift
│ │ ├── ByteBufferLengthPrefixTests.swift
│ │ ├── ByteBufferQUICBinaryEncodingStrategyTests.swift
│ │ ├── ByteBufferSpanTests.swift
│ │ ├── ByteBufferTest.swift
│ │ ├── ChannelOptionStorageTest.swift
│ │ ├── CircularBufferTests.swift
│ │ ├── CustomChannelTests.swift
│ │ ├── DispatchQueue+WithFutureTest.swift
│ │ ├── IOErrorTest.swift
│ │ ├── IntegerTypesTest.swift
│ │ ├── LinuxTest.swift
│ │ ├── MarkedCircularBufferTests.swift
│ │ ├── NIOAnyDebugTest.swift
│ │ ├── NIOCloseOnErrorHandlerTest.swift
│ │ ├── NIODecodedAsyncSequenceTests.swift
│ │ ├── NIOIsolatedEventLoopTests.swift
│ │ ├── NIOPooledRecvBufferAllocatorTests.swift
│ │ ├── NIOSplitLinesMessageDecoderTests.swift
│ │ ├── RecvByteBufAllocatorTest.swift
│ │ ├── SingleStepByteToMessageDecoderTest.swift
│ │ ├── TimeAmount+DurationTests.swift
│ │ ├── TimeAmountTests.swift
│ │ ├── TypeAssistedChannelHandlerTests.swift
│ │ ├── UtilitiesTest.swift
│ │ ├── XCTest+AsyncAwait.swift
│ │ └── XCTest+Extensions.swift
│ ├── NIODataStructuresTests/
│ │ ├── HeapTests.swift
│ │ └── PriorityQueueTests.swift
│ ├── NIOEmbeddedTests/
│ │ ├── AsyncTestingChannelTests.swift
│ │ ├── AsyncTestingEventLoopTests.swift
│ │ ├── EmbeddedChannelTest.swift
│ │ ├── EmbeddedEventLoopTest.swift
│ │ ├── TestUtils.swift
│ │ └── XCTest+AsyncAwait.swift
│ ├── NIOFSFoundationCompatTests/
│ │ └── FileSystemFoundationCompatTests.swift
│ ├── NIOFSIntegrationTests/
│ │ ├── BufferedReaderTests.swift
│ │ ├── BufferedWriterTests.swift
│ │ ├── ConvenienceTests.swift
│ │ ├── FileHandleTests.swift
│ │ ├── FileSystemTests+SPI.swift
│ │ ├── FileSystemTests.swift
│ │ ├── Test Data/
│ │ │ ├── Foo/
│ │ │ │ └── README.txt
│ │ │ └── README.md
│ │ └── XCTestExtensions.swift
│ ├── NIOFSTests/
│ │ ├── ByteCountTests.swift
│ │ ├── DirectoryEntriesTests.swift
│ │ ├── FileChunksTests.swift
│ │ ├── FileHandleTests.swift
│ │ ├── FileInfoTests.swift
│ │ ├── FileOpenOptionsTests.swift
│ │ ├── FilePathTests.swift
│ │ ├── FileSystemErrorTests.swift
│ │ ├── FileTypeTests.swift
│ │ ├── Internal/
│ │ │ ├── CancellationTests.swift
│ │ │ ├── Concurrency Primitives/
│ │ │ │ └── BufferedStreamTests.swift
│ │ │ ├── MockingInfrastructure.swift
│ │ │ └── SyscallTests.swift
│ │ └── XCTestExtensions.swift
│ ├── NIOFoundationCompatTests/
│ │ ├── ByteBuffer+UUIDTests.swift
│ │ ├── ByteBufferDataProtocolTests.swift
│ │ ├── ByteBufferView+MutableDataProtocolTest.swift
│ │ ├── Codable+ByteBufferTest.swift
│ │ ├── JSONSerialization+ByteBufferTest.swift
│ │ └── WaitSpinningRunLoopTests.swift
│ ├── NIOHTTP1Tests/
│ │ ├── ByteBufferUtilsTest.swift
│ │ ├── ContentLengthTests.swift
│ │ ├── HTTPClientUpgradeTests.swift
│ │ ├── HTTPDecoderLengthTest.swift
│ │ ├── HTTPDecoderTest.swift
│ │ ├── HTTPHeaderValidationTests.swift
│ │ ├── HTTPHeadersTest.swift
│ │ ├── HTTPRequestEncoderTest.swift
│ │ ├── HTTPResponseEncoderTest.swift
│ │ ├── HTTPResponseStatusTests.swift
│ │ ├── HTTPServerClientTest.swift
│ │ ├── HTTPServerPipelineHandlerTest.swift
│ │ ├── HTTPServerProtocolErrorHandlerTest.swift
│ │ ├── HTTPServerUpgradeTests.swift
│ │ ├── HTTPTest.swift
│ │ ├── HTTPTypesTest.swift
│ │ ├── NIOHTTPObjectAggregatorTest.swift
│ │ └── TestUtils.swift
│ ├── NIOPosixTests/
│ │ ├── AcceptBackoffHandlerTest.swift
│ │ ├── AsyncChannelBootstrapTests.swift
│ │ ├── BlockingIOThreadPoolTest.swift
│ │ ├── BootstrapTest.swift
│ │ ├── ChannelNotificationTest.swift
│ │ ├── ChannelPipelineTest.swift
│ │ ├── ChannelTests.swift
│ │ ├── CoWValue.swift
│ │ ├── CodecTest.swift
│ │ ├── ControlMessageTests.swift
│ │ ├── DatagramChannelTests.swift
│ │ ├── EchoServerClientTest.swift
│ │ ├── EventLoopFutureIsolatedTests.swift
│ │ ├── EventLoopFutureTest.swift
│ │ ├── EventLoopMetricsDelegateTests.swift
│ │ ├── EventLoopTest.swift
│ │ ├── FileRegionTest.swift
│ │ ├── GetAddrInfoResolverTest.swift
│ │ ├── HappyEyeballsTest.swift
│ │ ├── IPv4Header.swift
│ │ ├── IdleStateHandlerTest.swift
│ │ ├── IntegerBitPackingTests.swift
│ │ ├── MulticastTest.swift
│ │ ├── NIOFileHandleTest.swift
│ │ ├── NIOLoopBoundTests.swift
│ │ ├── NIOScheduledCallbackTests.swift
│ │ ├── NIOThreadPoolTest.swift
│ │ ├── NIOTransportAccessibleChannelCoreTests.swift
│ │ ├── NonBlockingFileIOTest.swift
│ │ ├── PendingDatagramWritesManagerTests.swift
│ │ ├── PipeChannelTest.swift
│ │ ├── RawSocketBootstrapTests.swift
│ │ ├── SALChannelTests.swift
│ │ ├── SALEventLoopTests.swift
│ │ ├── SelectorTest.swift
│ │ ├── SerialExecutorTests.swift
│ │ ├── SocketAddressTest.swift
│ │ ├── SocketChannelTest.swift
│ │ ├── SocketOptionProviderTest.swift
│ │ ├── StreamChannelsTest.swift
│ │ ├── SyscallAbstractionLayer.swift
│ │ ├── SyscallAbstractionLayerContext.swift
│ │ ├── SystemCallWrapperHelpers.swift
│ │ ├── SystemTest.swift
│ │ ├── TestUtils.swift
│ │ ├── ThreadTest.swift
│ │ ├── UniversalBootstrapSupportTest.swift
│ │ ├── VsockAddressTest.swift
│ │ └── XCTest+AsyncAwait.swift
│ ├── NIOSingletonsTests/
│ │ └── GlobalSingletonsTests.swift
│ ├── NIOTLSTests/
│ │ ├── ApplicationProtocolNegotiationHandlerTests.swift
│ │ ├── NIOTypedApplicationProtocolNegotiationHandlerTests.swift
│ │ └── SNIHandlerTests.swift
│ ├── NIOTestUtilsTests/
│ │ ├── ByteToMessageDecoderVerifierTest.swift
│ │ ├── EventCounterHandlerTest.swift
│ │ ├── ManualTaskExecutorTest.swift
│ │ └── NIOHTTP1TestServerTest.swift
│ ├── NIOTests/
│ │ └── NIOTests.swift
│ └── NIOWebSocketTests/
│ ├── ByteBufferWebSocketTests.swift
│ ├── NIOWebSocketClientUpgraderTests.swift
│ ├── NIOWebSocketFrameAggregatorTests.swift
│ ├── WebSocketClientEndToEndTests.swift
│ ├── WebSocketFrameDecoderTest.swift
│ ├── WebSocketFrameEncoderTest.swift
│ ├── WebSocketMaskingKeyTests.swift
│ └── WebSocketServerEndToEndTests.swift
├── dev/
│ ├── alloc-limits-from-test-output
│ ├── boxed-existentials.d
│ ├── generate-bytebuffer-multi-int.sh
│ ├── git.commit.template
│ ├── lldb-smoker
│ ├── make-single-file-spm
│ ├── malloc-aggregation.bt
│ ├── malloc-aggregation.d
│ ├── stackdiff/
│ │ ├── Package.swift
│ │ ├── Sources/
│ │ │ ├── Stacks/
│ │ │ │ ├── AggregateStacks.swift
│ │ │ │ ├── Parsing/
│ │ │ │ │ ├── BPFTraceParser.swift
│ │ │ │ │ ├── DTraceParser.swift
│ │ │ │ │ ├── HeaptrackParser.swift
│ │ │ │ │ └── StackParser.swift
│ │ │ │ └── Similarity.swift
│ │ │ └── stackdiff/
│ │ │ ├── StackFormatter.swift
│ │ │ ├── Stackdiff+Diff.swift
│ │ │ ├── Stackdiff+Dump.swift
│ │ │ ├── Stackdiff+Merge.swift
│ │ │ └── Stackdiff.swift
│ │ └── Tests/
│ │ └── StacksTests/
│ │ ├── AggregateStackTests.swift
│ │ ├── DTraceParserTests.swift
│ │ ├── HeaptrackParserTests.swift
│ │ └── SimilarityTests.swift
│ ├── stackdiff-dtrace.py
│ ├── thresholds-from-benchmark-output.sh
│ └── update-integration-test-thresholds.sh
├── docs/
│ ├── advanced-performance-analysis.md
│ ├── debugging-allocations.md
│ ├── io_uring.md
│ ├── migration-guide-NIO1-to-NIO2.md
│ ├── optimization-tips.md
│ ├── public-api.md
│ ├── public-async-nio-apis.md
│ └── workarounds.md
└── scripts/
├── analyze_performance_results.rb
├── bench-alloc-counter.sh
├── check-cxx-interop-compatibility.sh
├── check-matrix-job.ps1
├── check-matrix-job.sh
├── check_benchmark_thresholds.sh
├── cmake-build.sh
├── compare_perf_of_swift_versions.sh
├── generate_matrix.sh
├── install_android_ndk.sh
├── install_swift_prerequisites.sh
├── install_swift_sdk.sh
├── integration_tests.sh
├── nio-diagnose
├── swift-build-with-android-sdk.sh
├── swift-build-with-wasm-sdk.sh
└── update-cmake-lists.sh
================================================
FILE CONTENTS
================================================
================================================
FILE: .editorconfig
================================================
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
================================================
FILE: .git-blame-ignore-revs
================================================
# Adopt swift-format
c9756e108351a1def2e2c83ff5ee6fb9bcbc3bbf
================================================
FILE: .gitattributes
================================================
Sources/CNIOHTTPParser/* linguist-vendored
Sources/CNIOSHA1/* linguist-vendored
Sources/CNIOLinux/ifaddrs-* linguist-vendored
================================================
FILE: .github/ISSUE_TEMPLATE/bug-report.md
================================================
---
name: Bug Report
about: File a bug report to help us improve
---
### Expected behavior
_[what you expected to happen]_
### Actual behavior
_[what actually happened]_
### Steps to reproduce
1. ...
2. ...
### If possible, minimal yet complete reproducer code (or URL to code)
_[anything to help us reproducing the issue]_
### SwiftNIO version/commit hash
_[the SwiftNIO tag/commit hash]_
### System & version information
Please provide at the very least your operating system and Swift version
information.
Ideally, run
```
scripts/nio-diagnose -o nio-diagnose.md PID_OF_YOUR_NIO_PROGRAM
```
and attach (or paste) the resulting file `nio-diagnose.md` into this bug report
or send it to the SwiftNIO maintainers privately.
================================================
FILE: .github/PULL_REQUEST_TEMPLATE.md
================================================
_[One line description of your change]_
### Motivation:
_[Explain here the context, and why you're making that change. What is the problem you're trying to solve.]_
### Modifications:
_[Describe the modifications you've done.]_
### Result:
_[After your change, what will change.]_
================================================
FILE: .github/actions/pull_request_semver_label_checker/action.yml
================================================
name: 'Pull request Semantic Version label checker'
description: 'Checks that at least one Semantic Version label is applied to the pull request'
inputs:
token:
description: 'A GitHub token'
type: string
default: ${{ github.token }}
runs:
using: "composite"
steps:
- name: Check labels
if: ${{ !env.ACT }}
shell: bash
env:
GH_TOKEN: ${{ inputs.token }}
run: |
gh pr view ${{ github.event.number }} --repo ${{ github.repository }} --json labels \
| jq -e '[.labels[].name] | any(. == "⚠️ semver/major" or . == "🆕 semver/minor" or . == "🔨 semver/patch" or . == "semver/none")'
================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
================================================
FILE: .github/release.yml
================================================
changelog:
categories:
- title: SemVer Major
labels:
- ⚠️ semver/major
- title: SemVer Minor
labels:
- 🆕 semver/minor
- title: SemVer Patch
labels:
- 🔨 semver/patch
- title: Other Changes
labels:
- semver/none
================================================
FILE: .github/workflows/android_swift_sdk.yml
================================================
name: Android Swift SDK
permissions:
contents: read
on:
workflow_call:
inputs:
env_vars:
type: string
description: "Environment variables for jobs as JSON (e.g., '{\"DEBUG\":\"1\",\"LOG_LEVEL\":\"info\"}')."
default: "{}"
additional_command_arguments:
type: string
description: "Additional arguments passed to swift build (the Android Swift SDK will be specified). Defaults to empty."
default: ""
jobs:
construct-matrix:
name: Construct Android Swift SDK matrix
runs-on: ubuntu-latest
outputs:
android-sdk-matrix: '${{ steps.generate-matrix.outputs.android-sdk-matrix }}'
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- id: generate-matrix
run: |
# Validate and use JSON environment variables directly
env_vars_json="$INPUT_ENV_VARS"
# Validate JSON format
if ! echo "$env_vars_json" | jq empty 2>/dev/null; then
echo "Error: env_vars is not valid JSON"
exit 1
fi
# Generate matrix with parsed environment variables
cat >> "$GITHUB_OUTPUT" << EOM
android-sdk-matrix=$(echo '{
"config":[
{
"name":"main Jammy",
"swift_version":"main",
"platform":"Linux",
"runner":"ubuntu-latest",
"image":"ubuntu:jammy",
"setup_command":"apt update -q && apt install -y -q curl jq tar && curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/install_swift_prerequisites.sh | bash && curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/install_swift_sdk.sh | INSTALL_SWIFT_BRANCH=main INSTALL_SWIFT_ARCH=x86_64 INSTALL_SWIFT_SDK=android-sdk bash && curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/install_android_ndk.sh | bash && hash -r",
"command":"curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/swift-build-with-android-sdk.sh | bash -s --",
"command_arguments":"'"$INPUT_ADDITIONAL_COMMAND_ARGUMENTS"'",
"env":'"$env_vars_json"'
}
]
}' | jq -c)
EOM
env:
INPUT_ENV_VARS: ${{ inputs.env_vars }}
INPUT_ADDITIONAL_COMMAND_ARGUMENTS: ${{ inputs.additional_command_arguments }}
android-swift-sdk:
name: Android Swift SDK
needs: construct-matrix
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@main
with:
name: "Android Swift SDK"
matrix_string: '${{ needs.construct-matrix.outputs.android-sdk-matrix }}'
================================================
FILE: .github/workflows/benchmarks.yml
================================================
name: Benchmarks
permissions:
contents: read
on:
workflow_call:
inputs:
benchmark_package_path:
type: string
description: "Path to the directory containing the benchmarking package. Defaults to ."
default: "."
swift_package_arguments:
type: string
description: "Arguments to the switch package command invocation e.g. `--disable-sandbox`"
linux_5_9_enabled:
type: boolean
description: "Boolean to enable the Linux 5.9 Swift version matrix job. Defaults to false."
default: false
linux_5_10_enabled:
type: boolean
description: "Boolean to enable the Linux 5.10 Swift version matrix job. Defaults to false."
default: false
linux_6_0_enabled:
type: boolean
description: "Boolean to enable the Linux 6.0 Swift version matrix job. Defaults to true."
default: true
linux_6_1_enabled:
type: boolean
description: "Boolean to enable the Linux 6.1 Swift version matrix job. Defaults to true."
default: true
linux_6_2_enabled:
type: boolean
description: "Boolean to enable the Linux 6.2 Swift version matrix job. Defaults to true."
default: true
linux_nightly_6_0_enabled:
type: boolean
description: "⚠️ Deprecated, we no longer run against 6.0 nightly."
default: false
linux_nightly_6_1_enabled:
type: boolean
description: "⚠️ Deprecated, use linux_nightly_next_enabled."
default: true
linux_nightly_next_enabled:
type: boolean
description: "Boolean to enable the Linux nightly matrix job for the next Swift version. Defaults to true."
default: true
linux_nightly_main_enabled:
type: boolean
description: "Boolean to enable the Linux nightly main Swift version matrix job. Defaults to true."
default: true
windows_6_0_enabled:
type: boolean
description: "Boolean to enable the Windows 6.0 Swift version matrix job. Currently has no effect!" # TODO: implement Windows benchmarking
default: false
windows_6_1_enabled:
type: boolean
description: "Boolean to enable the Windows 6.1 Swift version matrix job. Currently has no effect!" # TODO: implement Windows benchmarking
default: false
windows_6_2_enabled:
type: boolean
description: "Boolean to enable the Windows 6.2 Swift version matrix job. Currently has no effect!" # TODO: implement Windows benchmarking
default: false
windows_nightly_6_0_enabled:
type: boolean
description: "⚠️ Deprecated, we no longer run against 6.0 nightly." # TODO: implement Windows benchmarking
default: false
windows_nightly_main_enabled:
type: boolean
description: "Boolean to enable the Windows nightly main Swift version matrix job. Currently has no effect!" # TODO: implement Windows benchmarking
default: false
linux_env_vars:
type: string
description: "Environment variables for Linux jobs as JSON (e.g., '{\"DEBUG\":\"1\",\"LOG_LEVEL\":\"info\"}')."
default: "{}"
minimum_swift_version:
type: string
description: "Minimum Swift version to include in the matrix. Leave empty for auto-detection from Package.swift, specify a version like '6.0' to override, or set to 'none' to disable filtering."
default: ""
jobs:
construct-matrix-linux:
name: Construct Linux Benchmarks matrix
runs-on: ubuntu-latest
outputs:
benchmarks-matrix: '${{ steps.generate-matrix.outputs.benchmarks-matrix }}'
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- id: generate-matrix
run: |
# Validate JSON environment variables
linux_env_vars_json="$INPUT_LINUX_ENV_VARS"
if ! echo "$linux_env_vars_json" | jq empty 2>/dev/null; then
echo "Error: linux_env_vars is not valid JSON"
exit 1
fi
echo "benchmarks-matrix=$(curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/generate_matrix.sh | MATRIX_LINUX_ENV_VARS_JSON="${linux_env_vars_json}" bash)" >> "$GITHUB_OUTPUT"
env:
INPUT_LINUX_ENV_VARS: ${{ inputs.linux_env_vars }}
MATRIX_LINUX_COMMAND: "curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check_benchmark_thresholds.sh | BENCHMARK_PACKAGE_PATH=${{ inputs.benchmark_package_path }} bash"
MATRIX_LINUX_SETUP_COMMAND: "swift --version && apt-get update -y -q && apt-get install -y -q curl libjemalloc-dev && git config --global --add safe.directory /$(basename ${{ github.workspace }})"
MATRIX_MIN_SWIFT_VERSION: ${{ inputs.minimum_swift_version }}
MATRIX_LINUX_5_9_ENABLED: ${{ inputs.linux_5_9_enabled }}
MATRIX_LINUX_5_10_ENABLED: ${{ inputs.linux_5_10_enabled }}
MATRIX_LINUX_6_0_ENABLED: ${{ inputs.linux_6_0_enabled }}
MATRIX_LINUX_6_1_ENABLED: ${{ inputs.linux_6_1_enabled }}
MATRIX_LINUX_6_2_ENABLED: ${{ inputs.linux_6_2_enabled }}
MATRIX_LINUX_NIGHTLY_NEXT_ENABLED: ${{ inputs.linux_nightly_6_1_enabled && inputs.linux_nightly_next_enabled }}
MATRIX_LINUX_NIGHTLY_MAIN_ENABLED: ${{ inputs.linux_nightly_main_enabled }}
benchmarks-linux:
name: Benchmarks
needs: construct-matrix-linux
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@main
with:
name: "Benchmarks"
matrix_string: '${{ needs.construct-matrix-linux.outputs.benchmarks-matrix }}'
================================================
FILE: .github/workflows/cmake_tests.yml
================================================
name: CMake build
permissions:
contents: read
on:
workflow_call:
inputs:
update_cmake_lists_config:
type: string
description: "The configuration used when updating the CMake lists."
required: true
cmake_build_target_directory:
type: string
description: "The directory to pass to `cmake build`."
default: "."
cmake_version:
type: string
description: "The version of CMake to install."
default: ""
image:
type: string
description: "The docker image to run the checks in."
default: "swift:6.0-jammy"
jobs:
cmake-checks:
name: CMake checks
runs-on: ubuntu-latest
container:
image: ${{ inputs.image }}
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
submodules: true
- name: Mark the workspace as safe
# https://github.com/actions/checkout/issues/766
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Check CMakeLists files
run: |
which curl jq || apt -q update
which curl || apt -yq install curl
which jq || apt -yq install jq
curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/update-cmake-lists.sh | CONFIG_JSON="$INPUT_UPDATE_CMAKE_LISTS_CONFIG" FAIL_ON_CHANGES=true bash
env:
INPUT_UPDATE_CMAKE_LISTS_CONFIG: ${{ inputs.update_cmake_lists_config }}
- name: CMake build
run: |
which curl cmake ninja || apt -q update
which curl || apt -yq install curl
which cmake || apt -yq install cmake
which ninja || apt -yq install ninja-build
curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/cmake-build.sh | TARGET_DIRECTORY="$INPUT_CMAKE_BUILD_TARGET_DIRECTORY" CMAKE_VERSION="$INPUT_CMAKE_VERSION" bash
env:
INPUT_CMAKE_BUILD_TARGET_DIRECTORY: ${{ inputs.cmake_build_target_directory }}
INPUT_CMAKE_VERSION: ${{ inputs.cmake_version }}
================================================
FILE: .github/workflows/cxx_interop.yml
================================================
name: Cxx interop
permissions:
contents: read
on:
workflow_call:
inputs:
linux_5_9_enabled:
type: boolean
description: "Boolean to enable the Linux 5.9 Swift version matrix job. Defaults to false."
default: false
linux_5_10_enabled:
type: boolean
description: "Boolean to enable the Linux 5.10 Swift version matrix job. Defaults to false."
default: false
linux_6_0_enabled:
type: boolean
description: "Boolean to enable the Linux 6.0 Swift version matrix job. Defaults to true."
default: true
linux_6_1_enabled:
type: boolean
description: "Boolean to enable the Linux 6.1 Swift version matrix job. Defaults to true."
default: true
linux_6_2_enabled:
type: boolean
description: "Boolean to enable the Linux 6.2 Swift version matrix job. Defaults to true."
default: true
linux_nightly_6_0_enabled:
type: boolean
description: "⚠️ Deprecated, we no longer run against 6.0 nightly."
default: false
linux_nightly_6_1_enabled:
type: boolean
description: "⚠️ Deprecated, use linux_nightly_next_enabled."
default: true
linux_nightly_next_enabled:
type: boolean
description: "Boolean to enable the Linux matrix job using the nightly build for the next Swift version. Defaults to true."
default: true
linux_nightly_main_enabled:
type: boolean
description: "Boolean to enable the Linux nightly main Swift version matrix job. Defaults to true."
default: true
windows_6_0_enabled:
type: boolean
description: "Boolean to enable the Windows 6.0 Swift version matrix job. Defaults to false. Currently has no effect!" # TODO: implement Windows Cxx compat checking
default: false
windows_6_1_enabled:
type: boolean
description: "Boolean to enable the Windows 6.1 Swift version matrix job. Defaults to false. Currently has no effect!" # TODO: implement Windows Cxx compat checking
default: false
windows_6_2_enabled:
type: boolean
description: "Boolean to enable the Windows 6.2 Swift version matrix job. Defaults to false. Currently has no effect!" # TODO: implement Windows Cxx compat checking
default: false
windows_nightly_6_0_enabled:
type: boolean
description: "⚠️ Deprecated, we no longer run against 6.0 nightly." # TODO: implement Windows Cxx compat checking
default: false
windows_nightly_main_enabled:
type: boolean
description: "Boolean to enable the Windows nightly main Swift version matrix job. Defaults to false. Currently has no effect!" # TODO: implement Windows Cxx compat checking
default: false
linux_env_vars:
type: string
description: "Environment variables for Linux jobs as JSON (e.g., '{\"DEBUG\":\"1\",\"LOG_LEVEL\":\"info\"}')."
default: "{}"
windows_env_vars:
type: string
description: "Environment variables for Windows jobs as JSON (e.g., '{\"DEBUG\":\"1\",\"LOG_LEVEL\":\"info\"}')."
default: "{}"
minimum_swift_version:
type: string
description: "Minimum Swift version to include in the matrix. Leave empty for auto-detection from Package.swift, specify a version like '6.0' to override, or set to 'none' to disable filtering."
default: ""
jobs:
construct-matrix:
name: Construct Cxx interop matrix
runs-on: ubuntu-latest
outputs:
cxx-interop-matrix: '${{ steps.generate-matrix.outputs.cxx-interop-matrix }}'
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- id: generate-matrix
run: |
# Validate JSON environment variables
linux_env_vars_json="$INPUT_LINUX_ENV_VARS"
windows_env_vars_json="$INPUT_WINDOWS_ENV_VARS"
if ! echo "$linux_env_vars_json" | jq empty 2>/dev/null; then
echo "Error: linux_env_vars is not valid JSON"
exit 1
fi
if ! echo "$windows_env_vars_json" | jq empty 2>/dev/null; then
echo "Error: windows_env_vars is not valid JSON"
exit 1
fi
echo "cxx-interop-matrix=$(curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/generate_matrix.sh | MATRIX_LINUX_ENV_VARS_JSON="${linux_env_vars_json}" MATRIX_WINDOWS_ENV_VARS_JSON="${windows_env_vars_json}" bash)" >> "$GITHUB_OUTPUT"
env:
INPUT_LINUX_ENV_VARS: ${{ inputs.linux_env_vars }}
INPUT_WINDOWS_ENV_VARS: ${{ inputs.windows_env_vars }}
MATRIX_LINUX_COMMAND: "curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-cxx-interop-compatibility.sh | bash"
MATRIX_LINUX_SETUP_COMMAND: "swift --version && apt-get update -y -q && apt-get install -y -q curl jq"
MATRIX_MIN_SWIFT_VERSION: ${{ inputs.minimum_swift_version }}
MATRIX_LINUX_5_9_ENABLED: ${{ inputs.linux_5_9_enabled }}
MATRIX_LINUX_5_10_ENABLED: ${{ inputs.linux_5_10_enabled }}
MATRIX_LINUX_6_0_ENABLED: ${{ inputs.linux_6_0_enabled }}
MATRIX_LINUX_6_1_ENABLED: ${{ inputs.linux_6_1_enabled }}
MATRIX_LINUX_6_2_ENABLED: ${{ inputs.linux_6_2_enabled }}
MATRIX_LINUX_NIGHTLY_NEXT_ENABLED: ${{ inputs.linux_nightly_6_1_enabled && inputs.linux_nightly_next_enabled }}
MATRIX_LINUX_NIGHTLY_MAIN_ENABLED: ${{ inputs.linux_nightly_main_enabled }}
cxx-interop:
name: Cxx interop
needs: construct-matrix
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@main
with:
name: "Cxx interop"
matrix_string: '${{ needs.construct-matrix.outputs.cxx-interop-matrix }}'
================================================
FILE: .github/workflows/macos_benchmarks.yml
================================================
name: macOS benchmarks
permissions:
contents: read
on:
workflow_call:
inputs:
benchmark_package_path:
type: string
description: "Path to the directory containing the benchmarking package. Defaults to ."
default: "."
swift_package_arguments:
type: string
description: "Arguments to the switch package command invocation e.g. `--disable-sandbox`"
macos_xcode_16_3_enabled:
type: boolean
description: "Boolean to enable the macOS Xcode 16.3 benchmark job. Defaults to false."
default: false
macos_xcode_16_4_enabled:
type: boolean
description: "Boolean to enable the macOS Xcode 16.4 benchmark job. Defaults to false."
default: false
macos_xcode_26_0_enabled:
type: boolean
description: "Boolean to enable the macOS Xcode 26.0 benchmark job. Defaults to false."
default: false
macos_xcode_26_1_enabled:
type: boolean
description: "Boolean to enable the macOS Xcode 26.1 benchmark job. Defaults to false."
default: false
macos_xcode_26_2_enabled:
type: boolean
description: "Boolean to enable the macOS Xcode 26.2 benchmark job. Defaults to false."
default: false
macos_xcode_latest_beta_enabled:
type: boolean
description: "Boolean to enable the macOS Xcode latest beta benchmark job. Defaults to false."
default: false
macos_swift_6_1_enabled:
type: boolean
description: "Boolean to enable the macOS Swift 6.1 benchmark job. Defaults to false."
default: false
macos_swift_6_2_enabled:
type: boolean
description: "Boolean to enable the macOS Swift 6.2 benchmark job. Defaults to false."
default: false
macos_swift_6_3_enabled:
type: boolean
description: "Boolean to enable the macOS Swift 6.3 benchmark job. Defaults to false."
default: false
macos_runner_pool:
type: string
description: "The runner pool which will be requested for macOS jobs."
default: "nightly"
macos_env_vars:
type: string
description: "Environment variables for macOS jobs as JSON (e.g., '{\"DEBUG\":\"1\",\"LOG_LEVEL\":\"info\"}')."
default: "{}"
minimum_swift_version:
type: string
description: "Minimum Swift version to include in the matrix. Leave empty for auto-detection from Package.swift, specify a version like '6.0' to override, or set to 'none' to disable filtering."
default: ""
jobs:
construct-matrix-macos:
name: Construct macOS Benchmarks matrix
runs-on: ubuntu-latest
if: |
inputs.macos_xcode_16_3_enabled ||
inputs.macos_xcode_16_4_enabled ||
inputs.macos_xcode_26_0_enabled ||
inputs.macos_xcode_26_1_enabled ||
inputs.macos_xcode_26_2_enabled ||
inputs.macos_xcode_latest_beta_enabled ||
inputs.macos_swift_6_1_enabled ||
inputs.macos_swift_6_2_enabled ||
inputs.macos_swift_6_3_enabled
outputs:
macos-matrix: '${{ steps.generate-matrix.outputs.macos-matrix }}'
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- id: generate-matrix
run: |
# Validate JSON environment variables
macos_env_vars_json="$INPUT_MACOS_ENV_VARS"
if ! echo "$macos_env_vars_json" | jq empty 2>/dev/null; then
echo "Error: macos_env_vars is not valid JSON"
exit 1
fi
runner_pool="${MACOS_RUNNER_POOL}"
xcode_16_3_enabled="${MACOS_XCODE_16_3_ENABLED}"
xcode_16_4_enabled="${MACOS_XCODE_16_4_ENABLED}"
xcode_26_0_enabled="${MACOS_XCODE_26_0_ENABLED}"
xcode_26_1_enabled="${MACOS_XCODE_26_1_ENABLED}"
xcode_26_2_enabled="${MACOS_XCODE_26_2_ENABLED}"
xcode_latest_beta_enabled="${MACOS_XCODE_LATEST_BETA_ENABLED}"
swift_6_1_enabled="${MACOS_SWIFT_6_1_ENABLED}"
swift_6_2_enabled="${MACOS_SWIFT_6_2_ENABLED}"
swift_6_3_enabled="${MACOS_SWIFT_6_3_ENABLED}"
# Create matrix from inputs
matrix='{"config": []}'
if [[ "$xcode_16_3_enabled" == "true" ]]; then
matrix=$(echo "$matrix" | jq -c \
--arg runner_pool "$runner_pool" \
--argjson env_vars "$macos_env_vars_json" \
'.config[.config| length] |= . + { "name": "macOS (Xcode 16.3)", "xcode_version": "16.3", "xcode_app": "Xcode_16.3.app", "os": "tahoe", "arch": "ARM64", "pool": $runner_pool, "env": $env_vars }')
fi
if [[ "$xcode_16_4_enabled" == "true" ]]; then
matrix=$(echo "$matrix" | jq -c \
--arg runner_pool "$runner_pool" \
--argjson env_vars "$macos_env_vars_json" \
'.config[.config| length] |= . + { "name": "macOS (Xcode 16.4)", "xcode_version": "16.4", "xcode_app": "Xcode_16.4.app", "os": "tahoe", "arch": "ARM64", "pool": $runner_pool, "env": $env_vars }')
fi
if [[ "$xcode_26_0_enabled" == "true" ]]; then
matrix=$(echo "$matrix" | jq -c \
--arg runner_pool "$runner_pool" \
--argjson env_vars "$macos_env_vars_json" \
'.config[.config| length] |= . + { "name": "macOS (Xcode 26.0)", "xcode_version": "26.0", "xcode_app": "Xcode_26.0.app", "os": "tahoe", "arch": "ARM64", "pool": $runner_pool, "env": $env_vars }')
fi
if [[ "$xcode_26_1_enabled" == "true" ]]; then
matrix=$(echo "$matrix" | jq -c \
--arg runner_pool "$runner_pool" \
--argjson env_vars "$macos_env_vars_json" \
'.config[.config| length] |= . + { "name": "macOS (Xcode 26.1)", "xcode_version": "26.1", "xcode_app": "Xcode_26.1.app", "os": "tahoe", "arch": "ARM64", "pool": $runner_pool, "env": $env_vars }')
fi
if [[ "$xcode_26_2_enabled" == "true" ]]; then
matrix=$(echo "$matrix" | jq -c \
--arg runner_pool "$runner_pool" \
--argjson env_vars "$macos_env_vars_json" \
'.config[.config| length] |= . + { "name": "macOS (Xcode 26.2)", "xcode_version": "26.2", "xcode_app": "Xcode_26.2.app", "os": "tahoe", "arch": "ARM64", "pool": $runner_pool, "env": $env_vars }')
fi
if [[ "$xcode_latest_beta_enabled" == "true" ]]; then
matrix=$(echo "$matrix" | jq -c \
--arg runner_pool "$runner_pool" \
--argjson env_vars "$macos_env_vars_json" \
'.config[.config| length] |= . + { "name": "macOS (Xcode latest beta)", "xcode_version": "latest beta", "xcode_app": "Xcode-latest.app", "os": "tahoe", "arch": "ARM64", "pool": $runner_pool, "env": $env_vars }')
fi
if [[ "$swift_6_1_enabled" == "true" ]]; then
matrix=$(echo "$matrix" | jq -c \
--arg runner_pool "$runner_pool" \
--argjson env_vars "$macos_env_vars_json" \
'.config[.config| length] |= . + { "name": "macOS (Swift 6.1)", "xcode_version": "swift 6.1", "xcode_app": "Xcode_swift_6.1.app", "os": "tahoe", "arch": "ARM64", "pool": $runner_pool, "env": $env_vars }')
fi
if [[ "$swift_6_2_enabled" == "true" ]]; then
matrix=$(echo "$matrix" | jq -c \
--arg runner_pool "$runner_pool" \
--argjson env_vars "$macos_env_vars_json" \
'.config[.config| length] |= . + { "name": "macOS (Swift 6.2)", "xcode_version": "swift 6.2", "xcode_app": "Xcode_swift_6.2.app", "os": "tahoe", "arch": "ARM64", "pool": $runner_pool, "env": $env_vars }')
fi
if [[ "$swift_6_3_enabled" == "true" ]]; then
matrix=$(echo "$matrix" | jq -c \
--arg runner_pool "$runner_pool" \
--argjson env_vars "$macos_env_vars_json" \
'.config[.config| length] |= . + { "name": "macOS (Swift 6.3)", "xcode_version": "swift 6.3", "xcode_app": "Xcode_swift_6.3.app", "os": "tahoe", "arch": "ARM64", "pool": $runner_pool, "env": $env_vars }')
fi
echo "macos-matrix=$matrix" >> "$GITHUB_OUTPUT"
env:
INPUT_MACOS_ENV_VARS: ${{ inputs.macos_env_vars }}
MACOS_RUNNER_POOL: ${{ inputs.macos_runner_pool }}
MACOS_XCODE_16_3_ENABLED: ${{ inputs.macos_xcode_16_3_enabled }}
MACOS_XCODE_16_4_ENABLED: ${{ inputs.macos_xcode_16_4_enabled }}
MACOS_XCODE_26_0_ENABLED: ${{ inputs.macos_xcode_26_0_enabled }}
MACOS_XCODE_26_1_ENABLED: ${{ inputs.macos_xcode_26_1_enabled }}
MACOS_XCODE_26_2_ENABLED: ${{ inputs.macos_xcode_26_2_enabled }}
MACOS_XCODE_LATEST_BETA_ENABLED: ${{ inputs.macos_xcode_latest_beta_enabled }}
MACOS_SWIFT_6_1_ENABLED: ${{ inputs.macos_swift_6_1_enabled }}
MACOS_SWIFT_6_2_ENABLED: ${{ inputs.macos_swift_6_2_enabled }}
MACOS_SWIFT_6_3_ENABLED: ${{ inputs.macos_swift_6_3_enabled }}
benchmarks-macos:
name: ${{ matrix.config.name }}
needs: construct-matrix-macos
runs-on: [self-hosted, macos, "${{ matrix.config.os }}", "${{ matrix.config.arch }}", "${{ matrix.config.pool }}"]
timeout-minutes: 30
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.construct-matrix-macos.outputs.macos-matrix) }}
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
submodules: true
- name: Install jemalloc
run: |
brew install jemalloc
- name: Export environment variables
if: ${{ matrix.config.env != '' && matrix.config.env != '{}'}}
run: |
echo "Exporting environment variables from matrix configuration..."
echo "$MATRIX_ENV_JSON" | jq -r 'to_entries[] | "\(.key)=\(.value)"' >> $GITHUB_ENV
echo "$MATRIX_ENV_JSON" | jq -r 'to_entries[] | "exporting \(.key)=\(.value)"'
env:
MATRIX_ENV_JSON: ${{ toJSON(matrix.config.env) }}
- name: Run benchmarks script
run: |
curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check_benchmark_thresholds.sh | BENCHMARK_PACKAGE_PATH="$INPUT_BENCHMARK_PACKAGE_PATH" bash -s -- --disable-sandbox --allow-writing-to-package-directory
env:
INPUT_BENCHMARK_PACKAGE_PATH: ${{ inputs.benchmark_package_path }}
DEVELOPER_DIR: "/Applications/${{ matrix.config.xcode_app }}"
SWIFT_VERSION: "Xcode ${{ matrix.config.xcode_version }}"
================================================
FILE: .github/workflows/macos_tests.yml
================================================
name: macOS tests
permissions:
contents: read
on:
workflow_call:
inputs:
xcode_15_4_enabled:
type: boolean
description: "⚠️ Jobs with this version of Xcode are deprecated."
default: false
xcode_15_4_test_arguments_override:
type: string
description: "⚠️ Deprecated."
default: ""
xcode_16_0_enabled:
type: boolean
description: "⚠️ Jobs with this version of Xcode are deprecated."
default: false
xcode_16_0_build_arguments_override:
type: string
description: "The arguments passed to swift build in the macOS 5.10 Swift version matrix job."
default: ""
xcode_16_0_test_arguments_override:
type: string
description: "The arguments passed to swift test in the macOS 5.10 Swift version matrix job."
default: ""
xcode_16_0_setup_command:
type: string
description: "The command(s) to be executed before all other work."
default: ""
xcode_16_1_enabled:
type: boolean
description: "⚠️ Jobs with this version of Xcode are deprecated."
default: false
xcode_16_1_build_arguments_override:
type: string
description: "The arguments passed to swift build in the Xcode version 16.1 job."
default: ""
xcode_16_1_test_arguments_override:
type: string
description: "The arguments passed to swift test in the Xcode version 16.1 job."
default: ""
xcode_16_1_setup_command:
type: string
description: "The command(s) to be executed before all other work."
default: ""
xcode_16_2_enabled:
type: boolean
description: "⚠️ Jobs with this version of Xcode are deprecated."
default: false
xcode_16_2_build_arguments_override:
type: string
description: "The arguments passed to swift build in the Xcode version 16.2 job."
default: ""
xcode_16_2_test_arguments_override:
type: string
description: "The arguments passed to swift test in the Xcode version 16.2 job."
default: ""
xcode_16_2_setup_command:
type: string
description: "The command(s) to be executed before all other work."
default: ""
xcode_16_3_enabled:
type: boolean
description: "Boolean to enable the Xcode version 16.3 jobs. Defaults to true."
default: true
xcode_16_3_build_arguments_override:
type: string
description: "The arguments passed to swift build in the Xcode version 16.3 job."
default: ""
xcode_16_3_test_arguments_override:
type: string
description: "The arguments passed to swift test in the Xcode version 16.3 job."
default: ""
xcode_16_3_setup_command:
type: string
description: "The command(s) to be executed before all other work."
default: ""
xcode_16_4_enabled:
type: boolean
description: "Boolean to enable the Xcode version 16.4 jobs. Defaults to true."
default: true
xcode_16_4_build_arguments_override:
type: string
description: "The arguments passed to swift build in the Xcode version 16.4 job."
default: ""
xcode_16_4_test_arguments_override:
type: string
description: "The arguments passed to swift test in the Xcode version 16.4 job."
default: ""
xcode_16_4_setup_command:
type: string
description: "The command(s) to be executed before all other work."
default: ""
xcode_26_0_enabled:
type: boolean
description: "Boolean to enable the Xcode version 26.0 jobs. Defaults to true."
default: true
xcode_26_0_build_arguments_override:
type: string
description: "The arguments passed to swift build in the Xcode version 26.0 job."
default: ""
xcode_26_0_test_arguments_override:
type: string
description: "The arguments passed to swift test in the Xcode version 26.0 job."
default: ""
xcode_26_0_setup_command:
type: string
description: "The command(s) to be executed before all other work."
default: ""
xcode_26_1_enabled:
type: boolean
description: "Boolean to enable the Xcode version 26.1 jobs. Defaults to true."
default: true
xcode_26_1_build_arguments_override:
type: string
description: "The arguments passed to swift build in the Xcode version 26.1 job."
default: ""
xcode_26_1_test_arguments_override:
type: string
description: "The arguments passed to swift test in the Xcode version 26.1 job."
default: ""
xcode_26_1_setup_command:
type: string
description: "The command(s) to be executed before all other work."
default: ""
xcode_26_2_enabled:
type: boolean
description: "Boolean to enable the Xcode version 26.2 jobs. Defaults to true."
default: true
xcode_26_2_build_arguments_override:
type: string
description: "The arguments passed to swift build in the Xcode version 26.2 job."
default: ""
xcode_26_2_test_arguments_override:
type: string
description: "The arguments passed to swift test in the Xcode version 26.2 job."
default: ""
xcode_26_2_setup_command:
type: string
description: "The command(s) to be executed before all other work."
default: ""
xcode_26_beta_enabled:
type: boolean
description: "⚠️ Deprecated."
default: false
xcode_26_beta_1_build_arguments_override:
type: string
description: "⚠️ Deprecated."
default: ""
xcode_26_beta_1_test_arguments_override:
type: string
description: "⚠️ Deprecated."
default: ""
xcode_26_beta_1_setup_command:
type: string
description: "⚠️ Deprecated."
default: ""
xcode_latest_beta_enabled:
type: boolean
description: "Boolean to enable the Xcode beta jobs (uses latest beta if one currently exists). Defaults to true."
default: false
xcode_latest_beta_build_arguments_override:
type: string
description: "The arguments passed to swift build in the Xcode beta job."
default: ""
xcode_latest_beta_test_arguments_override:
type: string
description: "The arguments passed to swift test in the Xcode beta job."
default: ""
xcode_latest_beta_setup_command:
type: string
description: "The command(s) to be executed before all other work."
default: ""
swift_6_1_enabled:
type: boolean
description: "Boolean to enable the Swift 6.1 jobs. Defaults to false."
default: false
swift_6_1_build_arguments_override:
type: string
description: "The arguments passed to swift build in the Swift 6.1 job."
default: ""
swift_6_1_test_arguments_override:
type: string
description: "The arguments passed to swift test in the Swift 6.1 job."
default: ""
swift_6_1_setup_command:
type: string
description: "The command(s) to be executed before all other work."
default: ""
swift_6_2_enabled:
type: boolean
description: "Boolean to enable the Swift 6.2 jobs. Defaults to false."
default: false
swift_6_2_build_arguments_override:
type: string
description: "The arguments passed to swift build in the Swift 6.2 job."
default: ""
swift_6_2_test_arguments_override:
type: string
description: "The arguments passed to swift test in the Swift 6.2 job."
default: ""
swift_6_2_setup_command:
type: string
description: "The command(s) to be executed before all other work."
default: ""
swift_6_3_enabled:
type: boolean
description: "Boolean to enable the Swift 6.3 jobs. Defaults to false."
default: false
swift_6_3_build_arguments_override:
type: string
description: "The arguments passed to swift build in the Swift 6.3 job."
default: ""
swift_6_3_test_arguments_override:
type: string
description: "The arguments passed to swift test in the Swift 6.3 job."
default: ""
swift_6_3_setup_command:
type: string
description: "The command(s) to be executed before all other work."
default: ""
build_scheme:
type: string
description: "The build scheme used in the Xcode builds."
swift_test_enabled:
type: boolean
description: "Boolean to enable test execution with `swift test`. Defaults to true."
default: true
macos_xcode_build_enabled:
type: boolean
description: "Boolean to enable the Xcode build targeting macOS. Defaults to true."
default: true
macos_xcode_test_enabled:
type: boolean
description: "Boolean to enable the Xcode test targeting macOS. Defaults to false."
default: false
ios_xcode_build_enabled:
type: boolean
description: "Boolean to enable the Xcode build targeting iOS. Defaults to true."
default: true
ios_xcode_test_enabled:
type: boolean
description: "Boolean to enable the Xcode test targeting iOS. Defaults to false."
default: false
watchos_xcode_build_enabled:
type: boolean
description: "Boolean to enable the Xcode build targeting watchOS. Defaults to true."
default: true
watchos_xcode_test_enabled:
type: boolean
description: "Boolean to enable the Xcode test targeting watchOS. Defaults to false."
default: false
tvos_xcode_build_enabled:
type: boolean
description: "Boolean to enable the Xcode build targeting tvOS. Defaults to true."
default: true
tvos_xcode_test_enabled:
type: boolean
description: "Boolean to enable the Xcode test targeting tvOS. Defaults to false."
default: false
visionos_xcode_build_enabled:
type: boolean
description: "Boolean to enable the Xcode build targeting visionOS. Defaults to true."
default: true
visionos_xcode_test_enabled:
type: boolean
description: "Boolean to enable the Xcode test targeting visionOS. Defaults to false."
default: false
runner_pool:
type: string
description: "The runner pool which will be requested."
default: "nightly"
debug_output_enabled:
type: boolean
description: "Boolean to enable debug output from xcodebuild by eliding -quiet. Defaults to false."
default: false
env_vars:
type: string
description: "Environment variables for jobs as JSON (e.g., '{\"DEBUG\":\"1\",\"LOG_LEVEL\":\"info\"}')."
default: "{}"
jobs:
construct-matrix:
name: Construct Darwin matrix
runs-on: ubuntu-latest
outputs:
darwin-matrix: '${{ steps.generate-matrix.outputs.darwin-matrix }}'
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- id: generate-matrix
run: |
# Validate and use JSON environment variables directly
env_vars_json="$INPUT_ENV_VARS"
# Validate JSON format
if ! echo "$env_vars_json" | jq empty 2>/dev/null; then
echo "Error: env_vars is not valid JSON"
exit 1
fi
cat >> "$GITHUB_OUTPUT" << EOM
darwin-matrix=$(
runner_pool="${MATRIX_RUNNER_POOL:="nightly"}"
xcode_15_4_enabled="${MATRIX_MACOS_15_4_ENABLED:=true}"
xcode_15_4_build_arguments_override="${MATRIX_MACOS_15_4_BUILD_ARGUMENTS_OVERRIDE:=""}"
xcode_15_4_test_arguments_override="${MATRIX_MACOS_15_4_TEST_ARGUMENTS_OVERRIDE:=""}"
xcode_15_4_setup_command="${MATRIX_MACOS_15_4_SETUP_COMMAND:=""}"
xcode_16_0_enabled="${MATRIX_MACOS_16_0_ENABLED:=true}"
xcode_16_0_build_arguments_override="${MATRIX_MACOS_16_0_BUILD_ARGUMENTS_OVERRIDE:=""}"
xcode_16_0_test_arguments_override="${MATRIX_MACOS_16_0_TEST_ARGUMENTS_OVERRIDE:=""}"
xcode_16_0_setup_command="${MATRIX_MACOS_16_0_SETUP_COMMAND:=""}"
xcode_16_1_enabled="${MATRIX_MACOS_16_1_ENABLED:=true}"
xcode_16_1_build_arguments_override="${MATRIX_MACOS_16_1_BUILD_ARGUMENTS_OVERRIDE:=""}"
xcode_16_1_test_arguments_override="${MATRIX_MACOS_16_1_TEST_ARGUMENTS_OVERRIDE:=""}"
xcode_16_1_setup_command="${MATRIX_MACOS_16_1_SETUP_COMMAND:=""}"
xcode_16_2_enabled="${MATRIX_MACOS_16_2_ENABLED:=true}"
xcode_16_2_build_arguments_override="${MATRIX_MACOS_16_2_BUILD_ARGUMENTS_OVERRIDE:=""}"
xcode_16_2_test_arguments_override="${MATRIX_MACOS_16_2_TEST_ARGUMENTS_OVERRIDE:=""}"
xcode_16_2_setup_command="${MATRIX_MACOS_16_2_SETUP_COMMAND:=""}"
xcode_16_3_enabled="${MATRIX_MACOS_16_3_ENABLED:=true}"
xcode_16_3_build_arguments_override="${MATRIX_MACOS_16_3_BUILD_ARGUMENTS_OVERRIDE:=""}"
xcode_16_3_test_arguments_override="${MATRIX_MACOS_16_3_TEST_ARGUMENTS_OVERRIDE:=""}"
xcode_16_3_setup_command="${MATRIX_MACOS_16_3_SETUP_COMMAND:=""}"
xcode_16_4_enabled="${MATRIX_MACOS_16_4_ENABLED:=true}"
xcode_16_4_build_arguments_override="${MATRIX_MACOS_16_4_BUILD_ARGUMENTS_OVERRIDE:=""}"
xcode_16_4_test_arguments_override="${MATRIX_MACOS_16_4_TEST_ARGUMENTS_OVERRIDE:=""}"
xcode_16_4_setup_command="${MATRIX_MACOS_16_4_SETUP_COMMAND:=""}"
xcode_26_0_enabled="${MATRIX_MACOS_26_0_ENABLED:=true}"
xcode_26_0_build_arguments_override="${MATRIX_MACOS_26_0_BUILD_ARGUMENTS_OVERRIDE:=""}"
xcode_26_0_test_arguments_override="${MATRIX_MACOS_26_0_TEST_ARGUMENTS_OVERRIDE:=""}"
xcode_26_0_setup_command="${MATRIX_MACOS_26_0_SETUP_COMMAND:=""}"
xcode_26_1_enabled="${MATRIX_MACOS_26_1_ENABLED:=true}"
xcode_26_1_build_arguments_override="${MATRIX_MACOS_26_1_BUILD_ARGUMENTS_OVERRIDE:=""}"
xcode_26_1_test_arguments_override="${MATRIX_MACOS_26_1_TEST_ARGUMENTS_OVERRIDE:=""}"
xcode_26_1_setup_command="${MATRIX_MACOS_26_1_SETUP_COMMAND:=""}"
xcode_26_2_enabled="${MATRIX_MACOS_26_2_ENABLED:=true}"
xcode_26_2_build_arguments_override="${MATRIX_MACOS_26_2_BUILD_ARGUMENTS_OVERRIDE:=""}"
xcode_26_2_test_arguments_override="${MATRIX_MACOS_26_2_TEST_ARGUMENTS_OVERRIDE:=""}"
xcode_26_2_setup_command="${MATRIX_MACOS_26_2_SETUP_COMMAND:=""}"
xcode_latest_beta_enabled="${MATRIX_MACOS_26_BETA_1_ENABLED:=true}" # TODO: remove once no repos use this
xcode_latest_beta_build_arguments_override="${MATRIX_MACOS_26_BETA_1_BUILD_ARGUMENTS_OVERRIDE:=""}" # TODO: remove once no repos use this
xcode_latest_beta_test_arguments_override="${MATRIX_MACOS_26_BETA_1_TEST_ARGUMENTS_OVERRIDE:=""}" # TODO: remove once no repos use this
xcode_latest_beta_setup_command="${MATRIX_MACOS_26_BETA_1_SETUP_COMMAND:=""}" # TODO: remove once no repos use this
xcode_latest_beta_enabled="${MATRIX_MACOS_LATEST_BETA_ENABLED:=true}"
xcode_latest_beta_build_arguments_override="${MATRIX_MACOS_LATEST_BETA_BUILD_ARGUMENTS_OVERRIDE:=""}"
xcode_latest_beta_test_arguments_override="${MATRIX_MACOS_LATEST_BETA_TEST_ARGUMENTS_OVERRIDE:=""}"
xcode_latest_beta_setup_command="${MATRIX_MACOS_LATEST_BETA_SETUP_COMMAND:=""}"
swift_6_1_enabled="${MATRIX_SWIFT_6_1_ENABLED:=true}"
swift_6_1_build_arguments_override="${MATRIX_SWIFT_6_1_BUILD_ARGUMENTS_OVERRIDE:=""}"
swift_6_1_test_arguments_override="${MATRIX_SWIFT_6_1_TEST_ARGUMENTS_OVERRIDE:=""}"
swift_6_1_setup_command="${MATRIX_SWIFT_6_1_SETUP_COMMAND:=""}"
swift_6_2_enabled="${MATRIX_SWIFT_6_2_ENABLED:=true}"
swift_6_2_build_arguments_override="${MATRIX_SWIFT_6_2_BUILD_ARGUMENTS_OVERRIDE:=""}"
swift_6_2_test_arguments_override="${MATRIX_SWIFT_6_2_TEST_ARGUMENTS_OVERRIDE:=""}"
swift_6_2_setup_command="${MATRIX_SWIFT_6_2_SETUP_COMMAND:=""}"
swift_6_3_enabled="${MATRIX_SWIFT_6_3_ENABLED:=true}"
swift_6_3_build_arguments_override="${MATRIX_SWIFT_6_3_BUILD_ARGUMENTS_OVERRIDE:=""}"
swift_6_3_test_arguments_override="${MATRIX_SWIFT_6_3_TEST_ARGUMENTS_OVERRIDE:=""}"
swift_6_3_setup_command="${MATRIX_SWIFT_6_3_SETUP_COMMAND:=""}"
# Create matrix from inputs
matrix='{"config": []}'
if [[ "$xcode_15_4_enabled" == "true" ]]; then
matrix=$(echo "$matrix" | jq -c \
--arg setup_command "$xcode_15_4_setup_command" \
--arg build_arguments_override "$xcode_15_4_build_arguments_override" \
--arg test_arguments_override "$xcode_15_4_test_arguments_override" \
--arg runner_pool "$runner_pool" \
--argjson env_vars "$env_vars_json" \
'.config[.config| length] |= . + { "name": "Xcode 15.4", "xcode_version": "15.4", "xcode_app": "Xcode_15.4.app", "setup_command": $setup_command, "build_arguments_override": $build_arguments_override, "test_arguments_override": $test_arguments_override, "os": "tahoe", "arch": "ARM64", "pool": $runner_pool, "env": $env_vars }')
fi
if [[ "$xcode_16_0_enabled" == "true" ]]; then
matrix=$(echo "$matrix" | jq -c \
--arg setup_command "$xcode_16_0_setup_command" \
--arg build_arguments_override "$xcode_16_0_build_arguments_override" \
--arg test_arguments_override "$xcode_16_0_test_arguments_override" \
--arg runner_pool "$runner_pool" \
--argjson env_vars "$env_vars_json" \
'.config[.config| length] |= . + { "name": "Xcode 16.0", "xcode_version": "16.0", "xcode_app": "Xcode_16.0.app", "setup_command": $setup_command, "build_arguments_override": $build_arguments_override, "test_arguments_override": $test_arguments_override, "os": "tahoe", "arch": "ARM64", "pool": $runner_pool, "env": $env_vars }')
fi
if [[ "$xcode_16_1_enabled" == "true" ]]; then
matrix=$(echo "$matrix" | jq -c \
--arg setup_command "$xcode_16_1_setup_command" \
--arg build_arguments_override "$xcode_16_1_build_arguments_override" \
--arg test_arguments_override "$xcode_16_1_test_arguments_override" \
--arg runner_pool "$runner_pool" \
--argjson env_vars "$env_vars_json" \
'.config[.config| length] |= . + { "name": "Xcode 16.1", "xcode_version": "16.1", "xcode_app": "Xcode_16.1.app", "setup_command": $setup_command, "build_arguments_override": $build_arguments_override, "test_arguments_override": $test_arguments_override, "os": "tahoe", "arch": "ARM64", "pool": $runner_pool, "env": $env_vars }')
fi
if [[ "$xcode_16_2_enabled" == "true" ]]; then
matrix=$(echo "$matrix" | jq -c \
--arg setup_command "$xcode_16_2_setup_command" \
--arg build_arguments_override "$xcode_16_2_build_arguments_override" \
--arg test_arguments_override "$xcode_16_2_test_arguments_override" \
--arg runner_pool "$runner_pool" \
--argjson env_vars "$env_vars_json" \
'.config[.config| length] |= . + { "name": "Xcode 16.2", "xcode_version": "16.2", "xcode_app": "Xcode_16.2.app", "setup_command": $setup_command, "build_arguments_override": $build_arguments_override, "test_arguments_override": $test_arguments_override, "os": "tahoe", "arch": "ARM64", "pool": $runner_pool, "env": $env_vars }')
fi
if [[ "$xcode_16_3_enabled" == "true" ]]; then
matrix=$(echo "$matrix" | jq -c \
--arg setup_command "$xcode_16_3_setup_command" \
--arg build_arguments_override "$xcode_16_3_build_arguments_override" \
--arg test_arguments_override "$xcode_16_3_test_arguments_override" \
--arg runner_pool "$runner_pool" \
--argjson env_vars "$env_vars_json" \
'.config[.config| length] |= . + { "name": "Xcode 16.3", "xcode_version": "16.3", "xcode_app": "Xcode_16.3.app", "setup_command": $setup_command, "build_arguments_override": $build_arguments_override, "test_arguments_override": $test_arguments_override, "os": "tahoe", "arch": "ARM64", "pool": $runner_pool, "env": $env_vars }')
fi
if [[ "$xcode_16_4_enabled" == "true" ]]; then
matrix=$(echo "$matrix" | jq -c \
--arg setup_command "$xcode_16_4_setup_command" \
--arg build_arguments_override "$xcode_16_4_build_arguments_override" \
--arg test_arguments_override "$xcode_16_4_test_arguments_override" \
--arg runner_pool "$runner_pool" \
--argjson env_vars "$env_vars_json" \
'.config[.config| length] |= . + { "name": "Xcode 16.4", "xcode_version": "16.4", "xcode_app": "Xcode_16.4.app", "setup_command": $setup_command, "build_arguments_override": $build_arguments_override, "test_arguments_override": $test_arguments_override, "os": "tahoe", "arch": "ARM64", "pool": $runner_pool, "env": $env_vars }')
fi
if [[ "$xcode_26_0_enabled" == "true" ]]; then
matrix=$(echo "$matrix" | jq -c \
--arg setup_command "$xcode_26_0_setup_command" \
--arg build_arguments_override "$xcode_26_0_build_arguments_override" \
--arg test_arguments_override "$xcode_26_0_test_arguments_override" \
--arg runner_pool "$runner_pool" \
--argjson env_vars "$env_vars_json" \
'.config[.config| length] |= . + { "name": "Xcode 26.0", "xcode_version": "26.0", "xcode_app": "Xcode_26.0.app", "setup_command": $setup_command, "build_arguments_override": $build_arguments_override, "test_arguments_override": $test_arguments_override, "os": "tahoe", "arch": "ARM64", "pool": $runner_pool, "env": $env_vars }')
fi
if [[ "$xcode_26_1_enabled" == "true" ]]; then
matrix=$(echo "$matrix" | jq -c \
--arg setup_command "$xcode_26_1_setup_command" \
--arg build_arguments_override "$xcode_26_1_build_arguments_override" \
--arg test_arguments_override "$xcode_26_1_test_arguments_override" \
--arg runner_pool "$runner_pool" \
--argjson env_vars "$env_vars_json" \
'.config[.config| length] |= . + { "name": "Xcode 26.1", "xcode_version": "26.1", "xcode_app": "Xcode_26.1.app", "setup_command": $setup_command, "build_arguments_override": $build_arguments_override, "test_arguments_override": $test_arguments_override, "os": "tahoe", "arch": "ARM64", "pool": $runner_pool, "env": $env_vars }')
fi
if [[ "$xcode_26_2_enabled" == "true" ]]; then
matrix=$(echo "$matrix" | jq -c \
--arg setup_command "$xcode_26_2_setup_command" \
--arg build_arguments_override "$xcode_26_2_build_arguments_override" \
--arg test_arguments_override "$xcode_26_2_test_arguments_override" \
--arg runner_pool "$runner_pool" \
--argjson env_vars "$env_vars_json" \
'.config[.config| length] |= . + { "name": "Xcode 26.2", "xcode_version": "26.2", "xcode_app": "Xcode_26.2.app", "setup_command": $setup_command, "build_arguments_override": $build_arguments_override, "test_arguments_override": $test_arguments_override, "os": "tahoe", "arch": "ARM64", "pool": $runner_pool, "env": $env_vars }')
fi
if [[ "$xcode_latest_beta_enabled" == "true" ]]; then
matrix=$(echo "$matrix" | jq -c \
--arg setup_command "$xcode_latest_beta_setup_command" \
--arg build_arguments_override "$xcode_latest_beta_build_arguments_override" \
--arg test_arguments_override "$xcode_latest_beta_test_arguments_override" \
--arg runner_pool "$runner_pool" \
--argjson env_vars "$env_vars_json" \
'.config[.config| length] |= . + { "name": "Xcode latest beta", "xcode_version": "latest beta", "xcode_app": "Xcode-latest.app", "setup_command": $setup_command, "build_arguments_override": $build_arguments_override, "test_arguments_override": $test_arguments_override, "os": "tahoe", "arch": "ARM64", "pool": $runner_pool, "env": $env_vars }')
fi
if [[ "$swift_6_1_enabled" == "true" ]]; then
matrix=$(echo "$matrix" | jq -c \
--arg setup_command "$swift_6_1_setup_command" \
--arg build_arguments_override "$swift_6_1_build_arguments_override" \
--arg test_arguments_override "$swift_6_1_test_arguments_override" \
--arg runner_pool "$runner_pool" \
--argjson env_vars "$env_vars_json" \
'.config[.config| length] |= . + { "name": "Swift 6.1", "xcode_version": "swift 6.1", "xcode_app": "Xcode_swift_6.1.app", "setup_command": $setup_command, "build_arguments_override": $build_arguments_override, "test_arguments_override": $test_arguments_override, "os": "tahoe", "arch": "ARM64", "pool": $runner_pool, "env": $env_vars }')
fi
if [[ "$swift_6_2_enabled" == "true" ]]; then
matrix=$(echo "$matrix" | jq -c \
--arg setup_command "$swift_6_2_setup_command" \
--arg build_arguments_override "$swift_6_2_build_arguments_override" \
--arg test_arguments_override "$swift_6_2_test_arguments_override" \
--arg runner_pool "$runner_pool" \
--argjson env_vars "$env_vars_json" \
'.config[.config| length] |= . + { "name": "Swift 6.2", "xcode_version": "swift 6.2", "xcode_app": "Xcode_swift_6.2.app", "setup_command": $setup_command, "build_arguments_override": $build_arguments_override, "test_arguments_override": $test_arguments_override, "os": "tahoe", "arch": "ARM64", "pool": $runner_pool, "env": $env_vars }')
fi
if [[ "$swift_6_3_enabled" == "true" ]]; then
matrix=$(echo "$matrix" | jq -c \
--arg setup_command "$swift_6_3_setup_command" \
--arg build_arguments_override "$swift_6_3_build_arguments_override" \
--arg test_arguments_override "$swift_6_3_test_arguments_override" \
--arg runner_pool "$runner_pool" \
--argjson env_vars "$env_vars_json" \
'.config[.config| length] |= . + { "name": "Swift 6.3", "xcode_version": "swift 6.3", "xcode_app": "Xcode_swift_6.3.app", "setup_command": $setup_command, "build_arguments_override": $build_arguments_override, "test_arguments_override": $test_arguments_override, "os": "tahoe", "arch": "ARM64", "pool": $runner_pool, "env": $env_vars }')
fi
echo "$matrix" | jq -c
)"
EOM
env:
INPUT_ENV_VARS: ${{ inputs.env_vars }}
MATRIX_RUNNER_POOL: ${{ inputs.runner_pool }}
MATRIX_MACOS_15_4_ENABLED: ${{ inputs.xcode_15_4_enabled }}
MATRIX_MACOS_15_4_BUILD_ARGUMENTS_OVERRIDE: ${{ inputs.xcode_15_4_build_arguments_override }}
MATRIX_MACOS_15_4_TEST_ARGUMENTS_OVERRIDE: ${{ inputs.xcode_15_4_test_arguments_override }}
MATRIX_MACOS_15_4_SETUP_COMMAND: ${{ inputs.xcode_15_4_setup_command }}
MATRIX_MACOS_16_0_ENABLED: ${{ inputs.xcode_16_0_enabled }}
MATRIX_MACOS_16_0_BUILD_ARGUMENTS_OVERRIDE: ${{ inputs.xcode_16_0_build_arguments_override }}
MATRIX_MACOS_16_0_TEST_ARGUMENTS_OVERRIDE: ${{ inputs.xcode_16_0_test_arguments_override }}
MATRIX_MACOS_16_0_SETUP_COMMAND: ${{ inputs.xcode_16_0_setup_command }}
MATRIX_MACOS_16_1_ENABLED: ${{ inputs.xcode_16_1_enabled }}
MATRIX_MACOS_16_1_BUILD_ARGUMENTS_OVERRIDE: ${{ inputs.xcode_16_1_build_arguments_override }}
MATRIX_MACOS_16_1_TEST_ARGUMENTS_OVERRIDE: ${{ inputs.xcode_16_1_test_arguments_override }}
MATRIX_MACOS_16_1_SETUP_COMMAND: ${{ inputs.xcode_16_1_setup_command }}
MATRIX_MACOS_16_2_ENABLED: ${{ inputs.xcode_16_2_enabled }}
MATRIX_MACOS_16_2_BUILD_ARGUMENTS_OVERRIDE: ${{ inputs.xcode_16_2_build_arguments_override }}
MATRIX_MACOS_16_2_TEST_ARGUMENTS_OVERRIDE: ${{ inputs.xcode_16_2_test_arguments_override }}
MATRIX_MACOS_16_2_SETUP_COMMAND: ${{ inputs.xcode_16_2_setup_command }}
MATRIX_MACOS_16_3_ENABLED: ${{ inputs.xcode_16_3_enabled }}
MATRIX_MACOS_16_3_BUILD_ARGUMENTS_OVERRIDE: ${{ inputs.xcode_16_3_build_arguments_override }}
MATRIX_MACOS_16_3_TEST_ARGUMENTS_OVERRIDE: ${{ inputs.xcode_16_3_test_arguments_override }}
MATRIX_MACOS_16_3_SETUP_COMMAND: ${{ inputs.xcode_16_3_setup_command }}
MATRIX_MACOS_16_4_ENABLED: ${{ inputs.xcode_16_4_enabled }}
MATRIX_MACOS_16_4_BUILD_ARGUMENTS_OVERRIDE: ${{ inputs.xcode_16_4_build_arguments_override }}
MATRIX_MACOS_16_4_TEST_ARGUMENTS_OVERRIDE: ${{ inputs.xcode_16_4_test_arguments_override }}
MATRIX_MACOS_16_4_SETUP_COMMAND: ${{ inputs.xcode_16_4_setup_command }}
MATRIX_MACOS_26_0_ENABLED: ${{ inputs.xcode_26_0_enabled }}
MATRIX_MACOS_26_0_BUILD_ARGUMENTS_OVERRIDE: ${{ inputs.xcode_26_0_build_arguments_override }}
MATRIX_MACOS_26_0_TEST_ARGUMENTS_OVERRIDE: ${{ inputs.xcode_26_0_test_arguments_override }}
MATRIX_MACOS_26_0_SETUP_COMMAND: ${{ inputs.xcode_26_0_setup_command }}
MATRIX_MACOS_26_1_ENABLED: ${{ inputs.xcode_26_1_enabled }}
MATRIX_MACOS_26_1_BUILD_ARGUMENTS_OVERRIDE: ${{ inputs.xcode_26_1_build_arguments_override }}
MATRIX_MACOS_26_1_TEST_ARGUMENTS_OVERRIDE: ${{ inputs.xcode_26_1_test_arguments_override }}
MATRIX_MACOS_26_1_SETUP_COMMAND: ${{ inputs.xcode_26_1_setup_command }}
MATRIX_MACOS_26_2_ENABLED: ${{ inputs.xcode_26_2_enabled }}
MATRIX_MACOS_26_2_BUILD_ARGUMENTS_OVERRIDE: ${{ inputs.xcode_26_2_build_arguments_override }}
MATRIX_MACOS_26_2_TEST_ARGUMENTS_OVERRIDE: ${{ inputs.xcode_26_2_test_arguments_override }}
MATRIX_MACOS_26_2_SETUP_COMMAND: ${{ inputs.xcode_26_2_setup_command }}
MATRIX_MACOS_26_BETA_1_ENABLED: ${{ inputs.xcode_26_beta_1_enabled }}
MATRIX_MACOS_26_BETA_1_BUILD_ARGUMENTS_OVERRIDE: ${{ inputs.xcode_26_beta_1_build_arguments_override }}
MATRIX_MACOS_26_BETA_1_TEST_ARGUMENTS_OVERRIDE: ${{ inputs.xcode_26_beta_1_test_arguments_override }}
MATRIX_MACOS_26_BETA_1_SETUP_COMMAND: ${{ inputs.xcode_26_beta_1_setup_command }}
MATRIX_MACOS_LATEST_BETA_ENABLED: ${{ inputs.xcode_latest_beta_enabled }}
MATRIX_MACOS_LATEST_BETA_BUILD_ARGUMENTS_OVERRIDE: ${{ inputs.xcode_latest_beta_build_arguments_override }}
MATRIX_MACOS_LATEST_BETA_TEST_ARGUMENTS_OVERRIDE: ${{ inputs.xcode_latest_beta_test_arguments_override }}
MATRIX_MACOS_LATEST_BETA_SETUP_COMMAND: ${{ inputs.xcode_latest_beta_setup_command }}
MATRIX_SWIFT_6_1_ENABLED: ${{ inputs.swift_6_1_enabled }}
MATRIX_SWIFT_6_1_BUILD_ARGUMENTS_OVERRIDE: ${{ inputs.swift_6_1_build_arguments_override }}
MATRIX_SWIFT_6_1_TEST_ARGUMENTS_OVERRIDE: ${{ inputs.swift_6_1_test_arguments_override }}
MATRIX_SWIFT_6_1_SETUP_COMMAND: ${{ inputs.swift_6_1_setup_command }}
MATRIX_SWIFT_6_2_ENABLED: ${{ inputs.swift_6_2_enabled }}
MATRIX_SWIFT_6_2_BUILD_ARGUMENTS_OVERRIDE: ${{ inputs.swift_6_2_build_arguments_override }}
MATRIX_SWIFT_6_2_TEST_ARGUMENTS_OVERRIDE: ${{ inputs.swift_6_2_test_arguments_override }}
MATRIX_SWIFT_6_2_SETUP_COMMAND: ${{ inputs.swift_6_2_setup_command }}
MATRIX_SWIFT_6_3_ENABLED: ${{ inputs.swift_6_3_enabled }}
MATRIX_SWIFT_6_3_BUILD_ARGUMENTS_OVERRIDE: ${{ inputs.swift_6_3_build_arguments_override }}
MATRIX_SWIFT_6_3_TEST_ARGUMENTS_OVERRIDE: ${{ inputs.swift_6_3_test_arguments_override }}
MATRIX_SWIFT_6_3_SETUP_COMMAND: ${{ inputs.swift_6_3_setup_command }}
darwin-job:
name: ${{ matrix.config.name }}
needs: construct-matrix
if: github.repository_owner == 'apple'
runs-on: [self-hosted, macos, "${{ matrix.config.os }}", "${{ matrix.config.arch }}", "${{ matrix.config.pool }}"]
timeout-minutes: 60
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.construct-matrix.outputs.darwin-matrix) }}
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
submodules: true
- name: Export environment variables
if: ${{ matrix.config.env != '' && matrix.config.env != '{}'}}
run: |
echo "Exporting environment variables from matrix configuration..."
echo "$MATRIX_ENV_JSON" | jq -r 'to_entries[] | "\(.key)=\(.value)"' >> $GITHUB_ENV
echo "$MATRIX_ENV_JSON" | jq -r 'to_entries[] | "exporting \(.key)=\(.value)"'
env:
MATRIX_ENV_JSON: ${{ toJSON(matrix.config.env) }}
- name: Emit diagnostics
run: |
swift --version
/usr/bin/xcodebuild -version
- name: Setup command
if: ${{ matrix.config.setup_command != '' }}
run: bash -c "$MATRIX_SETUP_COMMAND"
env:
MATRIX_SETUP_COMMAND: ${{ matrix.config.setup_command }}
- name: Swift build
run: |
if [ -n "$MATRIX_BUILD_ARGUMENTS_OVERRIDE" ]; then
swift build $MATRIX_BUILD_ARGUMENTS_OVERRIDE
else
swift build --build-tests
fi
env:
MATRIX_BUILD_ARGUMENTS_OVERRIDE: ${{ matrix.config.build_arguments_override }}
- name: Swift test
if: 'inputs.swift_test_enabled'
run: |
if [ -n "$MATRIX_TEST_ARGUMENTS_OVERRIDE" ]; then
swift test $MATRIX_TEST_ARGUMENTS_OVERRIDE
else
swift test
fi
env:
MATRIX_TEST_ARGUMENTS_OVERRIDE: ${{ matrix.config.test_arguments_override }}
# see `xcodebuild -list` for schemes, `simctl list` for destinations
- name: macOS build
if: '!cancelled() && inputs.macos_xcode_build_enabled'
run: /usr/bin/xcodebuild ${QUIET_ARG} -scheme ${BUILD_SCHEME} -destination "generic/platform=macos,variant=macos" build
- name: macOS test
if: '!cancelled() && inputs.macos_xcode_test_enabled'
run: /usr/bin/xcodebuild ${QUIET_ARG} -scheme ${BUILD_SCHEME} -destination "name=My Mac,variant=macos" test
- name: macOS Catalyst build
if: '!cancelled() && inputs.macos_xcode_build_enabled'
run: /usr/bin/xcodebuild ${QUIET_ARG} -scheme ${BUILD_SCHEME} -destination "generic/platform=macos,variant=Mac Catalyst" build
- name: macOS Catalyst test
if: '!cancelled() && inputs.macos_xcode_test_enabled'
run: /usr/bin/xcodebuild ${QUIET_ARG} -scheme ${BUILD_SCHEME} -destination "name=My Mac,variant=Mac Catalyst" test
- name: iOS build
if: '!cancelled() && inputs.ios_xcode_build_enabled'
run: /usr/bin/xcodebuild ${QUIET_ARG} -scheme ${BUILD_SCHEME} -destination "generic/platform=ios" build
- name: iOS test
if: '!cancelled() && inputs.ios_xcode_test_enabled'
run: |
/usr/bin/xcrun simctl shutdown all
/usr/bin/xcodebuild ${QUIET_ARG} -scheme ${BUILD_SCHEME} -destination "name=iPhone Air" test
- name: watchOS build
if: '!cancelled() && inputs.watchos_xcode_build_enabled'
run: /usr/bin/xcodebuild ${QUIET_ARG} -scheme ${BUILD_SCHEME} -destination "generic/platform=watchos" build
- name: watchOS test
if: '!cancelled() && inputs.watchos_xcode_test_enabled'
run: |
/usr/bin/xcrun simctl shutdown all
/usr/bin/xcodebuild ${QUIET_ARG} -scheme ${BUILD_SCHEME} -destination "name=Apple Watch Ultra 3 (49mm)" test
- name: tvOS build
if: '!cancelled() && inputs.tvos_xcode_build_enabled'
run: /usr/bin/xcodebuild ${QUIET_ARG} -scheme ${BUILD_SCHEME} -destination "generic/platform=tvos" build
- name: tvOS test
if: '!cancelled() && inputs.tvos_xcode_test_enabled'
run: |
/usr/bin/xcrun simctl shutdown all
/usr/bin/xcodebuild ${QUIET_ARG} -scheme ${BUILD_SCHEME} -destination "name=Apple TV 4K (3rd generation)" test
- name: visionOS build # arm only
if: '!cancelled() && inputs.visionos_xcode_build_enabled'
run: /usr/bin/xcodebuild ${QUIET_ARG} -scheme ${BUILD_SCHEME} -destination "generic/platform=visionos" build
- name: visionOS test # arm only
if: '!cancelled() && inputs.visionos_xcode_test_enabled'
run: |
/usr/bin/xcrun simctl shutdown all
/usr/bin/xcodebuild ${QUIET_ARG} -scheme ${BUILD_SCHEME} -destination "name=Apple Vision Pro" test
env:
XCODE_VERSION: ${{ matrix.config.xcode_version }}
DEVELOPER_DIR: "/Applications/${{ matrix.config.xcode_app }}"
BUILD_SCHEME: ${{ inputs.build_scheme }}
QUIET_ARG: ${{ inputs.debug_output_enabled && ' ' || '-quiet' }}
================================================
FILE: .github/workflows/main.yml
================================================
name: Main
permissions:
contents: read
on:
push:
branches: [main]
schedule:
- cron: "0 8,20 * * *"
jobs:
unit-tests:
name: Unit tests
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
with:
linux_5_10_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_6_0_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_6_1_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_6_2_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_nightly_6_1_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"
cxx-interop:
name: Cxx interop
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/cxx_interop.yml@main
benchmarks:
name: Benchmarks
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/benchmarks.yml@main
with:
benchmark_package_path: "Benchmarks"
construct-integration-test-matrix:
name: Construct integration test matrix
runs-on: ubuntu-latest
outputs:
integration-test-matrix: '${{ steps.generate-matrix.outputs.integration-test-matrix }}'
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- id: generate-matrix
run: echo "integration-test-matrix=$(curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/generate_matrix.sh | bash)" >> "$GITHUB_OUTPUT"
env:
MATRIX_LINUX_SETUP_COMMAND: "apt-get update -y -q && apt-get install -y -q lsof dnsutils netcat-openbsd net-tools curl jq"
MATRIX_LINUX_COMMAND: "./scripts/integration_tests.sh"
MATRIX_LINUX_ENV_VARS_JSON: '{"NIO_ALLOC_COUNTER_TESTS_PARALLEL": "true"}'
integration-tests:
name: Integration tests
needs: construct-integration-test-matrix
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@main
with:
name: "Integration tests"
matrix_string: '${{ needs.construct-integration-test-matrix.outputs.integration-test-matrix }}'
static-sdk:
name: Static Linux Swift SDK
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/static_sdk.yml@main
wasm-sdk:
name: WebAssembly Swift SDK
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/wasm_swift_sdk.yml@main
with:
additional_command_arguments: "--target NIOCore"
android-sdk:
name: Android Swift SDK
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/android_swift_sdk.yml@main
macos-tests:
name: macOS tests
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/macos_tests.yml@main
with:
runner_pool: nightly
build_scheme: swift-nio-Package
debug_output_enabled: true
xcode_16_3_enabled: false
xcode_16_4_enabled: false
xcode_26_0_enabled: false
xcode_26_1_enabled: false
xcode_26_2_enabled: false
swift_6_1_enabled: true
swift_6_2_enabled: true
swift_6_3_enabled: true
macos_xcode_test_enabled: false # Disabled because of an issue
ios_xcode_test_enabled: true
watchos_xcode_test_enabled: true
tvos_xcode_test_enabled: true
visionos_xcode_test_enabled: true
release-builds:
name: Release builds
uses: apple/swift-nio/.github/workflows/release_builds.yml@main
================================================
FILE: .github/workflows/pull_request.yml
================================================
name: PR
permissions:
contents: read
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
soundness:
name: Soundness
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@0.0.7
with:
license_header_check_project_name: "SwiftNIO"
# Workaround https://github.com/swiftlang/swift-docc/issues/1280
docs_check_container_image: "swift:6.1-noble"
unit-tests:
name: Unit tests
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
with:
linux_5_10_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_6_0_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_6_1_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_6_2_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_nightly_6_1_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"
benchmarks:
name: Benchmarks
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/benchmarks.yml@main
with:
benchmark_package_path: "Benchmarks"
cxx-interop:
name: Cxx interop
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/cxx_interop.yml@main
construct-integration-test-matrix:
name: Construct integration test matrix
runs-on: ubuntu-latest
outputs:
integration-test-matrix: '${{ steps.generate-matrix.outputs.integration-test-matrix }}'
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- id: generate-matrix
run: echo "integration-test-matrix=$(curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/generate_matrix.sh | bash)" >> "$GITHUB_OUTPUT"
env:
MATRIX_LINUX_SETUP_COMMAND: "apt-get update -y -q && apt-get install -y -q lsof dnsutils netcat-openbsd net-tools curl jq"
MATRIX_LINUX_COMMAND: "./scripts/integration_tests.sh"
MATRIX_LINUX_ENV_VARS_JSON: '{"NIO_ALLOC_COUNTER_TESTS_PARALLEL": "true"}'
integration-tests:
name: Integration tests
needs: construct-integration-test-matrix
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@main
with:
name: "Integration tests"
matrix_string: '${{ needs.construct-integration-test-matrix.outputs.integration-test-matrix }}'
vsock-tests:
name: Vsock tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Load vsock_loopback kernel module
run: sudo modprobe vsock_loopback
- name: Build package tests
run: swift build --build-tests
- name: Run Vsock tests
shell: bash # explicitly choose bash, which ensures -o pipefail
run: swift test --filter "(?i)vsock" | tee test.out
- name: Check for skipped tests
run: test -r test.out && ! grep -i skipped test.out
macos-tests:
name: macOS tests
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/macos_tests.yml@main
with:
runner_pool: general
build_scheme: swift-nio-Package
xcode_16_3_enabled: false
xcode_16_4_enabled: false
xcode_26_0_enabled: false
xcode_26_1_enabled: false
xcode_26_2_enabled: false
swift_6_1_enabled: true
swift_6_2_enabled: true
swift_6_3_enabled: true
static-sdk:
name: Static Linux Swift SDK
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/static_sdk.yml@main
wasm-sdk:
name: WebAssembly Swift SDK
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/wasm_swift_sdk.yml@main
with:
additional_command_arguments: "--target NIOCore"
android-sdk:
name: Android Swift SDK
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/android_swift_sdk.yml@main
release-builds:
name: Release builds
uses: apple/swift-nio/.github/workflows/release_builds.yml@main
================================================
FILE: .github/workflows/pull_request_label.yml
================================================
name: PR label
permissions:
contents: read
on:
pull_request:
types: [labeled, unlabeled, opened, reopened, synchronize]
jobs:
semver-label-check:
name: Semantic version label check
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Check for Semantic Version label
uses: ./.github/actions/pull_request_semver_label_checker/
================================================
FILE: .github/workflows/release_builds.yml
================================================
name: Release builds
permissions:
contents: read
on:
workflow_call:
inputs:
linux_5_10_enabled:
type: boolean
description: "Boolean to enable the Linux 5.10 Swift version matrix job. Defaults to false."
default: false
linux_5_10_arguments_override:
type: string
description: "The arguments passed to swift test in the Linux 5.10 Swift version matrix job."
default: ""
linux_6_0_enabled:
type: boolean
description: "Boolean to enable the Linux 6.0 Swift version matrix job. Defaults to true."
default: true
linux_6_0_arguments_override:
type: string
description: "The arguments passed to swift test in the Linux 6.0 Swift version matrix job."
default: ""
linux_6_1_enabled:
type: boolean
description: "Boolean to enable the Linux 6.1 Swift version matrix job. Defaults to true."
default: true
linux_6_1_arguments_override:
type: string
description: "The arguments passed to swift test in the Linux 6.1 Swift version matrix job."
default: ""
linux_6_2_enabled:
type: boolean
description: "Boolean to enable the Linux 6.2 Swift version matrix job. Defaults to true."
default: true
linux_6_2_arguments_override:
type: string
description: "The arguments passed to swift test in the Linux 6.2 Swift version matrix job."
default: ""
linux_nightly_next_enabled:
type: boolean
description: "Boolean to enable the Linux matrix job using the nightly build for the next Swift version. Defaults to true."
default: true
linux_nightly_next_arguments_override:
type: string
description: "The arguments passed to swift test in the Linux matrix job using the nightly build for the next Swift version."
default: ""
linux_nightly_main_enabled:
type: boolean
description: "Boolean to enable the Linux nightly main Swift version matrix job. Defaults to true."
default: true
linux_nightly_main_arguments_override:
type: string
description: "The arguments passed to swift test in the Linux nightly main Swift version matrix job."
default: ""
windows_6_0_enabled:
type: boolean
description: "Boolean to enable the Windows 6.0 Swift version matrix job. Defaults to false."
default: false
windows_6_0_arguments_override:
type: string
description: "The arguments passed to swift test in the Windows 6.0 Swift version matrix job."
default: ""
windows_6_1_enabled:
type: boolean
description: "Boolean to enable the Windows 6.1 Swift version matrix job. Defaults to false."
default: false
windows_6_1_arguments_override:
type: string
description: "The arguments passed to swift test in the Windows 6.1 Swift version matrix job."
default: ""
windows_6_2_enabled:
type: boolean
description: "Boolean to enable the Windows 6.2 Swift version matrix job. Defaults to false."
default: false
windows_6_2_arguments_override:
type: string
description: "The arguments passed to swift test in the Windows 6.2 Swift version matrix job."
default: ""
windows_nightly_next_enabled:
type: boolean
description: "Boolean to enable the Windows matrix job using the nightly build for the next Swift version. Defaults to false."
default: false
windows_nightly_next_arguments_override:
type: string
description: "The arguments passed to swift test in the Windows matrix job using the nightly build for the next Swift version."
default: ""
windows_nightly_main_enabled:
type: boolean
description: "Boolean to enable the Windows nightly main Swift version matrix job. Defaults to false."
default: false
windows_nightly_main_arguments_override:
type: string
description: "The arguments passed to swift test in the Windows nightly main Swift version matrix job."
default: ""
linux_env_vars:
type: string
description: "Environment variables for Linux jobs as JSON (e.g., '{\"DEBUG\":\"1\",\"LOG_LEVEL\":\"info\"}')."
default: "{}"
windows_env_vars:
type: string
description: "Environment variables for Windows jobs as JSON (e.g., '{\"DEBUG\":\"1\",\"LOG_LEVEL\":\"info\"}')."
default: "{}"
minimum_swift_version:
type: string
description: "Minimum Swift version to include in the matrix. Leave empty for auto-detection from Package.swift, specify a version like '6.0' to override, or set to 'none' to disable filtering."
default: ""
jobs:
construct-matrix:
name: Construct release build matrix
runs-on: ubuntu-latest
outputs:
release-build-matrix: '${{ steps.generate-matrix.outputs.release-build-matrix }}'
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- id: generate-matrix
run: |
# Validate JSON environment variables
linux_env_vars_json="$INPUT_LINUX_ENV_VARS"
windows_env_vars_json="$INPUT_WINDOWS_ENV_VARS"
if ! echo "$linux_env_vars_json" | jq empty 2>/dev/null; then
echo "Error: linux_env_vars is not valid JSON"
exit 1
fi
if ! echo "$windows_env_vars_json" | jq empty 2>/dev/null; then
echo "Error: windows_env_vars is not valid JSON"
exit 1
fi
echo "release-build-matrix=$(curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/generate_matrix.sh | MATRIX_LINUX_ENV_VARS_JSON="${linux_env_vars_json}" MATRIX_WINDOWS_ENV_VARS_JSON="${windows_env_vars_json}" bash)" >> "$GITHUB_OUTPUT"
env:
INPUT_LINUX_ENV_VARS: ${{ inputs.linux_env_vars }}
INPUT_WINDOWS_ENV_VARS: ${{ inputs.windows_env_vars }}
MATRIX_LINUX_SETUP_COMMAND: "swift --version"
MATRIX_LINUX_COMMAND: "swift build -c release"
MATRIX_MIN_SWIFT_VERSION: ${{ inputs.minimum_swift_version }}
MATRIX_LINUX_5_10_ENABLED: ${{ inputs.linux_5_10_enabled }}
MATRIX_LINUX_5_10_COMMAND_ARGUMENTS: ${{ inputs.linux_5_10_arguments_override }}
MATRIX_LINUX_6_0_ENABLED: ${{ inputs.linux_6_0_enabled }}
MATRIX_LINUX_6_0_COMMAND_ARGUMENTS: ${{ inputs.linux_6_0_arguments_override }}
MATRIX_LINUX_6_1_ENABLED: ${{ inputs.linux_6_1_enabled }}
MATRIX_LINUX_6_1_COMMAND_ARGUMENTS: ${{ inputs.linux_6_1_arguments_override }}
MATRIX_LINUX_6_2_ENABLED: ${{ inputs.linux_6_2_enabled }}
MATRIX_LINUX_6_2_COMMAND_ARGUMENTS: ${{ inputs.linux_6_2_arguments_override }}
MATRIX_LINUX_NIGHTLY_NEXT_ENABLED: ${{ inputs.linux_nightly_next_enabled }}
MATRIX_LINUX_NIGHTLY_NEXT_COMMAND_ARGUMENTS: ${{ inputs.linux_nightly_next_arguments_override }}
MATRIX_LINUX_NIGHTLY_MAIN_ENABLED: ${{ inputs.linux_nightly_main_enabled }}
MATRIX_LINUX_NIGHTLY_MAIN_COMMAND_ARGUMENTS: ${{ inputs.linux_nightly_main_arguments_override }}
MATRIX_WINDOWS_COMMAND: "swift build -c release"
MATRIX_WINDOWS_6_0_ENABLED: ${{ inputs.windows_6_0_enabled }}
MATRIX_WINDOWS_6_0_COMMAND_ARGUMENTS: ${{ inputs.windows_6_0_arguments_override }}
MATRIX_WINDOWS_6_1_ENABLED: ${{ inputs.windows_6_1_enabled }}
MATRIX_WINDOWS_6_1_COMMAND_ARGUMENTS: ${{ inputs.windows_6_1_arguments_override }}
MATRIX_WINDOWS_6_2_ENABLED: ${{ inputs.windows_6_2_enabled }}
MATRIX_WINDOWS_6_2_COMMAND_ARGUMENTS: ${{ inputs.windows_6_2_arguments_override }}
MATRIX_WINDOWS_NIGHTLY_NEXT_ENABLED: ${{ inputs.windows_nightly_next_enabled }}
MATRIX_WINDOWS_NIGHTLY_NEXT_COMMAND_ARGUMENTS: ${{ inputs.windows_nightly_next_arguments_override }}
MATRIX_WINDOWS_NIGHTLY_MAIN_ENABLED: ${{ inputs.windows_nightly_main_enabled }}
MATRIX_WINDOWS_NIGHTLY_MAIN_COMMAND_ARGUMENTS: ${{ inputs.windows_nightly_main_arguments_override }}
release-builds:
name: Release builds
needs: construct-matrix
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@main
with:
name: "Release builds"
matrix_string: '${{ needs.construct-matrix.outputs.release-build-matrix }}'
================================================
FILE: .github/workflows/static_sdk.yml
================================================
name: Static SDK
permissions:
contents: read
on:
workflow_call:
inputs:
env_vars:
type: string
description: "Environment variables for jobs as JSON (e.g., '{\"DEBUG\":\"1\",\"LOG_LEVEL\":\"info\"}')."
default: "{}"
command_arguments:
type: string
description: "The arguments passed to swift build. Defaults to '--swift-sdk x86_64-swift-linux-musl'."
default: "--swift-sdk x86_64-swift-linux-musl"
jobs:
construct-matrix:
name: Construct Static SDK matrix
runs-on: ubuntu-latest
outputs:
static-sdk-matrix: '${{ steps.generate-matrix.outputs.static-sdk-matrix }}'
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- id: generate-matrix
run: |
# Validate and use JSON environment variables directly
env_vars_json="$INPUT_ENV_VARS"
# Validate JSON format
if ! echo "$env_vars_json" | jq empty 2>/dev/null; then
echo "Error: env_vars is not valid JSON"
exit 1
fi
# Generate matrix with parsed environment variables
cat >> "$GITHUB_OUTPUT" << EOM
static-sdk-matrix=$(echo '{
"config":[
{
"name":"latest-release Jammy",
"swift_version":"latest-release",
"platform":"Linux",
"runner":"ubuntu-latest",
"image":"ubuntu:jammy",
"setup_command":"apt update -q && apt install -y -q curl jq tar && curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/install_swift_prerequisites.sh | bash && curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/install_swift_sdk.sh | INSTALL_SWIFT_VERSION=latest INSTALL_SWIFT_ARCH=x86_64 bash && hash -r",
"command":"swift build",
"command_arguments":"--swift-sdks-path /tmp/swiftsdks '"$INPUT_COMMAND_ARGUMENTS"'",
"env":'"$env_vars_json"'
},
{
"name":"main Jammy",
"swift_version":"main",
"platform":"Linux",
"runner":"ubuntu-latest",
"image":"ubuntu:jammy",
"setup_command":"apt update -q && apt install -y -q curl jq tar && curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/install_swift_prerequisites.sh | bash && curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/install_swift_sdk.sh | INSTALL_SWIFT_BRANCH=main INSTALL_SWIFT_ARCH=x86_64 bash && hash -r",
"command":"swift build",
"command_arguments":"--swift-sdks-path /tmp/swiftsdks '"$INPUT_COMMAND_ARGUMENTS"'",
"env":'"$env_vars_json"'
}
]
}' | jq -c)
EOM
env:
INPUT_ENV_VARS: ${{ inputs.env_vars }}
INPUT_COMMAND_ARGUMENTS: ${{ inputs.command_arguments }}
static-sdk:
name: Static SDK
needs: construct-matrix
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@main
with:
name: "Static SDK"
matrix_string: '${{ needs.construct-matrix.outputs.static-sdk-matrix }}'
================================================
FILE: .github/workflows/swift_6_language_mode.yml
================================================
name: Swift 6 language mode
permissions:
contents: read
on:
workflow_call:
# We are cancelling previously triggered workflow runs
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-swift-6-language-mode
cancel-in-progress: true
jobs:
swift-6-language-mode:
name: Swift 6 language mode
runs-on: ubuntu-latest
container:
image: swift:6.0-jammy
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
submodules: true
- name: Set the language mode
run: swift package tools-version --set 6.0
- name: Build with Swift 6 language mode
run: swift build -Xswiftc -warnings-as-errors
================================================
FILE: .github/workflows/swift_load_test_matrix.yml
================================================
name: Matrix Load
permissions:
contents: read
on:
workflow_call:
inputs:
name:
type: string
description: "The name of the workflow used for the concurrency group."
required: true
matrix_path:
type: string
description: "The path of the test matrix definition."
default: ""
jobs:
load-matrix:
name: Prepare matrices
runs-on: ubuntu-latest
outputs:
swift-matrix: ${{ steps.load-matrix.outputs.swift-matrix }}
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Mark the workspace as safe
# https://github.com/actions/checkout/issues/766
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
- id: load-matrix
run: |
printf "swift-matrix=%s" "$(jq -ec '.' "$INPUT_MATRIX_PATH")" >> "$GITHUB_OUTPUT"
env:
INPUT_MATRIX_PATH: ${{ inputs.matrix_path }}
execute-matrix:
name: Execute matrix
needs: load-matrix
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@main
with:
name: ${{ inputs.name }}
matrix_string: '${{ needs.load-matrix.outputs.swift-matrix }}'
================================================
FILE: .github/workflows/swift_matrix.yml
================================================
name: Matrix
permissions:
contents: read
on:
workflow_call:
inputs:
name:
type: string
description: "The name of the workflow used for the concurrency group."
required: true
matrix_linux_command:
type: string
description: "The command of the current Swift version linux matrix job to execute."
required: true
matrix_linux_5_9_enabled:
type: boolean
description: "Boolean to enable the 5.9 Swift version matrix job. Defaults to false."
default: false
matrix_linux_5_9_container_image:
type: string
description: "Container image for the 5.9 Swift version matrix job. Defaults to matching Swift Ubuntu image."
default: "swift:5.9-jammy"
matrix_linux_5_9_command_override:
type: string
description: "The command of the 5.9 Swift version linux matrix job to execute."
matrix_linux_5_10_enabled:
type: boolean
description: "Boolean to enable the 5.10 Swift version matrix job. Defaults to false."
default: false
matrix_linux_5_10_container_image:
type: string
description: "Container image for the 5.10 Swift version matrix job. Defaults to matching Swift Ubuntu image."
default: "swift:5.10-jammy"
matrix_linux_5_10_command_override:
type: string
description: "The command of the 5.10 Swift version linux matrix job to execute."
matrix_linux_6_0_enabled:
type: boolean
description: "Boolean to enable the 6.0 Swift version matrix job. Defaults to true."
default: true
matrix_linux_6_0_container_image:
type: string
description: "Container image for the 6.0 Swift version matrix job. Defaults to matching Swift Ubuntu image."
default: "swift:6.0-jammy"
matrix_linux_6_0_command_override:
type: string
description: "The command of the 6.0 Swift version linux matrix job to execute."
matrix_linux_nightly_6_0_enabled:
type: boolean
description: "⚠️ Deprecated, we no longer run against 6.0 nightly."
default: true
matrix_linux_nightly_6_0_container_image:
type: string
description: "⚠️ Deprecated, we no longer run against 6.0 nightly."
default: "swiftlang/swift:nightly-6.0-jammy"
matrix_linux_nightly_6_0_command_override:
type: string
description: "⚠️ Deprecated, we no longer run against 6.0 nightly."
matrix_linux_nightly_6_1_enabled:
type: boolean
description: "Boolean to enable the nightly 6.1 Swift version matrix job. Defaults to true."
default: true
matrix_linux_nightly_6_1_container_image:
type: string
description: "Container image for the nightly 6.1 Swift version matrix job. Defaults to matching Swift Ubuntu image."
default: "swiftlang/swift:nightly-6.1-jammy"
matrix_linux_nightly_6_1_command_override:
type: string
description: "The command of the nightly 6.1 Swift version linux matrix job to execute."
matrix_linux_nightly_main_enabled:
type: boolean
description: "Boolean to enable the nightly main Swift version matrix job. Defaults to true."
default: true
matrix_linux_nightly_main_container_image:
type: string
description: "Container image for the nightly main Swift version matrix job. Defaults to matching Swift Ubuntu image."
default: "swiftlang/swift:nightly-main-jammy"
matrix_linux_nightly_main_command_override:
type: string
description: "The command of the nightly main Swift version linux matrix job to execute."
matrix_windows_command:
type: string
description: "The command of the current Swift version windows matrix job to execute."
default: ""
matrix_windows_6_0_enabled:
type: boolean
description: "Boolean to enable the 6.0 Swift version matrix job. Defaults to true."
default: false
matrix_windows_6_0_command_override:
type: string
description: "The command of the 6.0 Swift version windows matrix job to execute."
matrix_windows_nightly_6_0_enabled:
type: boolean
description: "⚠️ Deprecated, we no longer run against 6.0 nightly."
default: false
matrix_windows_nightly_6_0_command_override:
type: string
description: "⚠️ Deprecated, we no longer run against 6.0 nightly."
matrix_windows_nightly_6_1_enabled:
type: boolean
description: "Boolean to enable the nightly 6.1 Swift version matrix job. Defaults to true."
default: false
matrix_windows_nightly_6_1_command_override:
type: string
description: "The command of the nightly 6.1 Swift version windows matrix job to execute."
matrix_windows_nightly_main_enabled:
type: boolean
description: "Boolean to enable the nightly main Swift version matrix job. Defaults to true."
default: false
matrix_windows_nightly_main_command_override:
type: string
description: "The command of the nightly main Swift version windows matrix job to execute."
# We are cancelling previously triggered workflow runs
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.name }}
cancel-in-progress: true
jobs:
linux:
name: Linux (${{ matrix.swift.swift_version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# We are specifying only the major and minor of the docker images to automatically pick up the latest patch release
swift:
- image: ${{ inputs.matrix_linux_5_9_container_image }}
swift_version: "5.9"
enabled: ${{ inputs.matrix_linux_5_9_enabled }}
- image: ${{ inputs.matrix_linux_5_10_container_image }}
swift_version: "5.10"
enabled: ${{ inputs.matrix_linux_5_10_enabled }}
- image: ${{ inputs.matrix_linux_6_0_container_image }}
swift_version: "6.0"
enabled: ${{ inputs.matrix_linux_6_0_enabled }}
- image: ${{ inputs.matrix_linux_nightly_6_1_container_image }}
swift_version: "nightly-6.1"
enabled: ${{ inputs.matrix_linux_nightly_6_1_enabled }}
- image: ${{ inputs.matrix_linux_nightly_main_container_image }}
swift_version: "nightly-main"
enabled: ${{ inputs.matrix_linux_nightly_main_enabled }}
container:
image: ${{ matrix.swift.image }}
steps:
- name: Checkout repository
if: ${{ matrix.swift.enabled }}
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
submodules: true
- name: Mark the workspace as safe
if: ${{ matrix.swift.enabled }}
# https://github.com/actions/checkout/issues/766
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Run matrix job
if: ${{ matrix.swift.enabled }}
env:
SWIFT_VERSION: ${{ matrix.swift.swift_version }}
COMMAND: ${{ inputs.matrix_linux_command }}
COMMAND_OVERRIDE_5_9: ${{ inputs.matrix_linux_5_9_command_override }}
COMMAND_OVERRIDE_5_10: ${{ inputs.matrix_linux_5_10_command_override }}
COMMAND_OVERRIDE_6_0: ${{ inputs.matrix_linux_6_0_command_override }}
COMMAND_OVERRIDE_NIGHTLY_6_1: ${{ inputs.matrix_linux_nightly_6_1_command_override }}
COMMAND_OVERRIDE_NIGHTLY_MAIN: ${{ inputs.matrix_linux_nightly_main_command_override }}
run: |
apt-get -qq update && apt-get -qq -y install curl
curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-matrix-job.sh | bash
windows:
name: Windows (${{ matrix.swift.swift_version }})
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
# We are specifying only the major and minor of the docker images to automatically pick up the latest patch release
swift:
- image: swift:6.0-windowsservercore-ltsc2022
swift_version: "6.0"
enabled: ${{ inputs.matrix_windows_6_0_enabled }}
steps:
- name: Wait for Docker daemon
if: ${{ matrix.swift.enabled }}
run: |
$maxAttempts = 30
$attempt = 0
do {
$attempt++
docker info 2>&1 | Out-Null
if ($LASTEXITCODE -eq 0) { break }
if ($attempt -ge $maxAttempts) {
Write-Error "Docker daemon did not become ready after $maxAttempts attempts"
exit 1
}
Start-Sleep -Seconds 6
} while ($true)
shell: pwsh
- name: Pull Docker image
if: ${{ matrix.swift.enabled }}
run: docker pull ${{ matrix.swift.image }}
- name: Checkout repository
if: ${{ matrix.swift.enabled }}
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Donwload matrix script
if: ${{ matrix.swift.enabled }}
run: curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-matrix-job.ps1 -o __check-matrix-job.ps1
- name: Run matrix job
if: ${{ matrix.swift.enabled }}
run: |
docker run --env SWIFT_VERSION="${{ matrix.swift.swift_version }}" --env COMMAND="$env:INPUT_WINDOWS_COMMAND" --env COMMAND_OVERRIDE_6_0="$env:INPUT_WINDOWS_6_0_OVERRIDE" -v ${{ github.workspace }}:C:\source ${{ matrix.swift.image }} cmd /s /c "swift --version & cd C:\source\ & powershell -File __check-matrix-job.ps1"
env:
INPUT_WINDOWS_COMMAND: ${{ inputs.matrix_windows_command }}
INPUT_WINDOWS_6_0_OVERRIDE: ${{ inputs.matrix_windows_6_0_command_override }}
windows-nightly:
name: Windows (${{ matrix.swift.swift_version }})
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
# We are specifying only the major and minor of the docker images to automatically pick up the latest patch release
swift:
- image: swiftlang/swift:nightly-6.1-windowsservercore-1809
swift_version: "nightly-6.1"
enabled: ${{ inputs.matrix_windows_nightly_6_1_enabled }}
- image: swiftlang/swift:nightly-main-windowsservercore-1809
swift_version: "nightly-main"
enabled: ${{ inputs.matrix_windows_nightly_main_enabled }}
steps:
- name: Wait for Docker daemon
if: ${{ matrix.swift.enabled }}
run: |
$maxAttempts = 30
$attempt = 0
do {
$attempt++
docker info 2>&1 | Out-Null
if ($LASTEXITCODE -eq 0) { break }
if ($attempt -ge $maxAttempts) {
Write-Error "Docker daemon did not become ready after $maxAttempts attempts"
exit 1
}
Start-Sleep -Seconds 6
} while ($true)
shell: pwsh
- name: Pull Docker image
if: ${{ matrix.swift.enabled }}
run: docker pull ${{ matrix.swift.image }}
- name: Checkout repository
if: ${{ matrix.swift.enabled }}
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
submodules: true
- name: Donwload matrix script
if: ${{ matrix.swift.enabled }}
run: curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-matrix-job.ps1 -o __check-matrix-job.ps1
- name: Run matrix job
if: ${{ matrix.swift.enabled }}
run: |
docker run --env SWIFT_VERSION="${{ matrix.swift.swift_version }}" --env COMMAND="$env:INPUT_WINDOWS_COMMAND" --env COMMAND_OVERRIDE_NIGHTLY_6_1="$env:INPUT_WINDOWS_NIGHTLY_6_1_OVERRIDE" --env COMMAND_OVERRIDE_NIGHTLY_MAIN="$env:INPUT_WINDOWS_NIGHTLY_MAIN_OVERRIDE" -v ${{ github.workspace }}:C:\source ${{ matrix.swift.image }} cmd /s /c "swift --version & cd C:\source\ & powershell -File __check-matrix-job.ps1"
env:
INPUT_WINDOWS_COMMAND: ${{ inputs.matrix_windows_command }}
INPUT_WINDOWS_NIGHTLY_6_1_OVERRIDE: ${{ inputs.matrix_windows_nightly_6_1_command_override }}
INPUT_WINDOWS_NIGHTLY_MAIN_OVERRIDE: ${{ inputs.matrix_windows_nightly_main_command_override }}
================================================
FILE: .github/workflows/swift_test_matrix.yml
================================================
name: Matrix
permissions:
contents: read
on:
workflow_call:
inputs:
name:
type: string
description: "The name of the workflow used for the concurrency group."
required: true
matrix_string:
type: string
description: "The test matrix definition."
required: true
# We will cancel previously triggered workflow runs
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.name }}
cancel-in-progress: true
jobs:
execute-matrix:
name: ${{ matrix.config.platform }} (${{ matrix.config.name }})
runs-on: ${{ matrix.config.runner }}
strategy:
fail-fast: false
matrix: ${{ fromJson(inputs.matrix_string) }}
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
submodules: true
- name: Wait for Docker daemon (Windows)
if: ${{ matrix.config.platform == 'Windows' }}
run: |
$maxAttempts = 30
$attempt = 0
do {
$attempt++
docker info 2>&1 | Out-Null
if ($LASTEXITCODE -eq 0) { break }
if ($attempt -ge $maxAttempts) {
Write-Error "Docker daemon did not become ready after $maxAttempts attempts"
exit 1
}
Start-Sleep -Seconds 6
} while ($true)
shell: pwsh
- name: Pull Docker image
run: docker pull ${{ matrix.config.image }}
- name: Run matrix job
if: ${{ matrix.config.platform != 'Windows' }}
run: |
if [[ -n "$MATRIX_SETUP_COMMAND" ]]; then
setup_command_expression="$MATRIX_SETUP_COMMAND &&"
else
setup_command_expression=""
fi
workspace="/$(basename "$GITHUB_WORKSPACE")"
docker_args=(
"run"
"-v" "$GITHUB_WORKSPACE:$workspace"
"-w" "$workspace"
"-e" "CI=$CI"
"-e" "GITHUB_ACTIONS=$GITHUB_ACTIONS"
"-e" "SWIFT_VERSION=$MATRIX_SWIFT_VERSION"
"-e" "workspace=$workspace"
)
if [[ "$MATRIX_ENV_JSON" != '{}' ]]; then
while IFS="=" read -r key value; do
if [[ -n "$key" && -n "$value" ]]; then
docker_args+=("-e" "$key=$value")
fi
done < <(echo "$MATRIX_ENV_JSON" | jq -r 'to_entries[] | "\(.key)=\(.value)"')
fi
docker_args+=("$MATRIX_IMAGE")
docker_args+=("bash" "-c" "$setup_command_expression $MATRIX_COMMAND $MATRIX_COMMAND_ARGUMENTS")
echo "Executing Docker command: docker ${docker_args[*]}"
docker "${docker_args[@]}"
env:
MATRIX_SETUP_COMMAND: ${{ matrix.config.setup_command }}
MATRIX_SWIFT_VERSION: ${{ matrix.config.swift_version }}
MATRIX_IMAGE: ${{ matrix.config.image }}
MATRIX_COMMAND: ${{ matrix.config.command }}
MATRIX_COMMAND_ARGUMENTS: ${{ matrix.config.command_arguments }}
MATRIX_ENV_JSON: ${{ toJson(matrix.config.env) }}
GITHUB_WORKSPACE: ${{ github.workspace }}
- name: Run matrix job (Windows)
if: ${{ matrix.config.platform == 'Windows' }}
run: |
if (-not [string]::IsNullOrEmpty("$env:MATRIX_SETUP_COMMAND")) {
$setup_command_expression = "$env:MATRIX_SETUP_COMMAND &"
} else {
$setup_command_expression = ""
}
$workspace = "C:\" + (Split-Path $env:GITHUB_WORKSPACE -Leaf)
$docker_args = @(
"run", "-v", "$env:GITHUB_WORKSPACE`:$($workspace)",
"-w", $workspace,
"-e", "CI=$env:CI",
"-e", "GITHUB_ACTIONS=$env:GITHUB_ACTIONS",
"-e", "SWIFT_VERSION=$env:MATRIX_SWIFT_VERSION"
)
$env_args = @()
$env_json = $env:MATRIX_ENV_JSON
if ($env_json -ne '{}') {
$env_obj = $env_json | ConvertFrom-Json
$env_obj.PSObject.Properties | ForEach-Object {
$env_args += "-e"
$env_args += "$($_.Name)=$($_.Value)"
}
}
$docker_args += $env_args
$docker_args += @("$env:MATRIX_IMAGE", "cmd", "/s", "/c", "swift --version & $($setup_command_expression) $env:MATRIX_COMMAND $env:MATRIX_COMMAND_ARGUMENTS")
Write-Host "Executing Docker command: docker $($docker_args -join ' ')"
& docker @docker_args
env:
MATRIX_SETUP_COMMAND: ${{ matrix.config.setup_command }}
MATRIX_SWIFT_VERSION: ${{ matrix.config.swift_version }}
MATRIX_IMAGE: ${{ matrix.config.image }}
MATRIX_COMMAND: ${{ matrix.config.command }}
MATRIX_COMMAND_ARGUMENTS: ${{ matrix.config.command_arguments }}
MATRIX_ENV_JSON: ${{ toJson(matrix.config.env) }}
GITHUB_WORKSPACE: ${{ github.workspace }}
env:
SWIFT_VERSION: ${{ matrix.config.swift_version }}
================================================
FILE: .github/workflows/unit_tests.yml
================================================
name: Unit tests
permissions:
contents: read
on:
workflow_call:
inputs:
linux_5_9_enabled:
type: boolean
description: "Boolean to enable the Linux 5.9 Swift version matrix job. Defaults to false."
default: false
linux_5_9_arguments_override:
type: string
description: "The arguments passed to swift test in the Linux 5.9 Swift version matrix job."
default: ""
linux_5_10_enabled:
type: boolean
description: "Boolean to enable the Linux 5.10 Swift version matrix job. Defaults to false."
default: false
linux_5_10_arguments_override:
type: string
description: "The arguments passed to swift test in the Linux 5.10 Swift version matrix job."
default: ""
linux_6_0_enabled:
type: boolean
description: "Boolean to enable the Linux 6.0 Swift version matrix job. Defaults to true."
default: true
linux_6_0_arguments_override:
type: string
description: "The arguments passed to swift test in the Linux 6.0 Swift version matrix job."
default: ""
linux_6_1_enabled:
type: boolean
description: "Boolean to enable the Linux 6.1 Swift version matrix job. Defaults to true."
default: true
linux_6_1_arguments_override:
type: string
description: "The arguments passed to swift test in the Linux 6.1 Swift version matrix job."
default: ""
linux_6_2_enabled:
type: boolean
description: "Boolean to enable the Linux 6.2 Swift version matrix job. Defaults to true."
default: true
linux_6_2_arguments_override:
type: string
description: "The arguments passed to swift test in the Linux 6.2 Swift version matrix job."
default: ""
linux_nightly_6_0_enabled:
type: boolean
description: "⚠️ Deprecated, we no longer run against 6.0 nightly."
default: true
linux_nightly_6_0_arguments_override:
type: string
description: "⚠️ Deprecated, we no longer run against 6.0 nightly."
default: ""
linux_nightly_6_1_enabled:
type: boolean
description: "⚠️ Deprecated, use linux_nightly_next_enabled."
default: true
linux_nightly_6_1_arguments_override:
type: string
description: "⚠️ Deprecated, use linux_nightly_next_arguments_override."
default: ""
linux_nightly_next_enabled:
type: boolean
description: "Boolean to enable the Linux matrix job using the nightly build for the next Swift version. Defaults to true."
default: true
linux_nightly_next_arguments_override:
type: string
description: "The arguments passed to swift test in the Linux matrix job using the nightly build for the next Swift version."
default: ""
linux_nightly_main_enabled:
type: boolean
description: "Boolean to enable the Linux nightly main Swift version matrix job. Defaults to true."
default: true
linux_nightly_main_arguments_override:
type: string
description: "The arguments passed to swift test in the Linux nightly main Swift version matrix job."
default: ""
windows_6_0_enabled:
type: boolean
description: "Boolean to enable the Windows 6.0 Swift version matrix job. Defaults to false."
default: false
windows_6_0_arguments_override:
type: string
description: "The arguments passed to swift test in the Windows 6.0 Swift version matrix job."
default: ""
windows_6_1_enabled:
type: boolean
description: "Boolean to enable the Windows 6.1 Swift version matrix job. Defaults to false."
default: false
windows_6_1_arguments_override:
type: string
description: "The arguments passed to swift test in the Windows 6.1 Swift version matrix job."
default: ""
windows_6_2_enabled:
type: boolean
description: "Boolean to enable the Windows 6.2 Swift version matrix job. Defaults to false."
default: false
windows_6_2_arguments_override:
type: string
description: "The arguments passed to swift test in the Windows 6.2 Swift version matrix job."
default: ""
windows_nightly_6_0_enabled:
type: boolean
description: "⚠️ Deprecated, we no longer run against 6.0 nightly."
default: false
windows_nightly_6_0_arguments_override:
type: string
description: "⚠️ Deprecated, we no longer run against 6.0 nightly."
default: ""
windows_nightly_6_1_enabled:
type: boolean
description: "⚠️ Deprecated, use windows_nightly_next_enabled."
default: false
windows_nightly_6_1_arguments_override:
type: string
description: "⚠️ Deprecated, use windows_nightly_next_arguments_override."
default: ""
windows_nightly_next_enabled:
type: boolean
description: "Boolean to enable the Windows matrix job using the nightly build for the next Swift version. Defaults to false."
default: false
windows_nightly_next_arguments_override:
type: string
description: "The arguments passed to swift test in the Windows matrix job using the nightly build for the next Swift version."
default: ""
windows_nightly_main_enabled:
type: boolean
description: "Boolean to enable the Windows nightly main Swift version matrix job. Defaults to false."
default: false
windows_nightly_main_arguments_override:
type: string
description: "The arguments passed to swift test in the Windows nightly main Swift version matrix job."
default: ""
linux_env_vars:
type: string
description: "Environment variables for Linux jobs as JSON (e.g., '{\"DEBUG\":\"1\",\"LOG_LEVEL\":\"info\"}')."
default: "{}"
windows_env_vars:
type: string
description: "Environment variables for Windows jobs as JSON (e.g., '{\"DEBUG\":\"1\",\"LOG_LEVEL\":\"info\"}')."
default: "{}"
minimum_swift_version:
type: string
description: "Minimum Swift version to include in the matrix. Leave empty for auto-detection from Package.swift, specify a version like '6.0' to override, or set to 'none' to disable filtering."
default: ""
jobs:
construct-matrix:
name: Construct unit test matrix
runs-on: ubuntu-latest
outputs:
unit-test-matrix: '${{ steps.generate-matrix.outputs.unit-test-matrix }}'
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- id: generate-matrix
run: |
# Validate and use JSON environment variables directly
linux_env_vars_json="$INPUT_LINUX_ENV_VARS"
windows_env_vars_json="$INPUT_WINDOWS_ENV_VARS"
# Validate JSON format
if ! echo "$linux_env_vars_json" | jq empty 2>/dev/null; then
echo "Error: linux_env_vars is not valid JSON"
exit 1
fi
if ! echo "$windows_env_vars_json" | jq empty 2>/dev/null; then
echo "Error: windows_env_vars is not valid JSON"
exit 1
fi
# Generate matrix
echo "unit-test-matrix=$(curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/generate_matrix.sh | MATRIX_LINUX_ENV_VARS_JSON="${linux_env_vars_json}" MATRIX_WINDOWS_ENV_VARS_JSON="${windows_env_vars_json}" bash)" >> "$GITHUB_OUTPUT"
env:
INPUT_LINUX_ENV_VARS: ${{ inputs.linux_env_vars }}
INPUT_WINDOWS_ENV_VARS: ${{ inputs.windows_env_vars }}
MATRIX_LINUX_SETUP_COMMAND: "swift --version"
MATRIX_LINUX_COMMAND: "swift test"
MATRIX_MIN_SWIFT_VERSION: ${{ inputs.minimum_swift_version }}
MATRIX_LINUX_5_9_ENABLED: ${{ inputs.linux_5_9_enabled }}
MATRIX_LINUX_5_9_COMMAND_ARGUMENTS: ${{ inputs.linux_5_9_arguments_override }}
MATRIX_LINUX_5_10_ENABLED: ${{ inputs.linux_5_10_enabled }}
MATRIX_LINUX_5_10_COMMAND_ARGUMENTS: ${{ inputs.linux_5_10_arguments_override }}
MATRIX_LINUX_6_0_ENABLED: ${{ inputs.linux_6_0_enabled }}
MATRIX_LINUX_6_0_COMMAND_ARGUMENTS: ${{ inputs.linux_6_0_arguments_override }}
MATRIX_LINUX_6_1_ENABLED: ${{ inputs.linux_6_1_enabled }}
MATRIX_LINUX_6_1_COMMAND_ARGUMENTS: ${{ inputs.linux_6_1_arguments_override }}
MATRIX_LINUX_6_2_ENABLED: ${{ inputs.linux_6_2_enabled }}
MATRIX_LINUX_6_2_COMMAND_ARGUMENTS: ${{ inputs.linux_6_2_arguments_override }}
MATRIX_LINUX_NIGHTLY_NEXT_ENABLED: ${{ inputs.linux_nightly_6_1_enabled || inputs.linux_nightly_next_enabled }}
MATRIX_LINUX_NIGHTLY_NEXT_COMMAND_ARGUMENTS: ${{ inputs.linux_nightly_6_1_arguments_override }} ${{ inputs.linux_nightly_next_arguments_override }}
MATRIX_LINUX_NIGHTLY_MAIN_ENABLED: ${{ inputs.linux_nightly_main_enabled }}
MATRIX_LINUX_NIGHTLY_MAIN_COMMAND_ARGUMENTS: ${{ inputs.linux_nightly_main_arguments_override }}
MATRIX_WINDOWS_COMMAND: "swift test"
MATRIX_WINDOWS_6_0_ENABLED: ${{ inputs.windows_6_0_enabled }}
MATRIX_WINDOWS_6_0_COMMAND_ARGUMENTS: ${{ inputs.windows_6_0_arguments_override }}
MATRIX_WINDOWS_6_1_ENABLED: ${{ inputs.windows_6_1_enabled }}
MATRIX_WINDOWS_6_1_COMMAND_ARGUMENTS: ${{ inputs.windows_6_1_arguments_override }}
MATRIX_WINDOWS_6_2_ENABLED: ${{ inputs.windows_6_2_enabled }}
MATRIX_WINDOWS_6_2_COMMAND_ARGUMENTS: ${{ inputs.windows_6_2_arguments_override }}
MATRIX_WINDOWS_NIGHTLY_NEXT_ENABLED: ${{ inputs.windows_nightly_6_1_enabled || inputs.windows_nightly_next_enabled }}
MATRIX_WINDOWS_NIGHTLY_NEXT_COMMAND_ARGUMENTS: ${{ inputs.windows_nightly_6_1_arguments_override }} ${{ inputs.windows_nightly_next_arguments_override }}
MATRIX_WINDOWS_NIGHTLY_MAIN_ENABLED: ${{ inputs.windows_nightly_main_enabled }}
MATRIX_WINDOWS_NIGHTLY_MAIN_COMMAND_ARGUMENTS: ${{ inputs.windows_nightly_main_arguments_override }}
unit-tests:
name: Unit tests
needs: construct-matrix
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@main
with:
name: "Unit tests"
matrix_string: '${{ needs.construct-matrix.outputs.unit-test-matrix }}'
================================================
FILE: .github/workflows/wasm_swift_sdk.yml
================================================
name: WebAssembly Swift SDK
permissions:
contents: read
on:
workflow_call:
inputs:
env_vars:
type: string
description: "Environment variables for jobs as JSON (e.g., '{\"DEBUG\":\"1\",\"LOG_LEVEL\":\"info\"}')."
default: "{}"
additional_command_arguments:
type: string
description: "Additional arguments passed to swift build (the Wasm Swift SDK will be specified). Defaults to empty."
default: ""
jobs:
construct-matrix:
name: Construct WebAssembly Swift SDK matrix
runs-on: ubuntu-latest
outputs:
wasm-swift-sdk-matrix: '${{ steps.generate-matrix.outputs.wasm-swift-sdk-matrix }}'
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- id: generate-matrix
run: |
# Validate and use JSON environment variables directly
env_vars_json="$INPUT_ENV_VARS"
# Validate JSON format
if ! echo "$env_vars_json" | jq empty 2>/dev/null; then
echo "Error: env_vars is not valid JSON"
exit 1
fi
# Generate matrix with parsed environment variables
cat >> "$GITHUB_OUTPUT" << EOM
wasm-swift-sdk-matrix=$(echo '{
"config":[
{
"name":"main Jammy",
"swift_version":"main",
"platform":"Linux",
"runner":"ubuntu-latest",
"image":"ubuntu:jammy",
"setup_command":"apt update -q && apt install -y -q curl jq tar && curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/install_swift_prerequisites.sh | bash && curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/install_swift_sdk.sh | INSTALL_SWIFT_BRANCH=main INSTALL_SWIFT_ARCH=x86_64 INSTALL_SWIFT_SDK=wasm-sdk bash && hash -r",
"command":"curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/swift-build-with-wasm-sdk.sh | bash -s --",
"command_arguments":"'"$INPUT_ADDITIONAL_COMMAND_ARGUMENTS"'",
"env":'"$env_vars_json"'
}
]
}' | jq -c)
EOM
env:
INPUT_ENV_VARS: ${{ inputs.env_vars }}
INPUT_ADDITIONAL_COMMAND_ARGUMENTS: ${{ inputs.additional_command_arguments }}
wasm-swift-sdk:
name: WebAssembly Swift SDK
needs: construct-matrix
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@main
with:
name: "WebAssembly Swift SDK"
matrix_string: '${{ needs.construct-matrix.outputs.wasm-swift-sdk-matrix }}'
================================================
FILE: .gitignore
================================================
.DS_Store
.build
/.index-build
/Packages
/*.xcodeproj
Package.pins
*.pem
/docs/1.*
/docs/2.*
Package.resolved
.podspecs
DerivedData
.swiftpm
.*.sw?
.vscode/launch.json
================================================
FILE: .licenseignore
================================================
.gitignore
**/.gitignore
.licenseignore
.gitattributes
.git-blame-ignore-revs
.mailfilter
.mailmap
.spi.yml
.swift-format
.editorconfig
.github/*
*.md
*.txt
*.yml
*.yaml
*.json
Package.swift
**/Package.swift
Package@-*.swift
**/Package@-*.swift
Package.resolved
**/Package.resolved
Makefile
*.modulemap
**/*.modulemap
**/*.docc/*
*.xcprivacy
**/*.xcprivacy
*.symlink
**/*.symlink
Dockerfile
**/Dockerfile
Snippets/*
Sources/CNIOAtomics/src/cpp_magic.h
Sources/CNIOLLHTTP/LICENSE
Sources/CNIOLLHTTP/c_nio_api.c
Sources/CNIOLLHTTP/c_nio_http.c
Sources/CNIOLLHTTP/c_nio_llhttp.c
Sources/CNIOLLHTTP/include/c_nio_llhttp.h
Sources/CNIOSHA1/c_nio_sha1.c
Sources/CNIOSHA1/include/CNIOSHA1.h
dev/alloc-limits-from-test-output
dev/boxed-existentials.d
dev/git.commit.template
dev/lldb-smoker
dev/make-single-file-spm
dev/malloc-aggregation.d
dev/malloc-aggregation.bt
dev/update-alloc-limits-to-last-completed-ci-build
scripts/nio-diagnose
================================================
FILE: .mailfilter
================================================
# This is a list of `shasum` hashed email addresses which are filtered from CONTRIBUTORS.txt, typically for privacy.
# Lines can be generated by running `echo -n 'My Name <my@email>' | shasum | head -c 40`.
38268a29b340ecfb435c5e6c5827a596acb71cc6
886d1da6503c6de1d630beaf6acb667e4ce3e2a0
f0c2beeae30f3012fa02257998baca1737540bda
================================================
FILE: .mailmap
================================================
Tomer Doron <tomerd@apple.com> <tomer.doron@gmail.com>
Tomer Doron <tomerd@apple.com>
Tomer Doron <tomerd@apple.com> tomer doron <tomer@apple.com>
Max Moiseev <moiseev@apple.com>
Johannes Weiss <johannesweiss@apple.com> <johannesweiss@apple.com>
Johannes Weiss <johannesweiss@apple.com> <johannes@jweiss.io>
Johannes Weiss <johannesweiss@apple.com> <github@tux4u.de>
Adam Nemecek <adamnemecek@gmail.com>
Jim Dovey <jimdovey@mac.com> <jdovey@linkedin.com>
<bas@basbroek.nl> <BasThomas@users.noreply.github.com>
<daniel_dunbar@apple.com> <daniel@zuster.org>
<norman_maurer@apple.com> <norman.maurer@googlemail.com>
<cbenfield@apple.com> <lukasaoz@gmail.com>
<cbenfield@apple.com> <lukasa@apple.com>
<helge@alwaysrightinstitute.com> <devteam@zeezide.de>
Tim Condon <0xtimc@gmail.com> Tim <0xTim@users.noreply.github.com>
Tim Condon <0xtimc@gmail.com> <0xTim@users.noreply.github.com>
Tim Condon <0xtimc@gmail.com> Tim <0xtimc@gmail.com>
George Barnett <gbarnett@apple.com> <gbrntt@gmail.com>
Alex Blewitt <alblue@apple.com> <alex.blewitt@gmail.com>
Ben Cohen <ben_cohen@apple.com> <airspeedswift@users.noreply.github.com>
Jason Toffaletti <jtoffaletti@apple.com> <toffaletti@gmail.com>
Gwynne Raskind <gwynne@vapor.codes> <graskind@apple.com>
Gwynne Raskind <gwynne@vapor.codes> <gwynne@darkrainfall.org>
Gwynne Raskind <gwynne@vapor.codes> <gwynne@users.noreply.github.com>
Kevin Sweeney <kevin_sweeney@apple.com> <kevin.t.sweeney@gmail.com>
Lev Walkin <lwalkin@apple.com> <vlm@lionet.info>
Ludovic Dewailly <ldewailly@apple.com> <me@ldewailly.com>
Konrad `ktoso` Malawski <ktoso@apple.com> <konrad.malawski@project13.pl>
Konrad `ktoso` Malawski <ktoso@apple.com> <konrad_malawski@apple.com>
Artem Redkin <aredkin@apple.com> <artem@redkin.me>
Jovan Milenkovic <jovan.milenkovic@htecgroup.com> <jovanmilenkovic@live.com>
Nathan Harris <nathan@mordil.info> <Mordil@users.noreply.github.com>
Sergo Beruashvili <beruashvili@gmail.com> <2391557+ogres@users.noreply.github.com>
Sergej Jaskiewicz <jaskiewiczs@icloud.com> <broadwaylamb@users.noreply.github.com>
Siemen Sikkema <s.h.sikkema@gmail.com> <siemensikkema@users.noreply.github.com>
Dario Rexin <drexin@apple.com> <dario.rexin@me.com>
Romain Pouclet <rpouclet@apple.com> <romain.pouclet@gmail.com>
Julian Lettner <julian.lettner@apple.com> <yln@users.noreply.github.com>
Mario Sangiorgio <msangiorgio@apple.com> <mariosangiorgio@gmail.com>
Marli Oshlack <marli.oshlack@apple.com> <marli@oshlack.com>
David Evans <d.evans@apple.com> <david.evans@blackpoint.co>
Jake Foster <jakef@fastmail.com> <2bjake@users.noreply.github.com>
Emil Marashliev <marashliev@gmail.com> <emarashliev@users.noreply.github.com>
Heidi Puk Hermann <heidi.puk@gmail.com> <32973281+heidipuk@users.noreply.github.com>
Joachim M. <joachim.me86@gmail.com> <32777429+Lupurus@users.noreply.github.com>
Richard Low <ral@apple.com> <richard@wentnet.com>
Pushparaj Zala <pr92zala@gmail.com> <przala@users.noreply.github.com>
Christian Priebe <cpriebe@apple.com> <chr.priebe@gmail.com>
Peter Adams <pp_adams@apple.com> <61008809+PeterAdams76@users.noreply.github.com>
Peter Adams <pp_adams@apple.com> <63288215+PeterAdams-A@users.noreply.github.com>
Shekhar Rajak <shekhar_rajak@apple.com> <60732970+shekhar-rajak@users.noreply.github.com>
Liam Flynn <l.flynn@live.co.uk> <l.flynn2@live.co.uk>
Andrew Naylor <andrew_naylor@apple.com> <argon@mkbot.net>
Andrius Aucinas <aaucinas@apple.com>
Andrius Aucinas <aaucinas@apple.com> <andrius.aucinas@gmail.com>
Fabian Fett <fabianfett@apple.com> <fabianfett@gmail.com>
Fabian Fett <fabianfett@apple.com> <fabianfett@mac.com>
Graeme Jenkinson <graeme_jenkinson@apple.com> <gcjenkinson@users.noreply.github.com>
Max Desiatov <max@desiatov.com> <max.desiatov@gmail.com>
Joshua Rutkowski <jr.rtkski@gmail.com> <54906829+joshrutkowski@users.noreply.github.com>
Rémi Doreau <remi.d45@gmail.com> <32459935+ayshiff@users.noreply.github.com>
Franz Busch <f.busch@apple.com> <privat@franz-busch.de>
David Nadoba <d_nadoba@apple.com> <dnadoba@gmail.com>
Si Beaumont <beaumont@apple.com> <simonjbeaumont@gmail.com>
Benedict St. <benedictst@icloud.com> <52418145+BenedictSt@users.noreply.github.com>
Austin Payne <austin.payne.01@gmail.com> <Austinpayne@users.noreply.github.com>
Donghyeon Kim <wplong11@gmail.com> <wplong11@users.noreply.github.com>
Guillaume Lessard <guillaume.lessard@apple.com> <glessard@users.noreply.github.com>
Joakim Hassila <jocke@ordo.one> <hassila@users.noreply.github.com>
Stepan Ulyanin <sulyanin@apple.com> <99296376+stepan-ulyanin@users.noreply.github.com>
Finagolfin <butta@fastem.com> <repo@butta.fastem.com>
Paul Schmiedmayer <paul.schmiedmayer@tum.de> <PSchmiedmayer@users.noreply.github.com>
John Connolly <connoljo2@gmail.com> <jconnolly@touchbistro.com>
Rick Newton-Rogers <rnewtonrogers@apple.com> <104022490+rnro@users.noreply.github.com>
================================================
FILE: .spi.yml
================================================
version: 1
builder:
configs:
- documentation_targets: [NIO, NIOConcurrencyHelpers, NIOCore, NIOEmbedded, NIOFoundationCompat, NIOHTTP1, NIOPosix, NIOTLS, NIOWebSocket, NIOTestUtils, _NIOFileSystem, NIOFileSystem]
================================================
FILE: .swift-format
================================================
{
"version" : 1,
"indentation" : {
"spaces" : 4
},
"tabWidth" : 4,
"fileScopedDeclarationPrivacy" : {
"accessLevel" : "private"
},
"spacesAroundRangeFormationOperators" : false,
"indentConditionalCompilationBlocks" : false,
"indentSwitchCaseLabels" : false,
"lineBreakAroundMultilineExpressionChainComponents" : false,
"lineBreakBeforeControlFlowKeywords" : false,
"lineBreakBeforeEachArgument" : true,
"lineBreakBeforeEachGenericRequirement" : true,
"lineLength" : 120,
"maximumBlankLines" : 1,
"respectsExistingLineBreaks" : true,
"prioritizeKeepingFunctionOutputTogether" : true,
"rules" : {
"AllPublicDeclarationsHaveDocumentation" : false,
"AlwaysUseLiteralForEmptyCollectionInit" : false,
"AlwaysUseLowerCamelCase" : false,
"AmbiguousTrailingClosureOverload" : true,
"BeginDocumentationCommentWithOneLineSummary" : false,
"DoNotUseSemicolons" : true,
"DontRepeatTypeInStaticProperties" : true,
"FileScopedDeclarationPrivacy" : true,
"FullyIndirectEnum" : true,
"GroupNumericLiterals" : true,
"IdentifiersMustBeASCII" : true,
"NeverForceUnwrap" : false,
"NeverUseForceTry" : false,
"NeverUseImplicitlyUnwrappedOptionals" : false,
"NoAccessLevelOnExtensionDeclaration" : true,
"NoAssignmentInExpressions" : true,
"NoBlockComments" : true,
"NoCasesWithOnlyFallthrough" : true,
"NoEmptyTrailingClosureParentheses" : true,
"NoLabelsInCasePatterns" : true,
"NoLeadingUnderscores" : false,
"NoParensAroundConditions" : true,
"NoVoidReturnOnFunctionSignature" : true,
"OmitExplicitReturns" : true,
"OneCasePerLine" : true,
"OneVariableDeclarationPerLine" : true,
"OnlyOneTrailingClosureArgument" : true,
"OrderedImports" : true,
"ReplaceForEachWithForLoop" : true,
"ReturnVoidInsteadOfEmptyTuple" : true,
"UseEarlyExits" : false,
"UseExplicitNilCheckInConditions" : false,
"UseLetInEveryBoundCaseVariable" : false,
"UseShorthandTypeNames" : true,
"UseSingleLinePropertyGetter" : false,
"UseSynthesizedInitializer" : false,
"UseTripleSlashForDocumentationComments" : true,
"UseWhereClausesInForLoops" : false,
"ValidateDocumentationComments" : false
}
}
================================================
FILE: Benchmarks/.gitignore
================================================
.DS_Store
/.build
/Packages
xcuserdata/
DerivedData/
.swiftpm/configuration/registries.json
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
.netrc
.benchmarkBaselines/
================================================
FILE: Benchmarks/Benchmarks/NIOCoreBenchmarks/Benchmarks.swift
================================================
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2024 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import Benchmark
import NIOCore
import NIOEmbedded
// MARK: - Handlers for AddressedEnvelope benchmarks
private final class ByteBufferEnvelopeForwardingHandler: ChannelInboundHandler, Sendable {
typealias InboundIn = AddressedEnvelope<ByteBuffer>
func channelRead(context: ChannelHandlerContext, data: NIOAny) {
context.fireChannelRead(data)
}
}
private final class StringEnvelopeForwardingHandler: ChannelInboundHandler, Sendable {
typealias InboundIn = AddressedEnvelope<String>
func channelRead(context: ChannelHandlerContext, data: NIOAny) {
context.fireChannelRead(data)
}
}
// MARK: - Handlers for ChannelPipeline benchmarks
private final class NoOpHandler: ChannelInboundHandler, Sendable {
typealias InboundIn = Any
}
// MARK: - Benchmarks
let benchmarks = {
#if LOCAL_TESTING
let defaultMetrics: [BenchmarkMetric] = [
.mallocCountTotal,
.contextSwitches,
.wallClock,
.instructions,
]
#else
let defaultMetrics: [BenchmarkMetric] = [
.mallocCountTotal
]
#endif
let leakMetrics: [BenchmarkMetric] = [
.mallocCountTotal,
.memoryLeaked,
]
Benchmark(
"NIOAsyncChannel.init",
configuration: .init(
metrics: defaultMetrics,
scalingFactor: .kilo,
maxDuration: .seconds(10_000_000),
maxIterations: 10
)
) { benchmark in
// Elide the cost of the 'EmbeddedChannel'. It's only used for its pipeline.
var channels: [EmbeddedChannel] = []
channels.reserveCapacity(benchmark.scaledIterations.count)
for _ in 0..<benchmark.scaledIterations.count {
channels.append(EmbeddedChannel())
}
benchmark.startMeasurement()
defer {
benchmark.stopMeasurement()
}
for channel in channels {
let asyncChanel = try NIOAsyncChannel<ByteBuffer, ByteBuffer>(wrappingChannelSynchronously: channel)
blackHole(asyncChanel)
}
}
Benchmark(
"WaitOnPromise",
configuration: .init(
metrics: leakMetrics,
scalingFactor: .kilo,
maxDuration: .seconds(10_000_000),
maxIterations: 10_000 // need 10k to get a signal
)
) { benchmark in
// Elide the cost of the 'EmbeddedEventLoop'.
let el = EmbeddedEventLoop()
benchmark.startMeasurement()
defer {
benchmark.stopMeasurement()
}
for _ in 0..<benchmark.scaledIterations.count {
let p = el.makePromise(of: Int.self)
p.succeed(0)
do { _ = try! p.futureResult.wait() }
}
}
Benchmark(
"AddressedEnvelope.ByteBuffer.noMetadata",
configuration: .init(
metrics: defaultMetrics,
scalingFactor: .kilo,
maxDuration: .seconds(10_000_000),
maxIterations: 10
)
) { benchmark in
// Setup: Create channel with 20 forwarding handlers
let channel = EmbeddedChannel()
for _ in 0..<20 {
try! channel.pipeline.syncOperations.addHandler(ByteBufferEnvelopeForwardingHandler())
}
// Create the envelope without metadata
let address = try! SocketAddress(ipAddress: "::1", port: 8080)
let buffer = ByteBuffer(string: "test data")
let envelope = AddressedEnvelope(remoteAddress: address, data: buffer)
benchmark.startMeasurement()
defer {
benchmark.stopMeasurement()
}
for _ in 0..<benchmark.scaledIterations.count {
try! channel.writeInbound(envelope)
let result: AddressedEnvelope<ByteBuffer>? = try! channel.readInbound()
blackHole(result)
}
}
Benchmark(
"AddressedEnvelope.ByteBuffer.withMetadata",
configuration: .init(
metrics: defaultMetrics,
scalingFactor: .kilo,
maxDuration: .seconds(10_000_000),
maxIterations: 10
)
) { benchmark in
// Setup: Create channel with 20 forwarding handlers
let channel = EmbeddedChannel()
for _ in 0..<20 {
try! channel.pipeline.syncOperations.addHandler(ByteBufferEnvelopeForwardingHandler())
}
// Create the envelope with full metadata
let address = try! SocketAddress(ipAddress: "::1", port: 8080)
let buffer = ByteBuffer(string: "test data")
let metadata = AddressedEnvelope<ByteBuffer>.Metadata(
ecnState: .transportNotCapable,
packetInfo: NIOPacketInfo(destinationAddress: address, interfaceIndex: 1),
segmentSize: 1200
)
let envelope = AddressedEnvelope(remoteAddress: address, data: buffer, metadata: metadata)
benchmark.startMeasurement()
defer {
benchmark.stopMeasurement()
}
for _ in 0..<benchmark.scaledIterations.count {
try! channel.writeInbound(envelope)
let result: AddressedEnvelope<ByteBuffer>? = try! channel.readInbound()
blackHole(result)
}
}
Benchmark(
"AddressedEnvelope.String.noMetadata",
configuration: .init(
metrics: defaultMetrics,
scalingFactor: .kilo,
maxDuration: .seconds(10_000_000),
maxIterations: 10
)
) { benchmark in
// Setup: Create channel with 20 forwarding handlers
let channel = EmbeddedChannel()
for _ in 0..<20 {
try! channel.pipeline.syncOperations.addHandler(StringEnvelopeForwardingHandler())
}
// Create the envelope without metadata
let address = try! SocketAddress(ipAddress: "::1", port: 8080)
let envelope = AddressedEnvelope(remoteAddress: address, data: "test data")
benchmark.startMeasurement()
defer {
benchmark.stopMeasurement()
}
for _ in 0..<benchmark.scaledIterations.count {
try! channel.writeInbound(envelope)
let result: AddressedEnvelope<String>? = try! channel.readInbound()
blackHole(result)
}
}
Benchmark(
"AddressedEnvelope.String.withMetadata",
configuration: .init(
metrics: defaultMetrics,
scalingFactor: .kilo,
maxDuration: .seconds(10_000_000),
maxIterations: 10
)
) { benchmark in
// Setup: Create channel with 20 forwarding handlers
let channel = EmbeddedChannel()
for _ in 0..<20 {
try! channel.pipeline.syncOperations.addHandler(StringEnvelopeForwardingHandler())
}
// Create the envelope with full metadata
let address = try! SocketAddress(ipAddress: "::1", port: 8080)
let metadata = AddressedEnvelope<String>.Metadata(
ecnState: .transportNotCapable,
packetInfo: NIOPacketInfo(destinationAddress: address, interfaceIndex: 1),
segmentSize: 1200
)
let envelope = AddressedEnvelope(remoteAddress: address, data: "test data", metadata: metadata)
benchmark.startMeasurement()
defer {
benchmark.stopMeasurement()
}
for _ in 0..<benchmark.scaledIterations.count {
try! channel.writeInbound(envelope)
let result: AddressedEnvelope<String>? = try! channel.readInbound()
blackHole(result)
}
}
Benchmark(
"ChannelPipeline.init(0 handlers)",
configuration: .init(
metrics: defaultMetrics,
scalingFactor: .kilo,
maxDuration: .seconds(10_000_000),
maxIterations: 1000
)
) { benchmark in
let channel = EmbeddedChannel()
benchmark.startMeasurement()
defer {
benchmark.stopMeasurement()
}
for _ in 0..<benchmark.scaledIterations.count {
let pipeline = ChannelPipeline(channel: channel)
blackHole(pipeline)
}
}
Benchmark(
"ChannelPipeline.init(1 handler)",
configuration: .init(
metrics: defaultMetrics,
scalingFactor: .kilo,
maxDuration: .seconds(10_000_000),
maxIterations: 1000
)
) { benchmark in
let channel = EmbeddedChannel()
benchmark.startMeasurement()
defer {
benchmark.stopMeasurement()
}
for _ in 0..<benchmark.scaledIterations.count {
let pipeline = ChannelPipeline(channel: channel)
let syncOps = pipeline.syncOperations
for _ in 0..<1 {
try! syncOps.addHandler(NoOpHandler())
}
blackHole(pipeline)
}
}
Benchmark(
"ChannelPipeline.init(3 handlers)",
configuration: .init(
metrics: defaultMetrics,
scalingFactor: .kilo,
maxDuration: .seconds(10_000_000),
maxIterations: 1000
)
) { benchmark in
let channel = EmbeddedChannel()
benchmark.startMeasurement()
defer {
benchmark.stopMeasurement()
}
for _ in 0..<benchmark.scaledIterations.count {
let pipeline = ChannelPipeline(channel: channel)
let syncOps = pipeline.syncOperations
for _ in 0..<3 {
try! syncOps.addHandler(NoOpHandler())
}
blackHole(pipeline)
}
}
Benchmark(
"ChannelPipeline.init(10 handlers)",
configuration: .init(
metrics: defaultMetrics,
scalingFactor: .kilo,
maxDuration: .seconds(10_000_000),
maxIterations: 1000
)
) { benchmark in
let channel = EmbeddedChannel()
benchmark.startMeasurement()
defer {
benchmark.stopMeasurement()
}
for _ in 0..<benchmark.scaledIterations.count {
let pipeline = ChannelPipeline(channel: channel)
let syncOps = pipeline.syncOperations
for _ in 0..<10 {
try! syncOps.addHandler(NoOpHandler())
}
blackHole(pipeline)
}
}
}
================================================
FILE: Benchmarks/Benchmarks/NIOPosixBenchmarks/Benchmarks.swift
================================================
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2023 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import Benchmark
import NIOCore
import NIOPosix
private let eventLoop = MultiThreadedEventLoopGroup.singleton.next()
let benchmarks = {
let defaultMetrics: [BenchmarkMetric] = [
.mallocCountTotal,
.contextSwitches,
.wallClock,
]
Benchmark(
"TCPEcho",
configuration: .init(
metrics: defaultMetrics,
scalingFactor: .mega,
maxDuration: .seconds(10_000_000),
maxIterations: 5,
thresholds: [.mallocCountTotal: .init(absolute: [.p90: 50])]
)
) { benchmark in
try runTCPEcho(
numberOfWrites: benchmark.scaledIterations.upperBound,
eventLoop: eventLoop
)
}
Benchmark(
"TCPEchoAsyncChannel",
configuration: .init(
metrics: defaultMetrics,
scalingFactor: .mega,
maxDuration: .seconds(10_000_000),
maxIterations: 5,
// We are expecting a bit of allocation variance due to an allocation
// in the Concurrency runtime which happens when resuming a continuation.
thresholds: [.mallocCountTotal: .init(absolute: [.p90: 2000])],
setup: {
swiftTaskEnqueueGlobalHook = { job, _ in
eventLoop.executor.enqueue(job)
}
},
teardown: {
swiftTaskEnqueueGlobalHook = nil
}
)
) { benchmark in
try await runTCPEchoAsyncChannel(
numberOfWrites: benchmark.scaledIterations.upperBound,
eventLoop: eventLoop
)
}
Benchmark(
"UDPEcho",
configuration: .init(
metrics: defaultMetrics,
scalingFactor: .kilo,
maxDuration: .seconds(10_000_000),
maxIterations: 5
)
) { benchmark in
try runUDPEcho(
numberOfWrites: benchmark.scaledIterations.upperBound,
eventLoop: eventLoop
)
}
Benchmark(
"UDPEchoPacketInfo",
configuration: .init(
metrics: defaultMetrics,
scalingFactor: .kilo,
maxDuration: .seconds(10_000_000),
maxIterations: 5
)
) { benchmark in
try runUDPEchoPacketInfo(
numberOfWrites: benchmark.scaledIterations.upperBound,
eventLoop: eventLoop
)
}
Benchmark(
"MTELG.scheduleTask(in:_:)",
configuration: Benchmark.Configuration(
metrics: defaultMetrics,
scalingFactor: .mega,
maxDuration: .seconds(10_000_000),
maxIterations: 5
)
) { benchmark in
for _ in benchmark.scaledIterations {
eventLoop.scheduleTask(in: .hours(1), {})
}
}
Benchmark(
"MTELG.scheduleCallback(in:_:)",
configuration: Benchmark.Configuration(
metrics: defaultMetrics,
scalingFactor: .mega,
maxDuration: .seconds(10_000_000),
maxIterations: 5
)
) { benchmark in
final class Timer: NIOScheduledCallbackHandler {
func handleScheduledCallback(eventLoop: some EventLoop) {}
}
let timer = Timer()
benchmark.startMeasurement()
for _ in benchmark.scaledIterations {
let handle = try! eventLoop.scheduleCallback(in: .hours(1), handler: timer)
}
}
Benchmark(
"Jump to EL and back using execute and unsafecontinuation",
configuration: .init(
metrics: defaultMetrics,
scalingFactor: .kilo
)
) { benchmark in
for _ in benchmark.scaledIterations {
await withUnsafeContinuation { (continuation: UnsafeContinuation<Void, Never>) in
eventLoop.execute {
continuation.resume()
}
}
}
}
final actor Foo {
nonisolated public let unownedExecutor: UnownedSerialExecutor
init(eventLoop: any EventLoop) {
self.unownedExecutor = eventLoop.executor.asUnownedSerialExecutor()
}
func foo() {
blackHole(Void())
}
}
Benchmark(
"Jump to EL and back using actor with EL executor",
configuration: .init(
metrics: defaultMetrics,
scalingFactor: .kilo
)
) { benchmark in
let actor = Foo(eventLoop: eventLoop)
for _ in benchmark.scaledIterations {
await actor.foo()
}
}
// MARK: - NIOThreadPool submit benchmarks
// Serial wakeup: submit one item, wait for completion, repeat.
// Every submit hits N sleeping threads — this is where wake-one
// vs wake-all (thundering herd) matters most.
let pool16 = NIOThreadPool(numberOfThreads: 16)
let pool4 = NIOThreadPool(numberOfThreads: 4)
Benchmark(
"NIOThreadPool.serial_wakeup(16 threads)",
configuration: .init(
metrics: [.wallClock, .cpuUser, .cpuSystem, .cpuTotal, .contextSwitches, .syscalls],
maxDuration: .seconds(30),
maxIterations: 30,
setup: { pool16.start() },
teardown: { try! pool16.syncShutdownGracefully() }
)
) { _ in
runNIOThreadPoolSerialWakeup(pool: pool16, count: 10_000)
}
Benchmark(
"NIOThreadPool.serial_wakeup(4 threads)",
configuration: .init(
metrics: [.wallClock, .cpuUser, .cpuSystem, .cpuTotal, .contextSwitches, .syscalls],
maxDuration: .seconds(30),
maxIterations: 30,
setup: { pool4.start() },
teardown: { try! pool4.syncShutdownGracefully() }
)
) { _ in
runNIOThreadPoolSerialWakeup(pool: pool4, count: 10_000)
}
}
================================================
FILE: Benchmarks/Benchmarks/NIOPosixBenchmarks/NIOThreadPoolBenchmark.swift
================================================
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2026 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import Dispatch
import NIOCore
import NIOPosix
func runNIOThreadPoolSerialWakeup(pool: NIOThreadPool, count: Int) {
let sem = DispatchSemaphore(value: 0)
for _ in 0..<count {
pool.submit { state in
precondition(state == .active)
sem.signal()
}
sem.wait()
}
}
================================================
FILE: Benchmarks/Benchmarks/NIOPosixBenchmarks/TCPEcho.swift
================================================
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2023 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIOCore
import NIOPosix
private final class EchoChannelHandler: ChannelInboundHandler {
fileprivate typealias InboundIn = ByteBuffer
func channelRead(context: ChannelHandlerContext, data: NIOAny) {
context.writeAndFlush(data, promise: nil)
}
}
private final class EchoRequestChannelHandler: ChannelInboundHandler {
fileprivate typealias InboundIn = ByteBuffer
private let messageSize = 10000
private let numberOfWrites: Int
private var batchCount = 0
private let data: NIOAny
private let readsCompletePromise: EventLoopPromise<Void>
private var receivedData = 0
init(numberOfWrites: Int, readsCompletePromise: EventLoopPromise<Void>) {
self.numberOfWrites = numberOfWrites
self.readsCompletePromise = readsCompletePromise
self.data = NIOAny(ByteBuffer(repeating: 0, count: self.messageSize))
}
func channelActive(context: ChannelHandlerContext) {
for _ in 0..<self.numberOfWrites {
context.writeAndFlush(data, promise: nil)
}
}
func channelRead(context: ChannelHandlerContext, data: NIOAny) {
let buffer = Self.unwrapInboundIn(data)
self.receivedData += buffer.readableBytes
if self.receivedData == self.numberOfWrites * self.messageSize {
self.readsCompletePromise.succeed()
}
}
}
func runTCPEcho(numberOfWrites: Int, eventLoop: any EventLoop) throws {
let serverChannel = try ServerBootstrap(group: eventLoop)
.childChannelInitializer { channel in
channel.eventLoop.makeCompletedFuture {
try channel.pipeline.syncOperations.addHandler(EchoChannelHandler())
}
}
.bind(
host: "127.0.0.1",
port: 0
).wait()
let readsCompletePromise = eventLoop.makePromise(of: Void.self)
let clientChannel = try ClientBootstrap(group: eventLoop)
.channelInitializer { channel in
channel.eventLoop.makeCompletedFuture {
let echoRequestHandler = EchoRequestChannelHandler(
numberOfWrites: numberOfWrites,
readsCompletePromise: readsCompletePromise
)
try channel.pipeline.syncOperations.addHandler(echoRequestHandler)
}
}
.connect(
host: "127.0.0.1",
port: serverChannel.localAddress!.port!
).wait()
// Waiting for the client to collect all echoed data.
try readsCompletePromise.futureResult.wait()
try serverChannel.close().wait()
try clientChannel.close().wait()
}
================================================
FILE: Benchmarks/Benchmarks/NIOPosixBenchmarks/TCPEchoAsyncChannel.swift
================================================
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2023 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIOCore
import NIOPosix
func runTCPEchoAsyncChannel(numberOfWrites: Int, eventLoop: EventLoop) async throws {
let serverChannel = try await ServerBootstrap(group: eventLoop)
.bind(
host: "127.0.0.1",
port: 0
) { channel in
channel.eventLoop.makeCompletedFuture {
try NIOAsyncChannel(
wrappingChannelSynchronously: channel,
configuration: .init(
inboundType: ByteBuffer.self,
outboundType: ByteBuffer.self
)
)
}
}
let clientChannel = try await ClientBootstrap(group: eventLoop)
.connect(
host: "127.0.0.1",
port: serverChannel.channel.localAddress!.port!
) { channel in
channel.eventLoop.makeCompletedFuture {
try NIOAsyncChannel(
wrappingChannelSynchronously: channel,
configuration: .init(
inboundType: ByteBuffer.self,
outboundType: ByteBuffer.self
)
)
}
}
let messageSize = 10000
try await withThrowingTaskGroup(of: Void.self) { group in
// This child task is echoing back the data on the server.
group.addTask {
try await serverChannel.executeThenClose { serverChannelInbound in
for try await connectionChannel in serverChannelInbound {
try await connectionChannel.executeThenClose {
connectionChannelInbound,
connectionChannelOutbound in
for try await inboundData in connectionChannelInbound {
try await connectionChannelOutbound.write(inboundData)
}
}
}
}
}
try await clientChannel.executeThenClose { inbound, outbound in
// This child task is collecting the echoed back responses.
group.addTask {
var receivedData = 0
for try await inboundData in inbound {
receivedData += inboundData.readableBytes
if receivedData == numberOfWrites * messageSize {
return
}
}
}
// Let's start sending data.
let data = ByteBuffer(repeating: 0, count: messageSize)
for _ in 0..<numberOfWrites {
try await outbound.write(data)
}
// Waiting for the child task that collects the responses to finish.
try await group.next()
// Cancelling the server child task.
group.cancelAll()
try await serverChannel.channel.closeFuture.get()
try await clientChannel.channel.closeFuture.get()
}
}
}
================================================
FILE: Benchmarks/Benchmarks/NIOPosixBenchmarks/UDPEcho.swift
================================================
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2025 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIOCore
import NIOPosix
private final class UDPEchoHandler: ChannelInboundHandler {
typealias InboundIn = AddressedEnvelope<ByteBuffer>
typealias OutboundOut = AddressedEnvelope<ByteBuffer>
func channelRead(context: ChannelHandlerContext, data: NIOAny) {
context.write(data, promise: nil)
}
func channelReadComplete(context: ChannelHandlerContext) {
context.flush()
}
}
private final class UDPEchoRequestHandler: ChannelInboundHandler {
typealias InboundIn = AddressedEnvelope<ByteBuffer>
typealias OutboundOut = AddressedEnvelope<ByteBuffer>
private let buffer = ByteBuffer(repeating: 0, count: 512)
private let numberOfWrites: Int
private let remoteAddress: SocketAddress
private var receivedCount = 0
private let readsCompletePromise: EventLoopPromise<Void>
init(
numberOfWrites: Int,
remoteAddress: SocketAddress,
readsCompletePromise: EventLoopPromise<Void>
) {
self.numberOfWrites = numberOfWrites
self.remoteAddress = remoteAddress
self.readsCompletePromise = readsCompletePromise
}
func channelActive(context: ChannelHandlerContext) {
self.writeAgain(context: context)
}
func channelRead(context: ChannelHandlerContext, data: NIOAny) {
self.receivedCount += 1
if self.receivedCount == self.numberOfWrites {
self.readsCompletePromise.succeed()
} else {
self.writeAgain(context: context)
}
}
private func writeAgain(context: ChannelHandlerContext) {
let envelope = AddressedEnvelope(
remoteAddress: self.remoteAddress,
data: buffer
)
context.write(Self.wrapOutboundOut(envelope), promise: nil)
context.flush()
}
}
func runUDPEcho(numberOfWrites: Int, eventLoop: any EventLoop) throws {
let address = try SocketAddress.makeAddressResolvingHost("127.0.0.1", port: 0)
// Create server channel
let serverChannel = try DatagramBootstrap(group: eventLoop)
.channelInitializer { channel in
channel.eventLoop.makeCompletedFuture {
try channel.pipeline.syncOperations.addHandler(UDPEchoHandler())
}
}
.bind(to: address)
.wait()
let readsCompletePromise = eventLoop.makePromise(of: Void.self)
// Create client channel
let clientChannel = try DatagramBootstrap(group: eventLoop)
.channelInitializer { channel in
channel.eventLoop.makeCompletedFuture {
let handler = UDPEchoRequestHandler(
numberOfWrites: numberOfWrites,
remoteAddress: serverChannel.localAddress!,
readsCompletePromise: readsCompletePromise
)
try channel.pipeline.syncOperations.addHandler(handler)
}
}
.bind(to: address)
.wait()
// Wait for all echoes to complete
try readsCompletePromise.futureResult.wait()
// Cleanup
try serverChannel.close().wait()
try clientChannel.close().wait()
}
func runUDPEchoPacketInfo(numberOfWrites: Int, eventLoop: any EventLoop) throws {
let address = try SocketAddress.makeAddressResolvingHost("127.0.0.1", port: 0)
// Create server channel with receivePacketInfo enabled
let serverChannel = try DatagramBootstrap(group: eventLoop)
.channelOption(.receivePacketInfo, value: true)
.channelInitializer { channel in
channel.eventLoop.makeCompletedFuture {
try channel.pipeline.syncOperations.addHandler(UDPEchoHandler())
}
}
.bind(to: address)
.wait()
let readsCompletePromise = eventLoop.makePromise(of: Void.self)
// Create client channel with receivePacketInfo enabled
let clientChannel = try DatagramBootstrap(group: eventLoop)
.channelOption(.receivePacketInfo, value: true)
.channelInitializer { channel in
channel.eventLoop.makeCompletedFuture {
let handler = UDPEchoRequestHandler(
numberOfWrites: numberOfWrites,
remoteAddress: serverChannel.localAddress!,
readsCompletePromise: readsCompletePromise
)
try channel.pipeline.syncOperations.addHandler(handler)
}
}
.bind(to: address)
.wait()
// Wait for all echoes to complete
try readsCompletePromise.futureResult.wait()
// Cleanup
try serverChannel.close().wait()
try clientChannel.close().wait()
}
================================================
FILE: Benchmarks/Benchmarks/NIOPosixBenchmarks/Util/GlobalExecutor.swift
================================================
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2023 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
#if canImport(Darwin)
import Darwin.C
#elseif canImport(Glibc)
import Glibc
#else
#error("Unsupported platform.")
#endif
// This file allows us to hook the global executor which
// we can use to mimic task executors for now.
typealias EnqueueGlobalHook = @convention(thin) (UnownedJob, @convention(thin) (UnownedJob) -> Void) -> Void
var swiftTaskEnqueueGlobalHook: EnqueueGlobalHook? {
get { _swiftTaskEnqueueGlobalHook.pointee }
set { _swiftTaskEnqueueGlobalHook.pointee = newValue }
}
private let _swiftTaskEnqueueGlobalHook: UnsafeMutablePointer<EnqueueGlobalHook?> =
dlsym(dlopen(nil, RTLD_LAZY), "swift_task_enqueueGlobal_hook").assumingMemoryBound(to: EnqueueGlobalHook?.self)
================================================
FILE: Benchmarks/Package.swift
================================================
// swift-tools-version:5.10
import PackageDescription
let package = Package(
name: "benchmarks",
platforms: [
.macOS("14")
],
dependencies: [
.package(path: "../"),
.package(url: "https://github.com/ordo-one/package-benchmark.git", from: "1.29.11"),
],
targets: [
.executableTarget(
name: "NIOPosixBenchmarks",
dependencies: [
.product(name: "Benchmark", package: "package-benchmark"),
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOPosix", package: "swift-nio"),
],
path: "Benchmarks/NIOPosixBenchmarks",
plugins: [
.plugin(name: "BenchmarkPlugin", package: "package-benchmark")
]
),
.executableTarget(
name: "NIOCoreBenchmarks",
dependencies: [
.product(name: "Benchmark", package: "package-benchmark"),
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOEmbedded", package: "swift-nio"),
],
path: "Benchmarks/NIOCoreBenchmarks",
plugins: [
.plugin(name: "BenchmarkPlugin", package: "package-benchmark")
]
),
]
)
================================================
FILE: Benchmarks/Thresholds/5.10/NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json
================================================
{
"mallocCountTotal" : 8000
}
================================================
FILE: Benchmarks/Thresholds/5.10/NIOCoreBenchmarks.WaitOnPromise.p90.json
================================================
{
"mallocCountTotal" : 6000,
"memoryLeaked" : 0
}
================================================
FILE: Benchmarks/Thresholds/5.10/NIOPosixBenchmarks.TCPEcho.p90.json
================================================
{
"mallocCountTotal" : 108
}
================================================
FILE: Benchmarks/Thresholds/5.10/NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json
================================================
{
"mallocCountTotal" : 164375
}
================================================
FILE: Benchmarks/Thresholds/6.0/NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json
================================================
{
"mallocCountTotal" : 8000
}
================================================
FILE: Benchmarks/Thresholds/6.0/NIOPosixBenchmarks.TCPEcho.p90.json
================================================
{
"mallocCountTotal": 108
}
================================================
FILE: Benchmarks/Thresholds/6.0/NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json
================================================
{
"mallocCountTotal": 82754
}
================================================
FILE: Benchmarks/Thresholds/6.1/NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json
================================================
{
"mallocCountTotal" : 8000
}
================================================
FILE: Benchmarks/Thresholds/6.1/NIOPosixBenchmarks.TCPEcho.p90.json
================================================
{
"mallocCountTotal": 108
}
================================================
FILE: Benchmarks/Thresholds/6.1/NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json
================================================
{
"mallocCountTotal": 82614
}
================================================
FILE: Benchmarks/Thresholds/6.2/NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json
================================================
{
"mallocCountTotal" : 8000
}
================================================
FILE: Benchmarks/Thresholds/6.2/NIOPosixBenchmarks.TCPEcho.p90.json
================================================
{
"mallocCountTotal": 603
}
================================================
FILE: Benchmarks/Thresholds/6.2/NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json
================================================
{
"mallocCountTotal": 387
}
================================================
FILE: Benchmarks/Thresholds/nightly-main/NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json
================================================
{
"mallocCountTotal" : 8000
}
================================================
FILE: Benchmarks/Thresholds/nightly-main/NIOPosixBenchmarks.TCPEcho.p90.json
================================================
{
"mallocCountTotal": 107
}
================================================
FILE: Benchmarks/Thresholds/nightly-main/NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json
================================================
{
"mallocCountTotal": 389
}
================================================
FILE: Benchmarks/Thresholds/nightly-next/NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json
================================================
{
"mallocCountTotal" : 8000
}
================================================
FILE: Benchmarks/Thresholds/nightly-next/NIOPosixBenchmarks.TCPEcho.p90.json
================================================
{
"mallocCountTotal": 108
}
================================================
FILE: Benchmarks/Thresholds/nightly-next/NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json
================================================
{
"mallocCountTotal": 391
}
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Code of Conduct
The code of conduct for this project can be found at https://swift.org/code-of-conduct.
<!-- Copyright (c) 2023 Apple Inc and the Swift Project authors. All Rights Reserved. -->
================================================
FILE: CONTRIBUTING.md
================================================
## Legal
By submitting a pull request, you represent that you have the right to license
your contribution to Apple and the community, and agree by submitting the patch
that your contributions are licensed under the Apache 2.0 license (see
`LICENSE.txt`).
## How to submit a bug report
Please ensure to specify the following:
* SwiftNIO commit hash
* Contextual information (e.g. what you were trying to achieve with SwiftNIO)
* Simplest possible steps to reproduce
* More complex the steps are, lower the priority will be.
* A pull request with failing test case is preferred, but it's just fine to paste the test case into the issue description.
* Anything that might be relevant in your opinion, such as:
* Swift version or the output of `swift --version`
* OS version and the output of `uname -a`
* Network configuration
### Example
```
SwiftNIO commit hash: 22ec043dc9d24bb011b47ece4f9ee97ee5be2757
Context:
While load testing my HTTP web server written with SwiftNIO, I noticed
that one file descriptor is leaked per request.
Steps to reproduce:
1. ...
2. ...
3. ...
4. ...
$ swift --version
Swift version 4.0.2 (swift-4.0.2-RELEASE)
Target: x86_64-unknown-linux-gnu
Operating system: Ubuntu Linux 16.04 64-bit
$ uname -a
Linux beefy.machine 4.4.0-101-generic #124-Ubuntu SMP Fri Nov 10 18:29:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
My system has IPv6 disabled.
```
## Writing a Patch
A good SwiftNIO patch is:
1. Concise, and contains as few changes as needed to achieve the end result.
2. Tested, ensuring that any tests provided failed before the patch and pass after it.
3. Documented, adding API documentation as needed to cover new functions and properties.
4. Accompanied by a great commit message, using our commit message template.
### Commit Message Template
We require that your commit messages match our template. The easiest way to do that is to get git to help you by explicitly using the template. To do that, `cd` to the root of our repository and run:
git config commit.template dev/git.commit.template
The default policy for taking contributions is “Squash and Merge” - because of this the commit message format rule above applies to the PR rather than every commit contained within it.
### Make sure your patch works for all supported versions of swift
The CI will do this for you, but a project maintainer must kick it off for you. Currently all versions of Swift >= 5.9 are supported.
If you wish to test this locally use [act](https://github.com/nektos/act).
#### Act
[Install act](https://nektosact.com/installation/) and then you can run the full suite of checks via:
```
act pull_request
```
Note that SwiftNIO matrix testing makes use of nightly builds, so you may want to make use of the ```--action-offline-mode``` to avoid repulling those.
### Make sure your code is performant
SwiftNIO has been created to be high performance. The integration tests cover some measures of performance including allocations which should be avoided if possible. For help with allocation problems refer to the guide to [allocation debugging](./docs/debugging-allocations.md)
### Formatting
Try to keep your lines less than 120 characters long so GitHub can correctly display your changes.
SwiftNIO uses the [swift-format](https://github.com/swiftlang/swift-format) tool to bring consistency to code formatting. There is a specific [.swift-format](./.swift-format) configuration file. This will be checked and enforced on PRs. Note that the check will run on the current most recent stable version target which may not match that in your own local development environment.
If you want to apply the formatting to your local repo before you commit then you can either run [check-swift-format.sh](https://github.com/swiftlang/github-workflows/blob/main/.github/workflows/scripts/check-swift-format.sh) which will use your current toolchain, or to match the CI checks exactly you can use `act` (see [act section](#act)):
```
act --action-offline-mode --bind workflow_call --job soundness --input format_check_enabled=true
```
If you're using a machine with an ARM64 architecture (such as an Apple Silicon Mac) then
you'll also need to specify the container architecture:
```
act --container-architecture linux/amd64 --action-offline-mode --bind workflow_call --job soundness --input format_check_enabled=true
```
This will run the format checks, binding to your local checkout so the edits made are to your own source.
### Extensibility
Try to make sure your code is robust to future extensions. The public interface is very hard to change after release - please refer to the [API guidelines](./docs/public-api.md)
## How to contribute your work
Please open a pull request at https://github.com/apple/swift-nio. Make sure the CI passes, and then wait for code review.
After review you may be asked to make changes. When you are ready, use the request re-review feature of GitHub or mention the reviewers by name in a comment.
================================================
FILE: CONTRIBUTORS.txt
================================================
For the purpose of tracking copyright, this is the list of individuals and
organizations who have contributed source code to SwiftNIO.
For employees of an organization/company where the copyright of work done
by employees of that company is held by the company itself, only the company
needs to be listed here.
## COPYRIGHT HOLDERS
- Apple Inc. (all contributors with '@apple.com')
### Contributors
- 0xflotus <0xflotus@gmail.com>
- Adam Fowler <adamfowler71@gmail.com>
- Adam Nemecek <adamnemecek@gmail.com>
- Ahmad Alhashemi <ahmad@ahmadh.com>
- Albert Aleksieiev <albert.aleksieiev@gmail.com>
- Alex Blewitt <alblue@apple.com>
- Alex Reilly <fabiobean2@gmail.com>
- Andrew Edwards <andrewangeta@gmail.com>
- Andrew Naylor <andrew_naylor@apple.com>
- Andrew Trick <atrick@apple.com>
- Andrius Aucinas <aaucinas@apple.com>
- Anish Aggarwal <anish17122000@gmail.com>
- Ankit Aggarwal <ankit_aggarwal@apple.com>
- Antoine Cœur <coeur@gmx.fr>
- Antwan van Houdt <jabwd@exurion.com>
- Arjun Nayini <aanayini@gmail.com>
- Artem Redkin <aredkin@apple.com>
- Austin Payne <austin.payne.01@gmail.com>
- Bas Broek <bas@basbroek.nl>
- Bastian Inuk Christensen <bastian@inuk.blog>
- Ben Cohen <ben_cohen@apple.com>
- Benedict St. <benedictst@icloud.com>
- Boby <73424060+bobychaudhary@users.noreply.github.com>
- Bouke Haarsma <bouke@haarsma.eu>
- Chris Eidhof <chris@eidhof.nl>
- Christian Priebe <cpriebe@apple.com>
- Christian Weinberger <christian.weinberger@me.com>
- Cory Benfield <cbenfield@apple.com>
- Cotton Hou <himcotton@gmail.com>
- Damiaan Dufaux <damiaan@dpro.be>
- Daniel Alm <Daniel.Alm@ForumD.net>
- Daniel Dunbar <daniel_dunbar@apple.com>
- Dario Rexin <drexin@apple.com>
- David Evans <d.evans@apple.com>
- David Nadoba <d_nadoba@apple.com>
- David Skrundz <david.skrundz@gmail.com>
- Donghyeon Kim <wplong11@gmail.com>
- Doug Friedman <dfriedm3@gmail.com>
- Emil Marashliev <marashliev@gmail.com>
- Esteban Torres <me@estebantorr.es>
- Eugen <eugenf78@gmail.com>
- Fabian Fett <fabianfett@apple.com>
- Felix Schlegel <fefefe152@gmail.com>
- Felix Schlegel <schlegel@apple.com>
- Finagolfin <butta@fastem.com>
- Florian Friedrich <ffried@me.com>
- Frank Kair <frankkair@gmail.com>
- Franz Busch <f.busch@apple.com>
- Gautier Delorme <gautier.delorme@gmail.com>
- George Barnett <gbarnett@apple.com>
- Gopal Sharma <gopal@the-sharmas.org>
- Graeme Jenkinson <graeme_jenkinson@apple.com>
- Gregor Milos (Grzegorz Miłoś) <gmilos@apple.com>
- GuangGuang <lihansey163@163.com>
- Guillaume Lessard <guillaume.lessard@apple.com>
- Gwynne Raskind <gwynne@vapor.codes>
- Hailong <hailongzh@hotmail.com>
- Heidi Puk Hermann <heidi.puk@gmail.com>
- Helder Sérvio <41337686+heldersrvio@users.noreply.github.com>
- Helge Heß <helge@alwaysrightinstitute.com>
- Ian Partridge <i.partridge@uk.ibm.com>
- Ilya Puchka <ilyapuchka@gmail.com>
- JP Simard <jp@jpsim.com>
- Jake Foster <jakef@fastmail.com>
- Jake Prickett <jprickett821@gmail.com>
- Jari (LotU) <j.koopman@jarict.nl>
- Jason Toffaletti <jtoffaletti@apple.com>
- Jim Dovey <jimdovey@mac.com>
- Joachim M. <joachim.me86@gmail.com>
- Joakim Hassila <jocke@ordo.one>
- Joe Smith <yasumoto7@gmail.com>
- Johannes Weiss <johannesweiss@apple.com>
- John Connolly <connoljo2@gmail.com>
- John Holdsworth <github@johnholdsworth.com>
- John Lin <johnlinvc@gmail.com>
- Joshua Rutkowski <jr.rtkski@gmail.com>
- Jovan Milenkovic <jovan.milenkovic@htecgroup.com>
- Julian Lettner <julian.lettner@apple.com>
- Kaitlin Mahar <kaitlinmahar@gmail.com>
- Kamil Borzym <kamil.borzym@gmail.com>
- Karim ElNaggar <karimfarid.naggar@gmail.com>
- Kevin Clark <kevin.clark@apple.com>
- Kevin Sweeney <kevin_sweeney@apple.com>
- Kim de Vos <kimdevos12@hotmail.com>
- Konrad `ktoso` Malawski <ktoso@apple.com>
- Kushal Pisavadia <kushal.p@apple.com>
- Kyle Bashour <kylebshr@me.com>
- Kyle Browning <kylebrowning@me.com>
- Kyle Jessup <kyle@perfect.org>
- Lev Walkin <lwalkin@apple.com>
- Liam Flynn <l.flynn@live.co.uk>
- Ludovic Dewailly <ldewailly@apple.com>
- Luo Xiu <luoxiustm@gmail.com>
- Mahdi Bahrami <github@mahdibm.com>
- Marcus Liotta <marcus@liotta.se>
- Mario Sangiorgio <msangiorgio@apple.com>
- Markus Jais <markusjais@googlemail.com>
- Markus Kieselmann <markus@kieselmann.eu>
- Marli Oshlack <marli.oshlack@apple.com>
- Matt Eaton <agnosticdev@gmail.com>
- Matt Hope <matt_hope@apple.com>
- Matteo Comisso <matteo.comisso@me.com>
- Max Desiatov <m_desiatov@apple.com>
- Max Desiatov <max@desiatov.com>
- Max Moiseev <moiseev@apple.com>
- Maxim Zaks <maxim.zaks@gmail.com>
- Moritz Lang <hi@slashmo.codes>
- Nathan Harris <nathan@mordil.info>
- Nethra Ravindran <nethra.ravindran@in.ibm.com>
- Norio Nomura <norio.nomura@gmail.com>
- Norman Maurer <norman_maurer@apple.com>
- Ole Begemann <ole@oleb.net>
- OleG <emptystamp@gmail.com>
- Oleksandr Zhurba <69315809+mob-connection@users.noreply.github.com>
- Paul Schmiedmayer <paul.schmiedmayer@tum.de>
- Peter Adams <pp_adams@apple.com>
- Peter Tolsma <pejato@umich.edu>
- Petro Rovenskyy <petro.rovenskyy@gmail.com>
- Philip Brown <122590765+asdf-bro@users.noreply.github.com>
- Portia <portia-s@users.noreply.github.com>
- Pushkar N Kulkarni <pushkar.nk@in.ibm.com>
- Pushparaj Zala <pr92zala@gmail.com>
- Richard Low <ral@apple.com>
- Rick Newton-Rogers <rnewtonrogers@apple.com>
- Romain Pouclet <rpouclet@apple.com>
- Rukshani Athapathu <arukshani@users.noreply.github.com>
- Rémi Doreau <remi.d45@gmail.com>
- Saleem Abdulrasool <compnerd@compnerd.org>
- Sebastian Thiebaud <770074+SebastianThiebaud@users.noreply.github.com>
- Sebastian Vogt <sebastian1210@web.de>
- Semen Zhydenko <simeon.zhidenko@gmail.com>
- Sergej Jaskiewicz <jaskiewiczs@icloud.com>
- Sergo Beruashvili <beruashvili@gmail.com>
- Shaun Hubbard <shaunhubbard2013@icloud.com>
- Shekhar Rajak <shekhar_rajak@apple.com>
- Si Beaumont <beaumont@apple.com>
- Siemen Sikkema <s.h.sikkema@gmail.com>
- Simon Evans <si@si.org>
- Stepan Ulyanin <sulyanin@apple.com>
- Stuart Hinson <stuart.hinson@gmail.com>
- Tanner <me@tanner.xyz>
- Tiago Martinho <martinho@thoughtworks.com>
- Tibor Bödecs <mail.tib@gmail.com>
- Tim Condon <0xtimc@gmail.com>
- Tim Kientzle <tkientzle@apple.com>
- Timothée Peignier <timothee.peignier@icloud.com>
- Tom Counsell <tamc@greenonblack.com>
- Tomer Doron <tomerd@apple.com>
- Tony Arnold <tony@thecocoabots.com>
- Trevör <adtrevor@users.noreply.github.com>
- Trevör Anne Denise <adtrevor@users.noreply.github.com>
- Volodymyr Sapsai <vsapsai@users.noreply.github.com>
- Will Lisac <will@lisac.org>
- Wilson Ding <hello@wilsonding.com>
- YR Chen <stevapple@icloud.com>
- Yim Lee <yim_lee@apple.com>
- akash-55 <61596874+akash-55@users.noreply.github.com>
- buttaface <butta@fastem.com>
- carolinacass <67160898+carolinacass@users.noreply.github.com>
- dkz2 <132388278+dkz2@users.noreply.github.com>
- fadi-botros <botros_fadi@yahoo.com>
- jemmons <jemmons@users.noreply.github.com>
- pokryfka <pokryfka@gmail.com>
- ser <122270051+ser-0xff@users.noreply.github.com>
- sun_ <sunlubo.sun@gmail.com>
- taylorswift <kelvin13ma@gmail.com>
- thomas-gill-0xff <115996764+thomas-gill-0xff@users.noreply.github.com>
- toluRV <111301355+toluRV@users.noreply.github.com>
- trungducc <gnurtduc@gmail.com>
**Updating this list**
Please do not edit this file manually. It is generated using `./scripts/generate_contributors_list.sh`. If a name is misspelled or appearing multiple times: add an entry in `./.mailmap`
================================================
FILE: IntegrationTests/allocation-counter-tests-framework/run-allocation-counter.sh
================================================
#!/bin/bash
##===----------------------------------------------------------------------===##
##
## This source file is part of the SwiftNIO open source project
##
## Copyright (c) 2019-2020 Apple Inc. and the SwiftNIO project authors
## Licensed under Apache License v2.0
##
## See LICENSE.txt for license information
## See CONTRIBUTORS.txt for the list of SwiftNIO project authors
##
## SPDX-License-Identifier: Apache-2.0
##
##===----------------------------------------------------------------------===##
set -eu
here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
build_opts=( -c release )
function die() {
echo >&2 "ERROR: $*"
exit 1
}
function make_git_commit_all() {
git init > /dev/null
git checkout -b main > /dev/null
if [[ "$(git config user.email)" == "" ]]; then
git config --local user.email does@really-not.matter
git config --local user.name 'Does Not Matter'
fi
git add . > /dev/null
git commit -m 'everything' > /dev/null
}
# <extra_dependencies_file> <swiftpm_pkg_name> <targets...>
function hooked_package_swift_start() {
local extra_dependencies_file=$1
local swiftpm_pkg_name=$2
shift 2
cat <<"EOF"
// swift-tools-version:5.7
import PackageDescription
let package = Package(
name: "allocation-counter-tests",
platforms: [
.macOS(.v10_15),
.iOS(.v13),
.watchOS(.v6),
.tvOS(.v13),
],
products: [
EOF
for f in "$@"; do
local module
module=$(module_name_from_path "$f")
echo ".executable(name: \"$module\", targets: [\"bootstrap_$module\"]),"
done
cat <<EOF
],
dependencies: [
.package(path: "HookedFunctions"),
.package(path: "AtomicCounter"),
.package(path: "$swiftpm_pkg_name"),
EOF
if [[ -n "$extra_dependencies_file" ]]; then
cat "$extra_dependencies_file"
fi
cat <<EOF
],
targets: [
EOF
}
# <target_name> <deps...>
function hooked_package_swift_target() {
local target_name="$1"
shift
local deps=""
for dep in "$@"; do
deps="$deps .product(name: \"$dep\", package: \"swift-nio\"),"
done
cat <<EOF
.target(name: "Test_$target_name", dependencies: [$deps "AtomicCounter"]),
.executableTarget(name: "bootstrap_$target_name",
dependencies: ["Test_$target_name", "HookedFunctions"]),
EOF
}
function hooked_package_swift_end() {
cat <<"EOF"
]
)
EOF
}
function abs_path() {
if [[ "${1:0:1}" == "/" ]]; then
echo "$1"
else
echo "$PWD/$1"
fi
}
function dir_basename() {
test -d "$1"
basename "$(cd "$1" && pwd)"
}
function fake_package_swift() {
cat > Package.swift <<EOF
// swift-tools-version:5.7
import PackageDescription
let package = Package(name: "$1")
EOF
}
# <target> <template> <swiftpm_pkg_root> <swiftpm_pkg_name> <hooked_function_module> <bootstrap_module>
# <extra_dependencies_file> <shared files...> -- <modules...> -- <test_files...>
function build_package() {
local target=$1
local template=$2
local swiftpm_pkg_root=$3
local swiftpm_pkg_name=$4
local hooked_function_module=$5
local bootstrap_module=$6
local extra_dependencies_file=$7
shift 7
local shared_files=()
while [[ "$1" != "--" ]]; do
shared_files+=( "$1" )
shift
done
shift
local modules=()
while [[ "$1" != "--" ]]; do
modules+=( "$1" )
shift
done
shift
test -d "$target" || die "target dir '$target' not a directory"
test -d "$template" || die "template dir '$template' not a directory"
test -d "$swiftpm_pkg_root" || die "root dir '$swiftpm_pkg_root' not a directory"
test -n "$hooked_function_module" || die "hooked function module empty"
test -n "$bootstrap_module" || die "bootstrap module empty"
cp -R "$template"/* "$target/"
mv "$target/$hooked_function_module" "$target/HookedFunctions"
mv "$target/Sources/$bootstrap_module" "$target/Sources/bootstrap"
(
set -eu
cd "$target"
cd HookedFunctions
make_git_commit_all
cd ..
cd AtomicCounter
make_git_commit_all
cd ..
hooked_package_swift_start "$extra_dependencies_file" "$swiftpm_pkg_root" "$@" > Package.swift
for f in "$@"; do
local module
module=$(module_name_from_path "$f")
hooked_package_swift_target "$module" "${modules[@]}" >> Package.swift
mkdir "Sources/bootstrap_$module"
ln -s "../bootstrap/main.c" "Sources/bootstrap_$module"
mkdir "Sources/Test_$module"
cat > "Sources/Test_$module/trampoline.swift" <<EOF
@_cdecl("swift_main")
func swift_main() {
run(identifier: "$module")
}
EOF
ln -s "$f" "Sources/Test_$module/file.swift"
ln -s "../../scaffolding.swift" "Sources/Test_$module/"
for shared_file in "${shared_files[@]+"${shared_files[@]}"}"; do
name=$(basename "$shared_file")
ln -s "$shared_file" "Sources/Test_$module/$name"
done
done
hooked_package_swift_end >> Package.swift
)
}
function module_name_from_path() {
basename "${1%.*}" | tr ". " "__"
}
# <pkg_root>
function find_swiftpm_package_name() {
(
set -eu
cd "$1"
swift package dump-package | grep '^ "name"' | cut -d'"' -f4
)
}
do_hooking=true
pkg_root="$here/.."
shared_files=()
modules=()
extra_dependencies_file=""
tmp_dir="/tmp"
while getopts "ns:p:m:d:t:" opt; do
case "$opt" in
n)
do_hooking=false
;;
s)
shared_files+=( "$(abs_path "$OPTARG")" )
;;
p)
pkg_root=$(abs_path "$OPTARG")
;;
m)
modules+=( "$OPTARG" )
;;
d)
extra_dependencies_file="$OPTARG"
;;
t)
tmp_dir="$OPTARG"
;;
\?)
die "unknown option $opt"
;;
esac
done
shift $(( OPTIND - 1 ))
if [[ $# -lt 1 ]]; then
die "not enough files provided"
fi
if [[ "${#modules}" == 0 ]]; then
die "no modules specified, use '-m <MODULE>' for every module you plan to use"
fi
if [[ ! -f "$pkg_root/Package.swift" ]]; then
die "package root '$pkg_root' doesn't contain a Package.swift file, use -p"
fi
files=()
for f in "$@"; do
files+=( "$(abs_path "$f")" )
done
test -d "$pkg_root" || die "package root '$pkg_root' not a directory"
for f in "${files[@]}"; do
test -f "$f" || die "file '$f' not a file"
done
working_dir=$(mktemp -d "$tmp_dir/.nio_alloc_counter_tests_XXXXXX")
echo "Working directory: $working_dir"
selected_hooked_functions="HookedFunctionsDoHook"
selected_bootstrap="bootstrapDoHook"
if ! $do_hooking; then
selected_hooked_functions=HookedFunctionsDoNotHook
selected_bootstrap=bootstrapDoNotHook
fi
build_package \
"$working_dir" \
"$here/template" \
"$(realpath "$pkg_root")" \
"$(find_swiftpm_package_name "$pkg_root")" \
"$selected_hooked_functions" \
"$selected_bootstrap" \
"$extra_dependencies_file" \
"${shared_files[@]+"${shared_files[@]}"}" \
-- \
"${modules[@]}" \
-- \
"${files[@]}"
(
set -eu
cd "$working_dir"
swift build "${build_opts[@]}"
bin_path=$(swift build "${build_opts[@]}" --show-bin-path)
if [[ "${NIO_ALLOC_COUNTER_TESTS_PARALLEL:-false}" == "true" ]]; then
out_dir=$(mktemp -d)
trap 'rm -rf "$out_dir"' EXIT
for f in "${files[@]}"; do
module=$(module_name_from_path "$f")
(
rc=0
"$bin_path/$module" > "$out_dir/$module" || rc=$?
echo $rc > "$out_dir/$module.exit"
) &
done
wait
all_ok=true
for f in "${files[@]}"; do
module=$(module_name_from_path "$f")
echo "- $f"
if [[ "$(cat "$out_dir/$module.exit")" == "0" ]]; then
cat "$out_dir/$module"
else
all_ok=false
echo "FAILED: $f" >&2
cat "$out_dir/$module"
fi
done
"$all_ok"
else
for f in "${files[@]}"; do
echo "- $f"
"$bin_path/$(module_name_from_path "$f")"
done
fi
)
================================================
FILE: IntegrationTests/allocation-counter-tests-framework/template/AtomicCounter/Package.swift
================================================
// swift-tools-version:5.10
// The swift-tools-version declares the minimum version of Swift required to build this package.
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import PackageDescription
let package = Package(
name: "AtomicCounter",
products: [
.library(name: "AtomicCounter", type: .dynamic, targets: ["AtomicCounter"])
],
dependencies: [],
targets: [
.target(
name: "AtomicCounter",
dependencies: []
)
]
)
================================================
FILE: IntegrationTests/allocation-counter-tests-framework/template/AtomicCounter/Sources/AtomicCounter/include/atomic-counter.h
================================================
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
#ifndef ATOMIC_COUNTER
#define ATOMIC_COUNTER
#include <stdatomic.h>
void inc_free_counter(void);
void reset_free_counter(void);
long read_free_counter(void);
void inc_malloc_counter(void);
void reset_malloc_counter(void);
long read_malloc_counter(void);
void add_malloc_bytes_counter(intptr_t v);
void reset_malloc_bytes_counter(void);
intptr_t read_malloc_bytes_counter(void);
typedef struct {
size_t count;
int *leaked;
} LeakedFDs;
void begin_tracking_fds(void);
void track_open_fd(int fd);
void track_closed_fd(int fd);
LeakedFDs stop_tracking_fds(void);
#endif
================================================
FILE: IntegrationTests/allocation-counter-tests-framework/template/AtomicCounter/Sources/AtomicCounter/src/atomic-counter.c
================================================
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2023 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
#include <atomic-counter.h>
#include <assert.h>
#include <pthread.h>
#include <stdatomic.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#define MAKE_COUNTER(name) /*
*/ _Atomic long g_ ## name ## _counter = ATOMIC_VAR_INIT(0); /*
*/ void inc_ ## name ## _counter(void) { /*
*/ atomic_fetch_add_explicit(&g_ ## name ## _counter, 1, memory_order_relaxed); /*
*/ } /*
*/ /*
*/ void add_ ## name ## _counter(intptr_t v) { /*
*/ atomic_fetch_add_explicit(&g_ ## name ## _counter, v, memory_order_relaxed); /*
*/ } /*
*/ void reset_ ## name ## _counter(void) { /*
*/ atomic_store_explicit(&g_ ## name ## _counter, 0, memory_order_relaxed); /*
*/ } /*
*/ /*
*/ intptr_t read_ ## name ## _counter(void) { /*
*/ return atomic_load_explicit(&g_ ## name ## _counter, memory_order_relaxed); /*
*/ }
MAKE_COUNTER(free)
MAKE_COUNTER(malloc)
MAKE_COUNTER(malloc_bytes)
// This section covers tracking leaked FDs.
//
// We do this by recording which FD has been set in a queue. A queue is a bad data structure here,
// but using a better one requires writing too much code, and the performance impact here is not
// going to be too bad.
typedef struct {
size_t capacity;
size_t count;
int *allocatedFDs;
} FDTracker;
static _Bool FDTracker_search_fd(const FDTracker *tracker, int fd, size_t *foundIndex) {
if (tracker == NULL) { return false; }
for (size_t i = 0; i < tracker->count; i++) {
if (tracker->allocatedFDs[i] == fd) {
if (foundIndex != NULL) {
*foundIndex = i;
}
return true;
}
}
return false;
}
static void FDTracker_remove_at_index(FDTracker *tracker, size_t index) {
assert(tracker != NULL);
assert(index < tracker->count);
// Shuffle everything down by 1 from index onwards.
const size_t lastValidTargetIndex = tracker->count - 1;
for (size_t i = index; i < lastValidTargetIndex; i++) {
tracker->allocatedFDs[i] = tracker->allocatedFDs[i + 1];
gitextract_lx9o5bau/
├── .editorconfig
├── .git-blame-ignore-revs
├── .gitattributes
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ └── bug-report.md
│ ├── PULL_REQUEST_TEMPLATE.md
│ ├── actions/
│ │ └── pull_request_semver_label_checker/
│ │ └── action.yml
│ ├── dependabot.yml
│ ├── release.yml
│ └── workflows/
│ ├── android_swift_sdk.yml
│ ├── benchmarks.yml
│ ├── cmake_tests.yml
│ ├── cxx_interop.yml
│ ├── macos_benchmarks.yml
│ ├── macos_tests.yml
│ ├── main.yml
│ ├── pull_request.yml
│ ├── pull_request_label.yml
│ ├── release_builds.yml
│ ├── static_sdk.yml
│ ├── swift_6_language_mode.yml
│ ├── swift_load_test_matrix.yml
│ ├── swift_matrix.yml
│ ├── swift_test_matrix.yml
│ ├── unit_tests.yml
│ └── wasm_swift_sdk.yml
├── .gitignore
├── .licenseignore
├── .mailfilter
├── .mailmap
├── .spi.yml
├── .swift-format
├── Benchmarks/
│ ├── .gitignore
│ ├── Benchmarks/
│ │ ├── NIOCoreBenchmarks/
│ │ │ └── Benchmarks.swift
│ │ └── NIOPosixBenchmarks/
│ │ ├── Benchmarks.swift
│ │ ├── NIOThreadPoolBenchmark.swift
│ │ ├── TCPEcho.swift
│ │ ├── TCPEchoAsyncChannel.swift
│ │ ├── UDPEcho.swift
│ │ └── Util/
│ │ └── GlobalExecutor.swift
│ ├── Package.swift
│ └── Thresholds/
│ ├── 5.10/
│ │ ├── NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json
│ │ ├── NIOCoreBenchmarks.WaitOnPromise.p90.json
│ │ ├── NIOPosixBenchmarks.TCPEcho.p90.json
│ │ └── NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json
│ ├── 6.0/
│ │ ├── NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json
│ │ ├── NIOPosixBenchmarks.TCPEcho.p90.json
│ │ └── NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json
│ ├── 6.1/
│ │ ├── NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json
│ │ ├── NIOPosixBenchmarks.TCPEcho.p90.json
│ │ └── NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json
│ ├── 6.2/
│ │ ├── NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json
│ │ ├── NIOPosixBenchmarks.TCPEcho.p90.json
│ │ └── NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json
│ ├── nightly-main/
│ │ ├── NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json
│ │ ├── NIOPosixBenchmarks.TCPEcho.p90.json
│ │ └── NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json
│ └── nightly-next/
│ ├── NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json
│ ├── NIOPosixBenchmarks.TCPEcho.p90.json
│ └── NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── CONTRIBUTORS.txt
├── IntegrationTests/
│ ├── allocation-counter-tests-framework/
│ │ ├── run-allocation-counter.sh
│ │ └── template/
│ │ ├── AtomicCounter/
│ │ │ ├── Package.swift
│ │ │ └── Sources/
│ │ │ └── AtomicCounter/
│ │ │ ├── include/
│ │ │ │ └── atomic-counter.h
│ │ │ └── src/
│ │ │ └── atomic-counter.c
│ │ ├── HookedFunctionsDoHook/
│ │ │ ├── Package.swift
│ │ │ └── Sources/
│ │ │ └── HookedFunctions/
│ │ │ ├── include/
│ │ │ │ └── hooked-functions.h
│ │ │ └── src/
│ │ │ ├── hooked-functions-darwin.c
│ │ │ └── hooked-functions-unix.c
│ │ ├── HookedFunctionsDoNotHook/
│ │ │ ├── Package.swift
│ │ │ └── Sources/
│ │ │ └── HookedFunctions/
│ │ │ ├── include/
│ │ │ │ └── hooked-functions.h
│ │ │ └── src/
│ │ │ └── hooked-functions.c
│ │ ├── Sources/
│ │ │ ├── bootstrapDoHook/
│ │ │ │ └── main.c
│ │ │ └── bootstrapDoNotHook/
│ │ │ └── main.c
│ │ └── scaffolding.swift
│ ├── plugin_echo.sh
│ ├── plugin_junit_xml.sh
│ ├── run-single-test.sh
│ ├── run-tests.sh
│ ├── test_functions.sh
│ ├── tests_01_http/
│ │ ├── defines.sh
│ │ ├── test_01_get_file.sh
│ │ ├── test_02_get_random_bytes.sh
│ │ ├── test_03_post_random_bytes.sh
│ │ ├── test_04_keep_alive_works.sh
│ │ ├── test_05_repeated_reqs_work.sh
│ │ ├── test_06_http_1.0.sh
│ │ ├── test_07_headers_work.sh
│ │ ├── test_08_survive_signals.sh
│ │ ├── test_09_curl_happy_with_trailers.sh
│ │ ├── test_10_connection_drop_in_body_ok.sh
│ │ ├── test_11_res_body_streaming.sh
│ │ ├── test_12_headers_too_large.sh
│ │ ├── test_13_http_pipelining.sh
│ │ ├── test_14_strict_mode_assertion.sh
│ │ ├── test_15_post_in_chunked_encoding.sh
│ │ ├── test_16_tcp_client_ip.sh
│ │ ├── test_17_serve_massive_sparse_file.sh
│ │ ├── test_18_close_with_no_keepalive.sh
│ │ ├── test_19_connection_drop_while_waiting_for_response_uds.sh
│ │ ├── test_20_connection_drop_while_waiting_for_response_tcp.sh
│ │ ├── test_21_connection_reset_tcp.sh
│ │ ├── test_22_http_1.0_keep_alive.sh
│ │ ├── test_23_repeated_reqs_with_half_closure.sh
│ │ └── test_24_http_over_stdio.sh
│ ├── tests_02_syscall_wrappers/
│ │ ├── defines.sh
│ │ ├── test_01_syscall_wrapper_fast.sh
│ │ ├── test_02_unacceptable_errnos.sh
│ │ └── test_03_unacceptable_read_errnos.sh
│ ├── tests_03_debug_binary_checks/
│ │ ├── defines.sh
│ │ ├── test_01_check_we_do_not_link_Foundation.sh
│ │ └── test_02_expected_crashes_work.sh
│ ├── tests_04_performance/
│ │ ├── Thresholds/
│ │ │ ├── 5.10.json
│ │ │ ├── 5.8.json
│ │ │ ├── 6.0.json
│ │ │ ├── 6.1.json
│ │ │ ├── 6.2.json
│ │ │ ├── nightly-main.json
│ │ │ └── nightly-next.json
│ │ ├── defines.sh
│ │ ├── test_01_allocation_counts.sh
│ │ └── test_01_resources/
│ │ ├── README.md
│ │ ├── run-nio-alloc-counter-tests.sh
│ │ ├── shared.swift
│ │ ├── test_10000000_asyncsequenceproducer.swift
│ │ ├── test_1000000_asyncwriter.swift
│ │ ├── test_1000_addHandlers.swift
│ │ ├── test_1000_addHandlers_sync.swift
│ │ ├── test_1000_addRemoveHandlers.swift
│ │ ├── test_1000_autoReadGetAndSet.swift
│ │ ├── test_1000_autoReadGetAndSet_sync.swift
│ │ ├── test_1000_copying_bytebufferview_to_array.swift
│ │ ├── test_1000_copying_circularbuffer_to_array.swift
│ │ ├── test_1000_getHandlers.swift
│ │ ├── test_1000_getHandlers_sync.swift
│ │ ├── test_1000_reqs_1_conn.swift
│ │ ├── test_1000_rst_connections.swift
│ │ ├── test_1000_tcpbootstraps.swift
│ │ ├── test_1000_tcpconnections.swift
│ │ ├── test_1000_udp_reqs.swift
│ │ ├── test_1000_udpbootstraps.swift
│ │ ├── test_1000_udpconnections.swift
│ │ ├── test_1_reqs_1000_conn.swift
│ │ ├── test_assume_isolated_scheduling_10000_executions.swift
│ │ ├── test_bytebuffer_lots_of_rw.swift
│ │ ├── test_creating_10000_headers.swift
│ │ ├── test_decode_1000_ws_frames.swift
│ │ ├── test_encode_1000_ws_frames.swift
│ │ ├── test_execute_hop_10000_tasks.swift
│ │ ├── test_flat_schedule_10000_tasks.swift
│ │ ├── test_flat_schedule_assume_isolated_10000_tasks.swift
│ │ ├── test_future_assume_isolated_lots_of_callbacks.swift
│ │ ├── test_future_erase_result.swift
│ │ ├── test_future_lots_of_callbacks.swift
│ │ ├── test_get_100000_headers_canonical_form.swift
│ │ ├── test_modifying_1000_circular_buffer_elements.swift
│ │ ├── test_modifying_byte_buffer_view.swift
│ │ ├── test_ping_pong_1000_reqs_1_conn.swift
│ │ ├── test_read_10000_chunks_from_file.swift
│ │ ├── test_schedule_10000_tasks.swift
│ │ ├── test_schedule_and_run_10000_tasks.swift
│ │ ├── test_schedule_assume_isolated_10000_tasks.swift
│ │ ├── test_schedule_with_deadline_10000_tasks.swift
│ │ ├── test_schedule_with_deadline_assume_isolated_10000_tasks.swift
│ │ ├── test_scheduling_10000_executions.swift
│ │ ├── test_submit_10000_tasks.swift
│ │ ├── test_submit_assume_isolated_10000_tasks.swift
│ │ ├── test_udp_1000_reqs_1_conn.swift
│ │ └── test_udp_1_reqs_1000_conn.swift
│ └── tests_05_assertions/
│ ├── defines.sh
│ └── test_01_syscall_wrapper_fast.sh
├── LICENSE.txt
├── NOTICE.txt
├── Package.swift
├── README.md
├── SECURITY.md
├── Snippets/
│ └── NIOFileSystemTour.swift
├── Sources/
│ ├── CNIOAtomics/
│ │ ├── include/
│ │ │ └── CNIOAtomics.h
│ │ └── src/
│ │ ├── c-atomics.c
│ │ ├── c-nioatomics.c
│ │ └── cpp_magic.h
│ ├── CNIODarwin/
│ │ ├── include/
│ │ │ └── CNIODarwin.h
│ │ └── shim.c
│ ├── CNIOLLHTTP/
│ │ ├── LICENSE
│ │ ├── c_nio_api.c
│ │ ├── c_nio_http.c
│ │ ├── c_nio_llhttp.c
│ │ ├── include/
│ │ │ ├── CNIOLLHTTP.h
│ │ │ └── c_nio_llhttp.h
│ │ └── update_and_patch_llhttp.sh
│ ├── CNIOLinux/
│ │ ├── include/
│ │ │ ├── CNIOLinux.h
│ │ │ └── liburing_nio.h
│ │ ├── liburing_shims.c
│ │ └── shim.c
│ ├── CNIOOpenBSD/
│ │ ├── include/
│ │ │ └── CNIOOpenBSD.h
│ │ └── shim.c
│ ├── CNIOPosix/
│ │ ├── event_loop_id.c
│ │ └── include/
│ │ └── CNIOPosix.h
│ ├── CNIOSHA1/
│ │ ├── c_nio_sha1.c
│ │ ├── include/
│ │ │ └── CNIOSHA1.h
│ │ └── update_and_patch_sha1.sh
│ ├── CNIOWASI/
│ │ ├── CNIOWASI.c
│ │ └── include/
│ │ └── CNIOWASI.h
│ ├── CNIOWindows/
│ │ ├── WSAStartup.c
│ │ ├── include/
│ │ │ ├── CNIOWindows.h
│ │ │ └── module.modulemap
│ │ └── shim.c
│ ├── NIO/
│ │ ├── Docs.docc/
│ │ │ ├── Articles/
│ │ │ │ ├── Debugging Allocation Regressions.md
│ │ │ │ └── Running Alloction Counting Tests.md
│ │ │ └── index.md
│ │ └── Exports.swift
│ ├── NIOAsyncAwaitDemo/
│ │ ├── AsyncChannelIO.swift
│ │ ├── FullRequestResponse.swift
│ │ └── main.swift
│ ├── NIOChatClient/
│ │ ├── README.md
│ │ └── main.swift
│ ├── NIOChatServer/
│ │ ├── README.md
│ │ └── main.swift
│ ├── NIOConcurrencyHelpers/
│ │ ├── NIOAtomic.swift
│ │ ├── NIOLock.swift
│ │ ├── NIOLockedValueBox.swift
│ │ ├── NIOThreadPoolWorkAvailable.swift
│ │ ├── atomics.swift
│ │ └── lock.swift
│ ├── NIOCore/
│ │ ├── AddressedEnvelope.swift
│ │ ├── AsyncAwaitSupport.swift
│ │ ├── AsyncChannel/
│ │ │ ├── AsyncChannel.swift
│ │ │ ├── AsyncChannelHandler.swift
│ │ │ ├── AsyncChannelInboundStream.swift
│ │ │ └── AsyncChannelOutboundWriter.swift
│ │ ├── AsyncSequences/
│ │ │ ├── NIOAsyncSequenceProducer.swift
│ │ │ ├── NIOAsyncSequenceProducerStrategies.swift
│ │ │ ├── NIOAsyncWriter.swift
│ │ │ └── NIOThrowingAsyncSequenceProducer.swift
│ │ ├── BSDSocketAPI.swift
│ │ ├── ByteBuffer-aux.swift
│ │ ├── ByteBuffer-binaryEncodedLengthPrefix.swift
│ │ ├── ByteBuffer-conversions.swift
│ │ ├── ByteBuffer-core.swift
│ │ ├── ByteBuffer-hex.swift
│ │ ├── ByteBuffer-int.swift
│ │ ├── ByteBuffer-lengthPrefix.swift
│ │ ├── ByteBuffer-multi-int.swift
│ │ ├── ByteBuffer-quicBinaryEncodingStrategy.swift
│ │ ├── ByteBuffer-views.swift
│ │ ├── Channel.swift
│ │ ├── ChannelHandler.swift
│ │ ├── ChannelHandlers.swift
│ │ ├── ChannelInvoker.swift
│ │ ├── ChannelOption.swift
│ │ ├── ChannelPipeline.swift
│ │ ├── CircularBuffer.swift
│ │ ├── Codec.swift
│ │ ├── ConvenienceOptionSupport.swift
│ │ ├── DeadChannel.swift
│ │ ├── DispatchQueue+WithFuture.swift
│ │ ├── Docs.docc/
│ │ │ ├── ByteBuffer-lengthPrefix.md
│ │ │ ├── index.md
│ │ │ ├── loops-futures-concurrency.md
│ │ │ └── swift-concurrency.md
│ │ ├── EventLoop+Deprecated.swift
│ │ ├── EventLoop+SerialExecutor.swift
│ │ ├── EventLoop.swift
│ │ ├── EventLoopFuture+AssumeIsolated.swift
│ │ ├── EventLoopFuture+Deprecated.swift
│ │ ├── EventLoopFuture+WithEventLoop.swift
│ │ ├── EventLoopFuture.swift
│ │ ├── FileDescriptor.swift
│ │ ├── FileHandle.swift
│ │ ├── FileRegion.swift
│ │ ├── GlobalSingletons.swift
│ │ ├── IO.swift
│ │ ├── IOData.swift
│ │ ├── IPProtocol.swift
│ │ ├── IntegerBitPacking.swift
│ │ ├── IntegerTypes.swift
│ │ ├── Interfaces.swift
│ │ ├── Linux.swift
│ │ ├── MarkedCircularBuffer.swift
│ │ ├── MulticastChannel.swift
│ │ ├── NIOAny.swift
│ │ ├── NIOCloseOnErrorHandler.swift
│ │ ├── NIOCoreSendableMetatype.swift
│ │ ├── NIODecodedAsyncSequence.swift
│ │ ├── NIOLoopBound.swift
│ │ ├── NIOPooledRecvBufferAllocator.swift
│ │ ├── NIOScheduledCallback.swift
│ │ ├── NIOSendable.swift
│ │ ├── NIOSplitLinesMessageDecoder.swift
│ │ ├── NIOTransportAccessibleChannelCore.swift
│ │ ├── RecvByteBufferAllocator.swift
│ │ ├── SingleStepByteToMessageDecoder.swift
│ │ ├── SocketAddresses.swift
│ │ ├── SocketOptionProvider.swift
│ │ ├── SystemCallHelpers.swift
│ │ ├── TimeAmount+Duration.swift
│ │ ├── TypeAssistedChannelHandler.swift
│ │ ├── UniversalBootstrapSupport.swift
│ │ └── Utilities.swift
│ ├── NIOCrashTester/
│ │ ├── CrashTestSuites.swift
│ │ ├── CrashTests+ByteBuffer.swift
│ │ ├── CrashTests+EventLoop.swift
│ │ ├── CrashTests+HTTP.swift
│ │ ├── CrashTests+LoopBound.swift
│ │ ├── CrashTests+Strict.swift
│ │ ├── CrashTests+System.swift
│ │ ├── OutputGrepper.swift
│ │ └── main.swift
│ ├── NIOEchoClient/
│ │ ├── README.md
│ │ └── main.swift
│ ├── NIOEchoServer/
│ │ ├── README.md
│ │ └── main.swift
│ ├── NIOEmbedded/
│ │ ├── AsyncTestingChannel.swift
│ │ ├── AsyncTestingEventLoop.swift
│ │ └── Embedded.swift
│ ├── NIOFS/
│ │ ├── Array+FileSystem.swift
│ │ ├── ArraySlice+FileSystem.swift
│ │ ├── BufferedReader.swift
│ │ ├── BufferedWriter.swift
│ │ ├── ByteBuffer+FileSystem.swift
│ │ ├── ByteCount.swift
│ │ ├── Convenience.swift
│ │ ├── DirectoryEntries.swift
│ │ ├── DirectoryEntry.swift
│ │ ├── Exports.swift
│ │ ├── FileChunks.swift
│ │ ├── FileHandle.swift
│ │ ├── FileHandleProtocol.swift
│ │ ├── FileInfo.swift
│ │ ├── FileSystem.swift
│ │ ├── FileSystemError+Syscall.swift
│ │ ├── FileSystemError.swift
│ │ ├── FileSystemProtocol.swift
│ │ ├── FileType.swift
│ │ ├── IOStrategy.swift
│ │ ├── Internal/
│ │ │ ├── BufferedOrAnyStream.swift
│ │ │ ├── BufferedStream.swift
│ │ │ ├── Cancellation.swift
│ │ │ ├── Concurrency Primitives/
│ │ │ │ └── TokenBucket.swift
│ │ │ ├── ParallelDirCopy.swift
│ │ │ ├── ParallelRemoval.swift
│ │ │ ├── String+UnsafeUnititializedCapacity.swift
│ │ │ ├── System Calls/
│ │ │ │ ├── CInterop.swift
│ │ │ │ ├── Errno.swift
│ │ │ │ ├── FileDescriptor+Syscalls.swift
│ │ │ │ ├── Mocking.swift
│ │ │ │ ├── Syscall.swift
│ │ │ │ └── Syscalls.swift
│ │ │ ├── SystemFileHandle.swift
│ │ │ └── Utilities.swift
│ │ ├── NIOFilePath.swift
│ │ ├── NIOFileSystemSendableMetatype.swift
│ │ ├── OpenOptions.swift
│ │ ├── PrivacyInfo.xcprivacy
│ │ └── String+FileSystem.swift
│ ├── NIOFSFoundationCompat/
│ │ ├── Data+FileSystem.swift
│ │ └── Date+FileInfo.swift
│ ├── NIOFileSystem/
│ │ ├── Docs.docc/
│ │ │ └── index.md
│ │ └── Exports.swift
│ ├── NIOFoundationCompat/
│ │ ├── ByteBuffer-foundation.swift
│ │ ├── Codable+ByteBuffer.swift
│ │ ├── JSONSerialization+ByteBuffer.swift
│ │ └── WaitSpinningRunLoop.swift
│ ├── NIOHTTP1/
│ │ ├── ByteCollectionUtils.swift
│ │ ├── HTTPDecoder.swift
│ │ ├── HTTPEncoder.swift
│ │ ├── HTTPHeaderValidator.swift
│ │ ├── HTTPHeaders+Validation.swift
│ │ ├── HTTPPipelineSetup.swift
│ │ ├── HTTPServerPipelineHandler.swift
│ │ ├── HTTPServerProtocolErrorHandler.swift
│ │ ├── HTTPServerUpgradeHandler.swift
│ │ ├── HTTPTypedPipelineSetup.swift
│ │ ├── HTTPTypes.swift
│ │ ├── NIOHTTPClientUpgradeHandler.swift
│ │ ├── NIOHTTPObjectAggregator.swift
│ │ ├── NIOTypedHTTPClientUpgradeHandler.swift
│ │ ├── NIOTypedHTTPClientUpgraderStateMachine.swift
│ │ ├── NIOTypedHTTPServerUpgradeHandler.swift
│ │ └── NIOTypedHTTPServerUpgraderStateMachine.swift
│ ├── NIOHTTP1Client/
│ │ ├── README.md
│ │ └── main.swift
│ ├── NIOHTTP1Server/
│ │ ├── README.md
│ │ └── main.swift
│ ├── NIOMulticastChat/
│ │ └── main.swift
│ ├── NIOPerformanceTester/
│ │ ├── Benchmark.swift
│ │ ├── ByteBufferViewContainsBenchmark.swift
│ │ ├── ByteBufferViewCopyToArrayBenchmark.swift
│ │ ├── ByteBufferViewIteratorBenchmark.swift
│ │ ├── ByteBufferWriteMultipleBenchmarks.swift
│ │ ├── ByteToMessageDecoderDecodeManySmallsBenchmark.swift
│ │ ├── ChannelPipelineBenchmark.swift
│ │ ├── ChannelPipelineInstantiationBenchmark.swift
│ │ ├── CircularBufferCopyToArrayBenchmark.swift
│ │ ├── CircularBufferIntoByteBufferBenchmark.swift
│ │ ├── DeadlineNowBenchmark.swift
│ │ ├── ExecuteBenchmark.swift
│ │ ├── LockBenchmark.swift
│ │ ├── NIOAsyncSequenceProducerBenchmark.swift
│ │ ├── NIOAsyncWriterSingleWritesBenchmark.swift
│ │ ├── NIOThreadPoolSubmitBenchmark.swift
│ │ ├── RunIfActiveBenchmark.swift
│ │ ├── SchedulingAndRunningBenchmark.swift
│ │ ├── TCPThroughputBenchmark.swift
│ │ ├── UDPBenchmark.swift
│ │ ├── WebSocketFrameDecoderBenchmark.swift
│ │ ├── WebSocketFrameEncoderBenchmark.swift
│ │ ├── main.swift
│ │ └── resources.swift
│ ├── NIOPosix/
│ │ ├── BSDSocketAPICommon.swift
│ │ ├── BSDSocketAPIPosix.swift
│ │ ├── BSDSocketAPIWindows.swift
│ │ ├── BaseSocket.swift
│ │ ├── BaseSocketChannel+AccessibleTransport.swift
│ │ ├── BaseSocketChannel+SocketOptionProvider.swift
│ │ ├── BaseSocketChannel.swift
│ │ ├── BaseStreamSocketChannel.swift
│ │ ├── Bootstrap.swift
│ │ ├── ControlMessage.swift
│ │ ├── DatagramVectorReadManager.swift
│ │ ├── Docs.docc/
│ │ │ ├── GSO-GRO-Linux.md
│ │ │ └── index.md
│ │ ├── Errors+Any.swift
│ │ ├── FileDescriptor.swift
│ │ ├── GetaddrinfoResolver.swift
│ │ ├── HappyEyeballs.swift
│ │ ├── IO.swift
│ │ ├── IntegerBitPacking.swift
│ │ ├── IntegerTypes.swift
│ │ ├── Linux.swift
│ │ ├── LinuxCPUSet.swift
│ │ ├── LinuxUring.swift
│ │ ├── MultiThreadedEventLoopGroup.swift
│ │ ├── NIOPosixSendableMetatype.swift
│ │ ├── NIOThreadPool.swift
│ │ ├── NonBlockingFileIO.swift
│ │ ├── PendingDatagramWritesManager.swift
│ │ ├── PendingWritesManager.swift
│ │ ├── PipeChannel.swift
│ │ ├── PipePair.swift
│ │ ├── Pool.swift
│ │ ├── PosixSingletons+ConcurrencyTakeOver.swift
│ │ ├── PosixSingletons.swift
│ │ ├── PrivacyInfo.xcprivacy
│ │ ├── RawSocketBootstrap.swift
│ │ ├── Resolver.swift
│ │ ├── Selectable.swift
│ │ ├── SelectableChannel.swift
│ │ ├── SelectableEventLoop.swift
│ │ ├── SelectorEpoll.swift
│ │ ├── SelectorGeneric.swift
│ │ ├── SelectorKqueue.swift
│ │ ├── SelectorUring.swift
│ │ ├── SelectorWSAPoll.swift
│ │ ├── ServerSocket.swift
│ │ ├── Socket.swift
│ │ ├── SocketChannel.swift
│ │ ├── SocketProtocols.swift
│ │ ├── StructuredConcurrencyHelpers.swift
│ │ ├── System.swift
│ │ ├── Thread.swift
│ │ ├── ThreadPosix.swift
│ │ ├── ThreadWindows.swift
│ │ ├── Utilities.swift
│ │ ├── VsockAddress.swift
│ │ ├── VsockChannelEvents.swift
│ │ └── Windows.swift
│ ├── NIOTCPEchoClient/
│ │ ├── Client.swift
│ │ └── README.md
│ ├── NIOTCPEchoServer/
│ │ ├── README.md
│ │ └── Server.swift
│ ├── NIOTLS/
│ │ ├── ApplicationProtocolNegotiationHandler.swift
│ │ ├── NIOTypedApplicationProtocolNegotiationHandler.swift
│ │ ├── ProtocolNegotiationHandlerStateMachine.swift
│ │ ├── SNIHandler.swift
│ │ └── TLSEvents.swift
│ ├── NIOTestUtils/
│ │ ├── ByteToMessageDecoderVerifier.swift
│ │ ├── EventCounterHandler.swift
│ │ ├── ManualTaskExecutor.swift
│ │ └── NIOHTTP1TestServer.swift
│ ├── NIOUDPEchoClient/
│ │ ├── README.md
│ │ └── main.swift
│ ├── NIOUDPEchoServer/
│ │ ├── README.md
│ │ └── main.swift
│ ├── NIOWebSocket/
│ │ ├── NIOWebSocketClientUpgrader.swift
│ │ ├── NIOWebSocketFrameAggregator.swift
│ │ ├── NIOWebSocketServerUpgrader.swift
│ │ ├── SHA1.swift
│ │ ├── WebSocketErrorCodes.swift
│ │ ├── WebSocketFrame.swift
│ │ ├── WebSocketFrameDecoder.swift
│ │ ├── WebSocketFrameEncoder.swift
│ │ ├── WebSocketOpcode.swift
│ │ └── WebSocketProtocolErrorHandler.swift
│ ├── NIOWebSocketClient/
│ │ ├── Client.swift
│ │ └── README.md
│ ├── NIOWebSocketServer/
│ │ ├── README.md
│ │ └── Server.swift
│ ├── _NIOBase64/
│ │ └── Base64.swift
│ ├── _NIOConcurrency/
│ │ └── Empty.swift
│ ├── _NIODataStructures/
│ │ ├── Heap.swift
│ │ ├── PriorityQueue.swift
│ │ └── _TinyArray.swift
│ ├── _NIOFileSystem/
│ │ ├── Array+FileSystem.swift
│ │ ├── ArraySlice+FileSystem.swift
│ │ ├── BufferedReader.swift
│ │ ├── BufferedWriter.swift
│ │ ├── ByteBuffer+FileSystem.swift
│ │ ├── ByteCount.swift
│ │ ├── Convenience.swift
│ │ ├── DirectoryEntries.swift
│ │ ├── DirectoryEntry.swift
│ │ ├── Docs.docc/
│ │ │ ├── Extensions/
│ │ │ │ ├── DirectoryFileHandleProtocol.md
│ │ │ │ ├── FileHandleProtocol.md
│ │ │ │ ├── FileSystemProtocol.md
│ │ │ │ ├── ReadableFileHandleProtocol.md
│ │ │ │ └── WritableFileHandleProtocol.md
│ │ │ └── index.md
│ │ ├── Exports.swift
│ │ ├── FileChunks.swift
│ │ ├── FileHandle.swift
│ │ ├── FileHandleProtocol.swift
│ │ ├── FileInfo.swift
│ │ ├── FileSystem.swift
│ │ ├── FileSystemError+Syscall.swift
│ │ ├── FileSystemError.swift
│ │ ├── FileSystemProtocol.swift
│ │ ├── FileType.swift
│ │ ├── IOStrategy.swift
│ │ ├── Internal/
│ │ │ ├── BufferedOrAnyStream.swift
│ │ │ ├── BufferedStream.swift
│ │ │ ├── Cancellation.swift
│ │ │ ├── Concurrency Primitives/
│ │ │ │ └── TokenBucket.swift
│ │ │ ├── ParallelDirCopy.swift
│ │ │ ├── ParallelRemoval.swift
│ │ │ ├── String+UnsafeUnititializedCapacity.swift
│ │ │ ├── System Calls/
│ │ │ │ ├── CInterop.swift
│ │ │ │ ├── Errno.swift
│ │ │ │ ├── FileDescriptor+Syscalls.swift
│ │ │ │ ├── Mocking.swift
│ │ │ │ ├── Syscall.swift
│ │ │ │ └── Syscalls.swift
│ │ │ ├── SystemFileHandle.swift
│ │ │ └── Utilities.swift
│ │ ├── NIOFilePath.swift
│ │ ├── NIOFileSystemSendableMetatype.swift
│ │ ├── OpenOptions.swift
│ │ ├── PrivacyInfo.xcprivacy
│ │ └── String+FileSystem.swift
│ └── _NIOFileSystemFoundationCompat/
│ ├── Data+FileSystem.swift
│ └── Date+FileInfo.swift
├── Tests/
│ ├── NIOBase64Tests/
│ │ └── Base64Test.swift
│ ├── NIOConcurrencyHelpersTests/
│ │ └── NIOConcurrencyHelpersTests.swift
│ ├── NIOCoreTests/
│ │ ├── AddressedEnvelopeTests.swift
│ │ ├── AsyncChannel/
│ │ │ ├── AsyncChannelInboundStreamTests.swift
│ │ │ ├── AsyncChannelOutboundWriterTests.swift
│ │ │ └── AsyncChannelTests.swift
│ │ ├── AsyncSequenceTests.swift
│ │ ├── AsyncSequences/
│ │ │ ├── NIOAsyncSequenceProducer+HighLowWatermarkBackPressureStrategyTests.swift
│ │ │ ├── NIOAsyncSequenceTests.swift
│ │ │ ├── NIOAsyncWriterTests.swift
│ │ │ └── NIOThrowingAsyncSequenceTests.swift
│ │ ├── BaseObjectsTest.swift
│ │ ├── ByteBufferBinaryEncodedLengthPrefixTests.swift
│ │ ├── ByteBufferCustomAllocatorTest.swift
│ │ ├── ByteBufferLengthPrefixTests.swift
│ │ ├── ByteBufferQUICBinaryEncodingStrategyTests.swift
│ │ ├── ByteBufferSpanTests.swift
│ │ ├── ByteBufferTest.swift
│ │ ├── ChannelOptionStorageTest.swift
│ │ ├── CircularBufferTests.swift
│ │ ├── CustomChannelTests.swift
│ │ ├── DispatchQueue+WithFutureTest.swift
│ │ ├── IOErrorTest.swift
│ │ ├── IntegerTypesTest.swift
│ │ ├── LinuxTest.swift
│ │ ├── MarkedCircularBufferTests.swift
│ │ ├── NIOAnyDebugTest.swift
│ │ ├── NIOCloseOnErrorHandlerTest.swift
│ │ ├── NIODecodedAsyncSequenceTests.swift
│ │ ├── NIOIsolatedEventLoopTests.swift
│ │ ├── NIOPooledRecvBufferAllocatorTests.swift
│ │ ├── NIOSplitLinesMessageDecoderTests.swift
│ │ ├── RecvByteBufAllocatorTest.swift
│ │ ├── SingleStepByteToMessageDecoderTest.swift
│ │ ├── TimeAmount+DurationTests.swift
│ │ ├── TimeAmountTests.swift
│ │ ├── TypeAssistedChannelHandlerTests.swift
│ │ ├── UtilitiesTest.swift
│ │ ├── XCTest+AsyncAwait.swift
│ │ └── XCTest+Extensions.swift
│ ├── NIODataStructuresTests/
│ │ ├── HeapTests.swift
│ │ └── PriorityQueueTests.swift
│ ├── NIOEmbeddedTests/
│ │ ├── AsyncTestingChannelTests.swift
│ │ ├── AsyncTestingEventLoopTests.swift
│ │ ├── EmbeddedChannelTest.swift
│ │ ├── EmbeddedEventLoopTest.swift
│ │ ├── TestUtils.swift
│ │ └── XCTest+AsyncAwait.swift
│ ├── NIOFSFoundationCompatTests/
│ │ └── FileSystemFoundationCompatTests.swift
│ ├── NIOFSIntegrationTests/
│ │ ├── BufferedReaderTests.swift
│ │ ├── BufferedWriterTests.swift
│ │ ├── ConvenienceTests.swift
│ │ ├── FileHandleTests.swift
│ │ ├── FileSystemTests+SPI.swift
│ │ ├── FileSystemTests.swift
│ │ ├── Test Data/
│ │ │ ├── Foo/
│ │ │ │ └── README.txt
│ │ │ └── README.md
│ │ └── XCTestExtensions.swift
│ ├── NIOFSTests/
│ │ ├── ByteCountTests.swift
│ │ ├── DirectoryEntriesTests.swift
│ │ ├── FileChunksTests.swift
│ │ ├── FileHandleTests.swift
│ │ ├── FileInfoTests.swift
│ │ ├── FileOpenOptionsTests.swift
│ │ ├── FilePathTests.swift
│ │ ├── FileSystemErrorTests.swift
│ │ ├── FileTypeTests.swift
│ │ ├── Internal/
│ │ │ ├── CancellationTests.swift
│ │ │ ├── Concurrency Primitives/
│ │ │ │ └── BufferedStreamTests.swift
│ │ │ ├── MockingInfrastructure.swift
│ │ │ └── SyscallTests.swift
│ │ └── XCTestExtensions.swift
│ ├── NIOFoundationCompatTests/
│ │ ├── ByteBuffer+UUIDTests.swift
│ │ ├── ByteBufferDataProtocolTests.swift
│ │ ├── ByteBufferView+MutableDataProtocolTest.swift
│ │ ├── Codable+ByteBufferTest.swift
│ │ ├── JSONSerialization+ByteBufferTest.swift
│ │ └── WaitSpinningRunLoopTests.swift
│ ├── NIOHTTP1Tests/
│ │ ├── ByteBufferUtilsTest.swift
│ │ ├── ContentLengthTests.swift
│ │ ├── HTTPClientUpgradeTests.swift
│ │ ├── HTTPDecoderLengthTest.swift
│ │ ├── HTTPDecoderTest.swift
│ │ ├── HTTPHeaderValidationTests.swift
│ │ ├── HTTPHeadersTest.swift
│ │ ├── HTTPRequestEncoderTest.swift
│ │ ├── HTTPResponseEncoderTest.swift
│ │ ├── HTTPResponseStatusTests.swift
│ │ ├── HTTPServerClientTest.swift
│ │ ├── HTTPServerPipelineHandlerTest.swift
│ │ ├── HTTPServerProtocolErrorHandlerTest.swift
│ │ ├── HTTPServerUpgradeTests.swift
│ │ ├── HTTPTest.swift
│ │ ├── HTTPTypesTest.swift
│ │ ├── NIOHTTPObjectAggregatorTest.swift
│ │ └── TestUtils.swift
│ ├── NIOPosixTests/
│ │ ├── AcceptBackoffHandlerTest.swift
│ │ ├── AsyncChannelBootstrapTests.swift
│ │ ├── BlockingIOThreadPoolTest.swift
│ │ ├── BootstrapTest.swift
│ │ ├── ChannelNotificationTest.swift
│ │ ├── ChannelPipelineTest.swift
│ │ ├── ChannelTests.swift
│ │ ├── CoWValue.swift
│ │ ├── CodecTest.swift
│ │ ├── ControlMessageTests.swift
│ │ ├── DatagramChannelTests.swift
│ │ ├── EchoServerClientTest.swift
│ │ ├── EventLoopFutureIsolatedTests.swift
│ │ ├── EventLoopFutureTest.swift
│ │ ├── EventLoopMetricsDelegateTests.swift
│ │ ├── EventLoopTest.swift
│ │ ├── FileRegionTest.swift
│ │ ├── GetAddrInfoResolverTest.swift
│ │ ├── HappyEyeballsTest.swift
│ │ ├── IPv4Header.swift
│ │ ├── IdleStateHandlerTest.swift
│ │ ├── IntegerBitPackingTests.swift
│ │ ├── MulticastTest.swift
│ │ ├── NIOFileHandleTest.swift
│ │ ├── NIOLoopBoundTests.swift
│ │ ├── NIOScheduledCallbackTests.swift
│ │ ├── NIOThreadPoolTest.swift
│ │ ├── NIOTransportAccessibleChannelCoreTests.swift
│ │ ├── NonBlockingFileIOTest.swift
│ │ ├── PendingDatagramWritesManagerTests.swift
│ │ ├── PipeChannelTest.swift
│ │ ├── RawSocketBootstrapTests.swift
│ │ ├── SALChannelTests.swift
│ │ ├── SALEventLoopTests.swift
│ │ ├── SelectorTest.swift
│ │ ├── SerialExecutorTests.swift
│ │ ├── SocketAddressTest.swift
│ │ ├── SocketChannelTest.swift
│ │ ├── SocketOptionProviderTest.swift
│ │ ├── StreamChannelsTest.swift
│ │ ├── SyscallAbstractionLayer.swift
│ │ ├── SyscallAbstractionLayerContext.swift
│ │ ├── SystemCallWrapperHelpers.swift
│ │ ├── SystemTest.swift
│ │ ├── TestUtils.swift
│ │ ├── ThreadTest.swift
│ │ ├── UniversalBootstrapSupportTest.swift
│ │ ├── VsockAddressTest.swift
│ │ └── XCTest+AsyncAwait.swift
│ ├── NIOSingletonsTests/
│ │ └── GlobalSingletonsTests.swift
│ ├── NIOTLSTests/
│ │ ├── ApplicationProtocolNegotiationHandlerTests.swift
│ │ ├── NIOTypedApplicationProtocolNegotiationHandlerTests.swift
│ │ └── SNIHandlerTests.swift
│ ├── NIOTestUtilsTests/
│ │ ├── ByteToMessageDecoderVerifierTest.swift
│ │ ├── EventCounterHandlerTest.swift
│ │ ├── ManualTaskExecutorTest.swift
│ │ └── NIOHTTP1TestServerTest.swift
│ ├── NIOTests/
│ │ └── NIOTests.swift
│ └── NIOWebSocketTests/
│ ├── ByteBufferWebSocketTests.swift
│ ├── NIOWebSocketClientUpgraderTests.swift
│ ├── NIOWebSocketFrameAggregatorTests.swift
│ ├── WebSocketClientEndToEndTests.swift
│ ├── WebSocketFrameDecoderTest.swift
│ ├── WebSocketFrameEncoderTest.swift
│ ├── WebSocketMaskingKeyTests.swift
│ └── WebSocketServerEndToEndTests.swift
├── dev/
│ ├── alloc-limits-from-test-output
│ ├── boxed-existentials.d
│ ├── generate-bytebuffer-multi-int.sh
│ ├── git.commit.template
│ ├── lldb-smoker
│ ├── make-single-file-spm
│ ├── malloc-aggregation.bt
│ ├── malloc-aggregation.d
│ ├── stackdiff/
│ │ ├── Package.swift
│ │ ├── Sources/
│ │ │ ├── Stacks/
│ │ │ │ ├── AggregateStacks.swift
│ │ │ │ ├── Parsing/
│ │ │ │ │ ├── BPFTraceParser.swift
│ │ │ │ │ ├── DTraceParser.swift
│ │ │ │ │ ├── HeaptrackParser.swift
│ │ │ │ │ └── StackParser.swift
│ │ │ │ └── Similarity.swift
│ │ │ └── stackdiff/
│ │ │ ├── StackFormatter.swift
│ │ │ ├── Stackdiff+Diff.swift
│ │ │ ├── Stackdiff+Dump.swift
│ │ │ ├── Stackdiff+Merge.swift
│ │ │ └── Stackdiff.swift
│ │ └── Tests/
│ │ └── StacksTests/
│ │ ├── AggregateStackTests.swift
│ │ ├── DTraceParserTests.swift
│ │ ├── HeaptrackParserTests.swift
│ │ └── SimilarityTests.swift
│ ├── stackdiff-dtrace.py
│ ├── thresholds-from-benchmark-output.sh
│ └── update-integration-test-thresholds.sh
├── docs/
│ ├── advanced-performance-analysis.md
│ ├── debugging-allocations.md
│ ├── io_uring.md
│ ├── migration-guide-NIO1-to-NIO2.md
│ ├── optimization-tips.md
│ ├── public-api.md
│ ├── public-async-nio-apis.md
│ └── workarounds.md
└── scripts/
├── analyze_performance_results.rb
├── bench-alloc-counter.sh
├── check-cxx-interop-compatibility.sh
├── check-matrix-job.ps1
├── check-matrix-job.sh
├── check_benchmark_thresholds.sh
├── cmake-build.sh
├── compare_perf_of_swift_versions.sh
├── generate_matrix.sh
├── install_android_ndk.sh
├── install_swift_prerequisites.sh
├── install_swift_sdk.sh
├── integration_tests.sh
├── nio-diagnose
├── swift-build-with-android-sdk.sh
├── swift-build-with-wasm-sdk.sh
└── update-cmake-lists.sh
SYMBOL INDEX (368 symbols across 31 files)
FILE: IntegrationTests/allocation-counter-tests-framework/template/AtomicCounter/Sources/AtomicCounter/include/atomic-counter.h
type LeakedFDs (line 32) | typedef struct {
FILE: IntegrationTests/allocation-counter-tests-framework/template/AtomicCounter/Sources/AtomicCounter/src/atomic-counter.c
function MAKE_COUNTER (line 40) | MAKE_COUNTER(free)
function _Bool (line 55) | static _Bool FDTracker_search_fd(const FDTracker *tracker, int fd, size_...
function FDTracker_remove_at_index (line 70) | static void FDTracker_remove_at_index(FDTracker *tracker, size_t index) {
function begin_tracking_fds (line 86) | void begin_tracking_fds(void) {
function track_open_fd (line 102) | void track_open_fd(int fd) {
function track_closed_fd (line 130) | void track_closed_fd(int fd) {
function LeakedFDs (line 147) | LeakedFDs stop_tracking_fds(void) {
FILE: IntegrationTests/allocation-counter-tests-framework/template/HookedFunctionsDoHook/Sources/HookedFunctions/include/hooked-functions.h
type sockaddr (line 33) | struct sockaddr
type sockaddr (line 34) | struct sockaddr
FILE: IntegrationTests/allocation-counter-tests-framework/template/HookedFunctionsDoHook/Sources/HookedFunctions/src/hooked-functions-darwin.c
function replacement_malloc_zone_free (line 125) | void replacement_malloc_zone_free(malloc_zone_t *zone, void *ptr) {
function replacement_posix_memalign (line 146) | int replacement_posix_memalign(void **memptr, size_t alignment, size_t s...
function replacement_socket (line 153) | int replacement_socket(int domain, int type, int protocol) {
function replacement_accept (line 163) | int replacement_accept(int socket, struct sockaddr *restrict address, so...
function replacement_accept4 (line 174) | int replacement_accept4(int sockfd, struct sockaddr *addr, socklen_t *ad...
function replacement_close (line 179) | int replacement_close(int fildes) {
FILE: IntegrationTests/allocation-counter-tests-framework/template/HookedFunctionsDoHook/Sources/HookedFunctions/src/hooked-functions-unix.c
type sockaddr (line 54) | struct sockaddr
type sockaddr (line 55) | struct sockaddr
function is_recursive_malloc_block (line 88) | static bool is_recursive_malloc_block(void *ptr) {
function recursive_free (line 103) | static void recursive_free(void *ptr) {
function recursive_socket (line 109) | static int recursive_socket(int domain, int type, int protocol) {
function recursive_accept (line 115) | static int recursive_accept(int socket, struct sockaddr *restrict addres...
function recursive_accept4 (line 121) | static int recursive_accept4(int sockfd, struct sockaddr *addr, socklen_...
function recursive_close (line 127) | static int recursive_close(int fildes) {
function replacement_posix_memalign (line 220) | int replacement_posix_memalign(void **memptr, size_t alignment, size_t s...
function socket_thunk (line 231) | static int socket_thunk(int domain, int type, int protocol) {
function replacement_socket (line 235) | int replacement_socket(int domain, int type, int protocol) {
function accept_thunk (line 245) | static int accept_thunk(int socket, struct sockaddr *restrict address, s...
function replacement_accept (line 249) | int replacement_accept(int socket, struct sockaddr *restrict address, so...
function accept4_thunk (line 260) | static int accept4_thunk(int sockfd, struct sockaddr *addr, socklen_t *a...
function replacement_accept4 (line 264) | int replacement_accept4(int sockfd, struct sockaddr *addr, socklen_t *ad...
function replacement_close (line 275) | int replacement_close(int fildes) {
FILE: IntegrationTests/allocation-counter-tests-framework/template/Sources/bootstrapDoHook/main.c
function free (line 23) | void free(void *ptr) {
function posix_memalign (line 41) | int posix_memalign(void **memptr, size_t alignment, size_t size) {
function socket (line 44) | int socket(int domain, int type, int protocol) {
function accept (line 47) | int accept(int socket, struct sockaddr *restrict address, socklen_t *res...
function accept4 (line 50) | int accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int f...
function close (line 53) | int close(int fildes) {
function main (line 60) | int main() {
FILE: IntegrationTests/allocation-counter-tests-framework/template/Sources/bootstrapDoNotHook/main.c
function main (line 17) | int main() {
FILE: Sources/CNIOAtomics/src/c-atomics.c
type catmc_atomic_ (line 29) | struct catmc_atomic_
type signed_char (line 64) | typedef signed char signed_char;
type signed_short (line 65) | typedef signed short signed_short;
type signed_int (line 66) | typedef signed int signed_int;
type signed_long (line 67) | typedef signed long signed_long;
type signed_long_long (line 68) | typedef signed long long signed_long_long;
type unsigned_char (line 69) | typedef unsigned char unsigned_char;
type unsigned_short (line 70) | typedef unsigned short unsigned_short;
type unsigned_int (line 71) | typedef unsigned int unsigned_int;
type unsigned_long (line 72) | typedef unsigned long unsigned_long;
type unsigned_long_long (line 73) | typedef unsigned long long unsigned_long_long;
type long_long (line 74) | typedef long long long_long;
FILE: Sources/CNIOAtomics/src/c-nioatomics.c
type signed_char (line 54) | typedef signed char signed_char;
type signed_short (line 55) | typedef signed short signed_short;
type signed_int (line 56) | typedef signed int signed_int;
type signed_long (line 57) | typedef signed long signed_long;
type signed_long_long (line 58) | typedef signed long long signed_long_long;
type unsigned_char (line 59) | typedef unsigned char unsigned_char;
type unsigned_short (line 60) | typedef unsigned short unsigned_short;
type unsigned_int (line 61) | typedef unsigned int unsigned_int;
type unsigned_long (line 62) | typedef unsigned long unsigned_long;
type unsigned_long_long (line 63) | typedef unsigned long long unsigned_long_long;
type long_long (line 64) | typedef long long long_long;
FILE: Sources/CNIODarwin/include/CNIODarwin.h
type CNIODarwin_mmsghdr (line 39) | typedef struct {
type timespec (line 53) | struct timespec
type cmsghdr (line 56) | struct cmsghdr
type msghdr (line 56) | struct msghdr
type cmsghdr (line 57) | struct cmsghdr
type msghdr (line 57) | struct msghdr
type cmsghdr (line 57) | struct cmsghdr
type cmsghdr (line 58) | struct cmsghdr
type cmsghdr (line 59) | struct cmsghdr
type dirent (line 65) | struct dirent
FILE: Sources/CNIODarwin/shim.c
function CNIODarwin_sendmmsg (line 26) | int CNIODarwin_sendmmsg(int sockfd, CNIODarwin_mmsghdr *msgvec, unsigned...
function CNIODarwin_recvmmsg (line 53) | int CNIODarwin_recvmmsg(int sockfd, CNIODarwin_mmsghdr *msgvec, unsigned...
type cmsghdr (line 57) | struct cmsghdr
type msghdr (line 57) | struct msghdr
type cmsghdr (line 62) | struct cmsghdr
type msghdr (line 62) | struct msghdr
type cmsghdr (line 62) | struct cmsghdr
type cmsghdr (line 68) | struct cmsghdr
type cmsghdr (line 73) | struct cmsghdr
function CNIODarwin_CMSG_LEN (line 78) | size_t CNIODarwin_CMSG_LEN(size_t payloadSizeBytes) {
function CNIODarwin_CMSG_SPACE (line 82) | size_t CNIODarwin_CMSG_SPACE(size_t payloadSizeBytes) {
type dirent (line 96) | struct dirent
FILE: Sources/CNIOLLHTTP/c_nio_api.c
function c_nio_llhttp_init (line 36) | void c_nio_llhttp_init(llhttp_t* parser, llhttp_type_t type,
function wasm_on_headers_complete_wrap (line 57) | static int wasm_on_headers_complete_wrap(llhttp_t* p) {
function llhttp_t (line 74) | llhttp_t* llhttp_alloc(llhttp_type_t type) {
function llhttp_free (line 80) | void llhttp_free(llhttp_t* parser) {
function c_nio_llhttp_get_type (line 88) | uint8_t c_nio_llhttp_get_type(llhttp_t* parser) {
function c_nio_llhttp_get_http_major (line 92) | uint8_t c_nio_llhttp_get_http_major(llhttp_t* parser) {
function c_nio_llhttp_get_http_minor (line 96) | uint8_t c_nio_llhttp_get_http_minor(llhttp_t* parser) {
function c_nio_llhttp_get_method (line 100) | uint8_t c_nio_llhttp_get_method(llhttp_t* parser) {
function c_nio_llhttp_get_status_code (line 104) | int c_nio_llhttp_get_status_code(llhttp_t* parser) {
function c_nio_llhttp_get_upgrade (line 108) | uint8_t c_nio_llhttp_get_upgrade(llhttp_t* parser) {
function c_nio_llhttp_reset (line 113) | void c_nio_llhttp_reset(llhttp_t* parser) {
function llhttp_errno_t (line 128) | llhttp_errno_t c_nio_llhttp_execute(llhttp_t* parser, const char* data, ...
function c_nio_llhttp_settings_init (line 133) | void c_nio_llhttp_settings_init(llhttp_settings_t* settings) {
function llhttp_errno_t (line 138) | llhttp_errno_t c_nio_llhttp_finish(llhttp_t* parser) {
function c_nio_llhttp_pause (line 163) | void c_nio_llhttp_pause(llhttp_t* parser) {
function c_nio_llhttp_resume (line 173) | void c_nio_llhttp_resume(llhttp_t* parser) {
function c_nio_llhttp_resume_after_upgrade (line 182) | void c_nio_llhttp_resume_after_upgrade(llhttp_t* parser) {
function llhttp_errno_t (line 191) | llhttp_errno_t c_nio_llhttp_get_errno(const llhttp_t* parser) {
function c_nio_llhttp_set_error_reason (line 201) | void c_nio_llhttp_set_error_reason(llhttp_t* parser, const char* reason) {
function c_nio_llhttp_set_lenient_headers (line 240) | void c_nio_llhttp_set_lenient_headers(llhttp_t* parser, int enabled) {
function c_nio_llhttp_set_lenient_chunked_length (line 249) | void c_nio_llhttp_set_lenient_chunked_length(llhttp_t* parser, int enabl...
function c_nio_llhttp_set_lenient_keep_alive (line 258) | void c_nio_llhttp_set_lenient_keep_alive(llhttp_t* parser, int enabled) {
function c_nio_llhttp_set_lenient_transfer_encoding (line 266) | void c_nio_llhttp_set_lenient_transfer_encoding(llhttp_t* parser, int en...
function c_nio_llhttp_set_lenient_version (line 274) | void c_nio_llhttp_set_lenient_version(llhttp_t* parser, int enabled) {
function c_nio_llhttp_set_lenient_data_after_close (line 282) | void c_nio_llhttp_set_lenient_data_after_close(llhttp_t* parser, int ena...
function c_nio_llhttp_set_lenient_optional_lf_after_cr (line 290) | void c_nio_llhttp_set_lenient_optional_lf_after_cr(llhttp_t* parser, int...
function c_nio_llhttp_set_lenient_optional_crlf_after_chunk (line 298) | void c_nio_llhttp_set_lenient_optional_crlf_after_chunk(llhttp_t* parser...
function c_nio_llhttp_set_lenient_optional_cr_before_lf (line 306) | void c_nio_llhttp_set_lenient_optional_cr_before_lf(llhttp_t* parser, in...
function c_nio_llhttp_set_lenient_spaces_after_chunk_size (line 314) | void c_nio_llhttp_set_lenient_spaces_after_chunk_size(llhttp_t* parser, ...
function c_nio_llhttp__on_message_begin (line 325) | int c_nio_llhttp__on_message_begin(llhttp_t* s, const char* p, const cha...
function c_nio_llhttp__on_protocol (line 332) | int c_nio_llhttp__on_protocol(llhttp_t* s, const char* p, const char* en...
function c_nio_llhttp__on_protocol_complete (line 339) | int c_nio_llhttp__on_protocol_complete(llhttp_t* s, const char* p, const...
function c_nio_llhttp__on_url (line 346) | int c_nio_llhttp__on_url(llhttp_t* s, const char* p, const char* endp) {
function c_nio_llhttp__on_url_complete (line 353) | int c_nio_llhttp__on_url_complete(llhttp_t* s, const char* p, const char...
function c_nio_llhttp__on_status (line 360) | int c_nio_llhttp__on_status(llhttp_t* s, const char* p, const char* endp) {
function c_nio_llhttp__on_status_complete (line 367) | int c_nio_llhttp__on_status_complete(llhttp_t* s, const char* p, const c...
function c_nio_llhttp__on_method (line 374) | int c_nio_llhttp__on_method(llhttp_t* s, const char* p, const char* endp) {
function c_nio_llhttp__on_method_complete (line 381) | int c_nio_llhttp__on_method_complete(llhttp_t* s, const char* p, const c...
function c_nio_llhttp__on_version (line 388) | int c_nio_llhttp__on_version(llhttp_t* s, const char* p, const char* end...
function c_nio_llhttp__on_version_complete (line 395) | int c_nio_llhttp__on_version_complete(llhttp_t* s, const char* p, const ...
function c_nio_llhttp__on_header_field (line 402) | int c_nio_llhttp__on_header_field(llhttp_t* s, const char* p, const char...
function c_nio_llhttp__on_header_field_complete (line 409) | int c_nio_llhttp__on_header_field_complete(llhttp_t* s, const char* p, c...
function c_nio_llhttp__on_header_value (line 416) | int c_nio_llhttp__on_header_value(llhttp_t* s, const char* p, const char...
function c_nio_llhttp__on_header_value_complete (line 423) | int c_nio_llhttp__on_header_value_complete(llhttp_t* s, const char* p, c...
function c_nio_llhttp__on_headers_complete (line 430) | int c_nio_llhttp__on_headers_complete(llhttp_t* s, const char* p, const ...
function c_nio_llhttp__on_message_complete (line 437) | int c_nio_llhttp__on_message_complete(llhttp_t* s, const char* p, const ...
function c_nio_llhttp__on_body (line 444) | int c_nio_llhttp__on_body(llhttp_t* s, const char* p, const char* endp) {
function c_nio_llhttp__on_chunk_header (line 451) | int c_nio_llhttp__on_chunk_header(llhttp_t* s, const char* p, const char...
function c_nio_llhttp__on_chunk_extension_name (line 458) | int c_nio_llhttp__on_chunk_extension_name(llhttp_t* s, const char* p, co...
function c_nio_llhttp__on_chunk_extension_name_complete (line 465) | int c_nio_llhttp__on_chunk_extension_name_complete(llhttp_t* s, const ch...
function c_nio_llhttp__on_chunk_extension_value (line 472) | int c_nio_llhttp__on_chunk_extension_value(llhttp_t* s, const char* p, c...
function c_nio_llhttp__on_chunk_extension_value_complete (line 479) | int c_nio_llhttp__on_chunk_extension_value_complete(llhttp_t* s, const c...
function c_nio_llhttp__on_chunk_complete (line 486) | int c_nio_llhttp__on_chunk_complete(llhttp_t* s, const char* p, const ch...
function c_nio_llhttp__on_reset (line 493) | int c_nio_llhttp__on_reset(llhttp_t* s, const char* p, const char* endp) {
function c_nio_llhttp__debug (line 503) | void c_nio_llhttp__debug(llhttp_t* s, const char* p, const char* endp,
FILE: Sources/CNIOLLHTTP/c_nio_http.c
function c_nio_llhttp__before_headers_complete (line 14) | int c_nio_llhttp__before_headers_complete(llhttp_t* parser, const char* p,
function c_nio_llhttp__after_headers_complete (line 40) | int c_nio_llhttp__after_headers_complete(llhttp_t* parser, const char* p,
function c_nio_llhttp__after_message_complete (line 119) | int c_nio_llhttp__after_message_complete(llhttp_t* parser, const char* p,
function c_nio_llhttp_message_needs_eof (line 132) | int c_nio_llhttp_message_needs_eof(const llhttp_t* parser) {
function c_nio_llhttp_should_keep_alive (line 159) | int c_nio_llhttp_should_keep_alive(const llhttp_t* parser) {
FILE: Sources/CNIOLLHTTP/c_nio_llhttp.c
type llparse_match_status_e (line 238) | enum llparse_match_status_e {
type llparse_match_status_t (line 243) | typedef enum llparse_match_status_e llparse_match_status_t;
type llparse_match_s (line 245) | struct llparse_match_s {
type llparse_match_t (line 249) | typedef struct llparse_match_s llparse_match_t;
function llparse_match_t (line 251) | static llparse_match_t llparse__match_sequence_to_lower(
function llparse_match_t (line 283) | static llparse_match_t llparse__match_sequence_to_lower_unsafe(
function llparse_match_t (line 315) | static llparse_match_t llparse__match_sequence_id(
type llparse_state_e (line 347) | enum llparse_state_e {
type llparse_state_t (line 603) | typedef enum llparse_state_e llparse_state_t;
function c_nio_llhttp__internal__c_load_initial_message_completed (line 645) | int c_nio_llhttp__internal__c_load_initial_message_completed(
function c_nio_llhttp__internal__c_update_finish (line 656) | int c_nio_llhttp__internal__c_update_finish(
function c_nio_llhttp__internal__c_load_type (line 668) | int c_nio_llhttp__internal__c_load_type(
function c_nio_llhttp__internal__c_store_method (line 675) | int c_nio_llhttp__internal__c_store_method(
function c_nio_llhttp__internal__c_is_equal_method (line 688) | int c_nio_llhttp__internal__c_is_equal_method(
function c_nio_llhttp__internal__c_update_http_major (line 695) | int c_nio_llhttp__internal__c_update_http_major(
function c_nio_llhttp__internal__c_update_http_minor (line 703) | int c_nio_llhttp__internal__c_update_http_minor(
function c_nio_llhttp__internal__c_test_lenient_flags (line 715) | int c_nio_llhttp__internal__c_test_lenient_flags(
function c_nio_llhttp__internal__c_test_lenient_flags_1 (line 722) | int c_nio_llhttp__internal__c_test_lenient_flags_1(
function c_nio_llhttp__internal__c_test_flags (line 729) | int c_nio_llhttp__internal__c_test_flags(
function c_nio_llhttp__internal__c_is_equal_upgrade (line 744) | int c_nio_llhttp__internal__c_is_equal_upgrade(
function c_nio_llhttp__internal__c_update_content_length (line 755) | int c_nio_llhttp__internal__c_update_content_length(
function c_nio_llhttp__internal__c_update_initial_message_completed (line 763) | int c_nio_llhttp__internal__c_update_initial_message_completed(
function c_nio_llhttp__internal__c_update_finish_1 (line 771) | int c_nio_llhttp__internal__c_update_finish_1(
function c_nio_llhttp__internal__c_test_lenient_flags_2 (line 779) | int c_nio_llhttp__internal__c_test_lenient_flags_2(
function c_nio_llhttp__internal__c_test_lenient_flags_3 (line 786) | int c_nio_llhttp__internal__c_test_lenient_flags_3(
function c_nio_llhttp__internal__c_mul_add_content_length (line 805) | int c_nio_llhttp__internal__c_mul_add_content_length(
function c_nio_llhttp__internal__c_test_lenient_flags_4 (line 831) | int c_nio_llhttp__internal__c_test_lenient_flags_4(
function c_nio_llhttp__internal__c_is_equal_content_length (line 842) | int c_nio_llhttp__internal__c_is_equal_content_length(
function c_nio_llhttp__internal__c_test_lenient_flags_7 (line 849) | int c_nio_llhttp__internal__c_test_lenient_flags_7(
function c_nio_llhttp__internal__c_or_flags (line 856) | int c_nio_llhttp__internal__c_or_flags(
function c_nio_llhttp__internal__c_test_lenient_flags_8 (line 864) | int c_nio_llhttp__internal__c_test_lenient_flags_8(
function c_nio_llhttp__internal__c_update_finish_3 (line 879) | int c_nio_llhttp__internal__c_update_finish_3(
function c_nio_llhttp__internal__c_or_flags_1 (line 887) | int c_nio_llhttp__internal__c_or_flags_1(
function c_nio_llhttp__internal__c_update_upgrade (line 895) | int c_nio_llhttp__internal__c_update_upgrade(
function c_nio_llhttp__internal__c_store_header_state (line 903) | int c_nio_llhttp__internal__c_store_header_state(
function c_nio_llhttp__internal__c_load_header_state (line 916) | int c_nio_llhttp__internal__c_load_header_state(
function c_nio_llhttp__internal__c_test_flags_4 (line 923) | int c_nio_llhttp__internal__c_test_flags_4(
function c_nio_llhttp__internal__c_test_lenient_flags_22 (line 930) | int c_nio_llhttp__internal__c_test_lenient_flags_22(
function c_nio_llhttp__internal__c_or_flags_5 (line 937) | int c_nio_llhttp__internal__c_or_flags_5(
function c_nio_llhttp__internal__c_update_header_state (line 945) | int c_nio_llhttp__internal__c_update_header_state(
function c_nio_llhttp__internal__c_or_flags_6 (line 957) | int c_nio_llhttp__internal__c_or_flags_6(
function c_nio_llhttp__internal__c_or_flags_7 (line 965) | int c_nio_llhttp__internal__c_or_flags_7(
function c_nio_llhttp__internal__c_or_flags_8 (line 973) | int c_nio_llhttp__internal__c_or_flags_8(
function c_nio_llhttp__internal__c_update_header_state_3 (line 981) | int c_nio_llhttp__internal__c_update_header_state_3(
function c_nio_llhttp__internal__c_update_header_state_1 (line 989) | int c_nio_llhttp__internal__c_update_header_state_1(
function c_nio_llhttp__internal__c_update_header_state_6 (line 997) | int c_nio_llhttp__internal__c_update_header_state_6(
function c_nio_llhttp__internal__c_update_header_state_7 (line 1005) | int c_nio_llhttp__internal__c_update_header_state_7(
function c_nio_llhttp__internal__c_test_flags_2 (line 1013) | int c_nio_llhttp__internal__c_test_flags_2(
function c_nio_llhttp__internal__c_mul_add_content_length_1 (line 1020) | int c_nio_llhttp__internal__c_mul_add_content_length_1(
function c_nio_llhttp__internal__c_or_flags_17 (line 1046) | int c_nio_llhttp__internal__c_or_flags_17(
function c_nio_llhttp__internal__c_test_flags_3 (line 1054) | int c_nio_llhttp__internal__c_test_flags_3(
function c_nio_llhttp__internal__c_test_lenient_flags_20 (line 1061) | int c_nio_llhttp__internal__c_test_lenient_flags_20(
function c_nio_llhttp__internal__c_or_flags_18 (line 1068) | int c_nio_llhttp__internal__c_or_flags_18(
function c_nio_llhttp__internal__c_and_flags (line 1076) | int c_nio_llhttp__internal__c_and_flags(
function c_nio_llhttp__internal__c_update_header_state_8 (line 1084) | int c_nio_llhttp__internal__c_update_header_state_8(
function c_nio_llhttp__internal__c_or_flags_20 (line 1092) | int c_nio_llhttp__internal__c_or_flags_20(
function c_nio_llhttp__internal__c_load_method (line 1104) | int c_nio_llhttp__internal__c_load_method(
function c_nio_llhttp__internal__c_store_http_major (line 1111) | int c_nio_llhttp__internal__c_store_http_major(
function c_nio_llhttp__internal__c_store_http_minor (line 1120) | int c_nio_llhttp__internal__c_store_http_minor(
function c_nio_llhttp__internal__c_test_lenient_flags_24 (line 1129) | int c_nio_llhttp__internal__c_test_lenient_flags_24(
function c_nio_llhttp__internal__c_load_http_major (line 1140) | int c_nio_llhttp__internal__c_load_http_major(
function c_nio_llhttp__internal__c_load_http_minor (line 1147) | int c_nio_llhttp__internal__c_load_http_minor(
function c_nio_llhttp__internal__c_update_status_code (line 1154) | int c_nio_llhttp__internal__c_update_status_code(
function c_nio_llhttp__internal__c_mul_add_status_code (line 1162) | int c_nio_llhttp__internal__c_mul_add_status_code(
function c_nio_llhttp__internal__c_update_type (line 1192) | int c_nio_llhttp__internal__c_update_type(
function c_nio_llhttp__internal__c_update_type_1 (line 1200) | int c_nio_llhttp__internal__c_update_type_1(
function c_nio_llhttp__internal_init (line 1208) | int c_nio_llhttp__internal_init(c_nio_llhttp__internal_t* state) {
function llparse_state_t (line 1214) | static llparse_state_t c_nio_llhttp__internal__run(
function c_nio_llhttp__internal_execute (line 10070) | int c_nio_llhttp__internal_execute(c_nio_llhttp__internal_t* state, cons...
FILE: Sources/CNIOLLHTTP/include/CNIOLLHTTP.h
function llhttp_errno_t (line 22) | static inline llhttp_errno_t c_nio_llhttp_execute_swift(llhttp_t *parser,
FILE: Sources/CNIOLLHTTP/include/c_nio_llhttp.h
type c_nio_llhttp__internal_t (line 25) | typedef struct c_nio_llhttp__internal_s c_nio_llhttp__internal_t;
type c_nio_llhttp__internal_s (line 26) | struct c_nio_llhttp__internal_s {
type llhttp_errno (line 65) | enum llhttp_errno {
type llhttp_errno_t (line 104) | typedef enum llhttp_errno llhttp_errno_t;
type llhttp_flags (line 106) | enum llhttp_flags {
type llhttp_flags_t (line 117) | typedef enum llhttp_flags llhttp_flags_t;
type llhttp_lenient_flags (line 119) | enum llhttp_lenient_flags {
type llhttp_lenient_flags_t (line 131) | typedef enum llhttp_lenient_flags llhttp_lenient_flags_t;
type llhttp_type (line 133) | enum llhttp_type {
type llhttp_type_t (line 138) | typedef enum llhttp_type llhttp_type_t;
type c_nio_llhttp_finish (line 140) | enum c_nio_llhttp_finish {
type c_nio_llhttp_finish_t (line 145) | typedef enum c_nio_llhttp_finish c_nio_llhttp_finish_t;
type llhttp_method (line 147) | enum llhttp_method {
type llhttp_method_t (line 196) | typedef enum llhttp_method llhttp_method_t;
type llhttp_status (line 198) | enum llhttp_status {
type llhttp_status_t (line 299) | typedef enum llhttp_status llhttp_status_t;
type c_nio_llhttp__internal_t (line 569) | typedef c_nio_llhttp__internal_t llhttp_t;
type llhttp_settings_t (line 570) | typedef struct llhttp_settings_s llhttp_settings_t;
type llhttp_settings_s (line 575) | struct llhttp_settings_s {
FILE: Sources/CNIOLinux/include/CNIOLinux.h
type mptcp_info (line 61) | struct mptcp_info {
type CNIOLinux_mmsghdr (line 96) | typedef struct {
type CNIOLinux_in6_pktinfo (line 101) | typedef struct {
type timespec (line 107) | struct timespec
type sockaddr (line 113) | struct sockaddr
type cmsghdr (line 124) | struct cmsghdr
type msghdr (line 124) | struct msghdr
type cmsghdr (line 125) | struct cmsghdr
type msghdr (line 125) | struct msghdr
type cmsghdr (line 125) | struct cmsghdr
type cmsghdr (line 126) | struct cmsghdr
type cmsghdr (line 127) | struct cmsghdr
type utsname (line 138) | struct utsname
type dirent (line 142) | struct dirent
type f_type_t (line 157) | typedef uint64_t f_type_t;
type f_type_t (line 159) | typedef uint32_t f_type_t;
type __fsword_t (line 163) | typedef __fsword_t f_type_t;
type f_type_t (line 165) | typedef unsigned long f_type_t;
FILE: Sources/CNIOLinux/include/liburing_nio.h
type io_uring_sqe (line 29) | struct io_uring_sqe
FILE: Sources/CNIOLinux/liburing_shims.c
function CNIOLinux_i_do_nothing_just_working_around_a_darwin_toolchain_bug2 (line 20) | void CNIOLinux_i_do_nothing_just_working_around_a_darwin_toolchain_bug2(...
function CNIOLinux_io_uring_set_link_flag (line 31) | void CNIOLinux_io_uring_set_link_flag(struct io_uring_sqe *sqe)
function CNIOLinux_POLLRDHUP (line 37) | unsigned int CNIOLinux_POLLRDHUP()
FILE: Sources/CNIOLinux/shim.c
function CNIOLinux_i_do_nothing_just_working_around_a_darwin_toolchain_bug (line 17) | void CNIOLinux_i_do_nothing_just_working_around_a_darwin_toolchain_bug(v...
type mmsghdr (line 38) | struct mmsghdr
type in6_pktinfo (line 41) | struct in6_pktinfo
function CNIOLinux_sendmmsg (line 44) | int CNIOLinux_sendmmsg(int sockfd, CNIOLinux_mmsghdr *msgvec, unsigned i...
function CNIOLinux_recvmmsg (line 50) | int CNIOLinux_recvmmsg(int sockfd, CNIOLinux_mmsghdr *msgvec, unsigned i...
function CNIOLinux_accept4 (line 56) | int CNIOLinux_accept4(int sockfd, struct sockaddr *addr, socklen_t *addr...
function CNIOLinux_pthread_setname_np (line 60) | int CNIOLinux_pthread_setname_np(pthread_t thread, const char *name) {
function CNIOLinux_pthread_getname_np (line 64) | int CNIOLinux_pthread_getname_np(pthread_t thread, char *name, size_t le...
function CNIOLinux_pthread_setaffinity_np (line 97) | int CNIOLinux_pthread_setaffinity_np(pthread_t thread, size_t cpusetsize...
function CNIOLinux_pthread_getaffinity_np (line 105) | int CNIOLinux_pthread_getaffinity_np(pthread_t thread, size_t cpusetsize...
function CNIOLinux_CPU_SET (line 113) | void CNIOLinux_CPU_SET(int cpu, cpu_set_t *set) {
function CNIOLinux_CPU_ZERO (line 117) | void CNIOLinux_CPU_ZERO(cpu_set_t *set) {
function CNIOLinux_CPU_ISSET (line 121) | int CNIOLinux_CPU_ISSET(int cpu, cpu_set_t *set) {
function CNIOLinux_CPU_SETSIZE (line 125) | int CNIOLinux_CPU_SETSIZE() {
type cmsghdr (line 129) | struct cmsghdr
type msghdr (line 129) | struct msghdr
type cmsghdr (line 134) | struct cmsghdr
type msghdr (line 134) | struct msghdr
type cmsghdr (line 134) | struct cmsghdr
type cmsghdr (line 140) | struct cmsghdr
type cmsghdr (line 145) | struct cmsghdr
function CNIOLinux_CMSG_LEN (line 150) | size_t CNIOLinux_CMSG_LEN(size_t payloadSizeBytes) {
function CNIOLinux_CMSG_SPACE (line 154) | size_t CNIOLinux_CMSG_SPACE(size_t payloadSizeBytes) {
function supports_udp_sockopt (line 161) | bool supports_udp_sockopt(int opt, int value) {
function CNIOLinux_supports_udp_segment (line 171) | bool CNIOLinux_supports_udp_segment() {
function CNIOLinux_supports_udp_gro (line 179) | bool CNIOLinux_supports_udp_gro() {
function CNIOLinux_system_info (line 187) | int CNIOLinux_system_info(struct utsname* uname_data) {
type dirent (line 193) | struct dirent
function CNIOLinux_renameat2 (line 197) | int CNIOLinux_renameat2(int oldfd, const char* old, int newfd, const cha...
function f_type_t (line 228) | f_type_t CNIOLinux_statfs_ftype(const char *path) {
function FTS (line 237) | FTS *CNIOLinux_fts_open(char * const *path_argv, int options, int (*comp...
FILE: Sources/CNIOOpenBSD/include/CNIOOpenBSD.h
type CNIOOpenBSD_mmsghdr (line 54) | typedef struct {
type CNIOOpenBSD_in6_pktinfo (line 59) | typedef struct {
type timespec (line 65) | struct timespec
type sockaddr (line 71) | struct sockaddr
type cmsghdr (line 74) | struct cmsghdr
type msghdr (line 74) | struct msghdr
type cmsghdr (line 75) | struct cmsghdr
type msghdr (line 75) | struct msghdr
type cmsghdr (line 75) | struct cmsghdr
type cmsghdr (line 76) | struct cmsghdr
type cmsghdr (line 77) | struct cmsghdr
type utsname (line 85) | struct utsname
type dirent (line 89) | struct dirent
FILE: Sources/CNIOOpenBSD/shim.c
function CNIOOpenBSD_i_do_nothing_just_working_around_a_darwin_toolchain_bug (line 17) | void CNIOOpenBSD_i_do_nothing_just_working_around_a_darwin_toolchain_bug...
function CNIOOpenBSD_pthread_set_name_np (line 26) | int CNIOOpenBSD_pthread_set_name_np(pthread_t thread, const char *name) {
function CNIOOpenBSD_pthread_get_name_np (line 31) | int CNIOOpenBSD_pthread_get_name_np(pthread_t thread, char *name, size_t...
function CNIOOpenBSD_sendmmsg (line 36) | int CNIOOpenBSD_sendmmsg(int sockfd, CNIOOpenBSD_mmsghdr *msgvec, unsign...
function CNIOOpenBSD_recvmmsg (line 43) | int CNIOOpenBSD_recvmmsg(int sockfd, CNIOOpenBSD_mmsghdr *msgvec, unsign...
function CNIOOpenBSD_accept4 (line 50) | int CNIOOpenBSD_accept4(int sockfd, struct sockaddr *addr, socklen_t *ad...
type cmsghdr (line 54) | struct cmsghdr
type msghdr (line 54) | struct msghdr
type cmsghdr (line 59) | struct cmsghdr
type msghdr (line 59) | struct msghdr
type cmsghdr (line 59) | struct cmsghdr
type cmsghdr (line 65) | struct cmsghdr
type cmsghdr (line 70) | struct cmsghdr
function CNIOOpenBSD_CMSG_LEN (line 75) | size_t CNIOOpenBSD_CMSG_LEN(size_t payloadSizeBytes) {
function CNIOOpenBSD_CMSG_SPACE (line 79) | size_t CNIOOpenBSD_CMSG_SPACE(size_t payloadSizeBytes) {
function supports_udp_sockopt (line 86) | bool supports_udp_sockopt(int opt, int value) {
function CNIOOpenBSD_supports_udp_segment (line 96) | bool CNIOOpenBSD_supports_udp_segment() {
function CNIOOpenBSD_supports_udp_gro (line 104) | bool CNIOOpenBSD_supports_udp_gro() {
function CNIOOpenBSD_system_info (line 112) | int CNIOOpenBSD_system_info(struct utsname* uname_data) {
type dirent (line 116) | struct dirent
function FTS (line 128) | FTS *CNIOOpenBSD_fts_open(char * const *path_argv, int options, int (*co...
FILE: Sources/CNIOPosix/include/CNIOPosix.h
function c_nio_posix_get_el_id (line 21) | static inline uintptr_t c_nio_posix_get_el_id(void) {
function c_nio_posix_set_el_id (line 25) | static inline void c_nio_posix_set_el_id(uintptr_t id) {
function c_nio_posix_set_el_ptr (line 35) | static inline void c_nio_posix_set_el_ptr(void *id) {
FILE: Sources/CNIOSHA1/c_nio_sha1.c
type sha1_ctxt (line 116) | struct sha1_ctxt
function sha1_step (line 118) | static void
function c_nio_sha1_init (line 202) | void
function c_nio_sha1_pad (line 213) | void
function c_nio_sha1_loop (line 247) | void
function c_nio_sha1_result (line 272) | void
FILE: Sources/CNIOSHA1/include/CNIOSHA1.h
type sha1_ctxt (line 57) | struct sha1_ctxt {
type SHA1_CTX (line 72) | typedef struct sha1_ctxt SHA1_CTX;
type sha1_ctxt (line 82) | struct sha1_ctxt
type sha1_ctxt (line 83) | struct sha1_ctxt
type sha1_ctxt (line 84) | struct sha1_ctxt
type sha1_ctxt (line 85) | struct sha1_ctxt
FILE: Sources/CNIOWASI/include/CNIOWASI.h
function CNIOWASI_gettime (line 22) | static inline void CNIOWASI_gettime(struct timespec *tv) {
function CNIOWASI_O_CREAT (line 27) | static inline int CNIOWASI_O_CREAT() {
FILE: Sources/CNIOWindows/WSAStartup.c
function NIOWSAStartup (line 21) | void NIOWSAStartup(void) {
FILE: Sources/CNIOWindows/include/CNIOWindows.h
type NIO (line 31) | struct NIO
type timespec (line 98) | struct timespec
FILE: Sources/CNIOWindows/shim.c
function CNIOWindows_sendmmsg (line 23) | int CNIOWindows_sendmmsg(SOCKET s, CNIOWindows_mmsghdr *msgvec, unsigned...
function CNIOWindows_recvmmsg (line 29) | int CNIOWindows_recvmmsg(SOCKET s, CNIOWindows_mmsghdr *msgvec,
function WSACMSGHDR (line 44) | WSACMSGHDR *CNIOWindows_CMSG_FIRSTHDR(const WSAMSG *msg) {
function WSACMSGHDR (line 48) | WSACMSGHDR *CNIOWindows_CMSG_NXTHDR(const WSAMSG *msg, LPWSACMSGHDR cmsg) {
function CNIOWindows_CMSG_LEN (line 52) | size_t CNIOWindows_CMSG_LEN(size_t length) {
function CNIOWindows_CMSG_SPACE (line 56) | size_t CNIOWindows_CMSG_SPACE(size_t length) {
function CNIOWindows_errno (line 60) | int CNIOWindows_errno(void) {
function DWORD (line 64) | DWORD CNIOWindows_FormatGetLastError(DWORD errorCode, LPSTR errorMsg) {
FILE: dev/stackdiff-dtrace.py
function put_in_dict (line 23) | def put_in_dict(path):
function total_count_for_key (line 87) | def total_count_for_key(d, key):
function total_for_dictionary (line 92) | def total_for_dictionary(d):
function extract_useful_keys (line 99) | def extract_useful_keys(d):
function print_dictionary_member (line 107) | def print_dictionary_member(d, key):
function print_dictionary_member_detail (line 115) | def print_dictionary_member_detail(d, key):
function usage (line 122) | def usage():
FILE: scripts/analyze_performance_results.rb
type Enumerable (line 19) | module Enumerable
function sum (line 20) | def sum
function mean (line 24) | def mean
function sample_variance (line 28) | def sample_variance
function standard_deviation (line 34) | def standard_deviation
function parse_results (line 39) | def parse_results(file)
function compare_results (line 58) | def compare_results(current, previous)
function print_results_markdown (line 79) | def print_results_markdown(results)
function print_results_html (line 92) | def print_results_html(results)
function print_results_csv (line 107) | def print_results_csv(results)
function print_comparison_markdown (line 112) | def print_comparison_markdown(results)
function print_comparison_html (line 120) | def print_comparison_html(results)
Condensed preview — 766 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (9,286K chars).
[
{
"path": ".editorconfig",
"chars": 130,
"preview": "root = true\n\n[*]\nindent_style = space\nindent_size = 4\nend_of_line = lf\ninsert_final_newline = true\ntrim_trailing_whitesp"
},
{
"path": ".git-blame-ignore-revs",
"chars": 62,
"preview": "# Adopt swift-format\nc9756e108351a1def2e2c83ff5ee6fb9bcbc3bbf\n"
},
{
"path": ".gitattributes",
"chars": 126,
"preview": "Sources/CNIOHTTPParser/* linguist-vendored\nSources/CNIOSHA1/* linguist-vendored\nSources/CNIOLinux/ifaddrs-* linguist-ven"
},
{
"path": ".github/ISSUE_TEMPLATE/bug-report.md",
"chars": 737,
"preview": "---\nname: Bug Report\nabout: File a bug report to help us improve\n---\n\n### Expected behavior\n_[what you expected to happe"
},
{
"path": ".github/PULL_REQUEST_TEMPLATE.md",
"chars": 287,
"preview": "_[One line description of your change]_\n\n### Motivation:\n\n_[Explain here the context, and why you're making that change."
},
{
"path": ".github/actions/pull_request_semver_label_checker/action.yml",
"chars": 648,
"preview": "name: 'Pull request Semantic Version label checker'\n\ndescription: 'Checks that at least one Semantic Version label is ap"
},
{
"path": ".github/dependabot.yml",
"chars": 118,
"preview": "version: 2\nupdates:\n - package-ecosystem: \"github-actions\"\n directory: \"/\"\n schedule:\n interval: \"weekly\"\n"
},
{
"path": ".github/release.yml",
"chars": 284,
"preview": "changelog:\n categories:\n - title: SemVer Major\n labels:\n - ⚠️ semver/major\n - title: SemVer Minor\n "
},
{
"path": ".github/workflows/android_swift_sdk.yml",
"chars": 2898,
"preview": "name: Android Swift SDK\n\npermissions:\n contents: read\n\non:\n workflow_call:\n inputs:\n env_vars:\n type: s"
},
{
"path": ".github/workflows/benchmarks.yml",
"chars": 5822,
"preview": "name: Benchmarks\n\npermissions:\n contents: read\n\non:\n workflow_call:\n inputs:\n benchmark_package_path:\n "
},
{
"path": ".github/workflows/cmake_tests.yml",
"chars": 2190,
"preview": "name: CMake build\n\npermissions:\n contents: read\n\non:\n workflow_call:\n inputs:\n update_cmake_lists_config:\n "
},
{
"path": ".github/workflows/cxx_interop.yml",
"chars": 6005,
"preview": "name: Cxx interop\n\npermissions:\n contents: read\n\non:\n workflow_call:\n inputs:\n linux_5_9_enabled:\n type"
},
{
"path": ".github/workflows/macos_benchmarks.yml",
"chars": 10762,
"preview": "name: macOS benchmarks\n\npermissions:\n contents: read\n\non:\n workflow_call:\n inputs:\n benchmark_package_path:\n "
},
{
"path": ".github/workflows/macos_tests.yml",
"chars": 38104,
"preview": "name: macOS tests\n\npermissions:\n contents: read\n\non:\n workflow_call:\n inputs:\n xcode_15_4_enabled:\n typ"
},
{
"path": ".github/workflows/main.yml",
"chars": 4038,
"preview": "name: Main\n\npermissions:\n contents: read\n\non:\n push:\n branches: [main]\n schedule:\n - cron: \"0 8,20 * * *\"\n\njobs"
},
{
"path": ".github/workflows/pull_request.yml",
"chars": 4735,
"preview": "name: PR\n\npermissions:\n contents: read\n\non:\n pull_request:\n types: [opened, reopened, synchronize]\n\njobs:\n soundne"
},
{
"path": ".github/workflows/pull_request_label.yml",
"chars": 604,
"preview": "name: PR label\n\npermissions:\n contents: read\n\non:\n pull_request:\n types: [labeled, unlabeled, opened, reope"
},
{
"path": ".github/workflows/release_builds.yml",
"chars": 8645,
"preview": "name: Release builds\n\npermissions:\n contents: read\n\non:\n workflow_call:\n inputs:\n linux_5_10_enabled:\n "
},
{
"path": ".github/workflows/static_sdk.yml",
"chars": 3421,
"preview": "name: Static SDK\n\npermissions:\n contents: read\n\non:\n workflow_call:\n inputs:\n env_vars:\n type: string\n "
},
{
"path": ".github/workflows/swift_6_language_mode.yml",
"chars": 777,
"preview": "name: Swift 6 language mode\n\npermissions:\n contents: read\n\non:\n workflow_call:\n\n# We are cancelling previously trigger"
},
{
"path": ".github/workflows/swift_load_test_matrix.yml",
"chars": 1356,
"preview": "name: Matrix Load\n\npermissions:\n contents: read\n\non:\n workflow_call:\n inputs:\n name:\n type: string\n "
},
{
"path": ".github/workflows/swift_matrix.yml",
"chars": 12531,
"preview": "name: Matrix\n\npermissions:\n contents: read\n\non:\n workflow_call:\n inputs:\n name:\n type: string\n d"
},
{
"path": ".github/workflows/swift_test_matrix.yml",
"chars": 5077,
"preview": "name: Matrix\n\npermissions:\n contents: read\n\non:\n workflow_call:\n inputs:\n name:\n type: string\n d"
},
{
"path": ".github/workflows/unit_tests.yml",
"chars": 10622,
"preview": "name: Unit tests\n\npermissions:\n contents: read\n\non:\n workflow_call:\n inputs:\n linux_5_9_enabled:\n type:"
},
{
"path": ".github/workflows/wasm_swift_sdk.yml",
"chars": 2800,
"preview": "name: WebAssembly Swift SDK\n\npermissions:\n contents: read\n\non:\n workflow_call:\n inputs:\n env_vars:\n typ"
},
{
"path": ".gitignore",
"chars": 168,
"preview": ".DS_Store\n.build\n/.index-build\n/Packages\n/*.xcodeproj\nPackage.pins\n*.pem\n/docs/1.*\n/docs/2.*\nPackage.resolved\n.podspecs\n"
},
{
"path": ".licenseignore",
"chars": 931,
"preview": ".gitignore\n**/.gitignore\n.licenseignore\n.gitattributes\n.git-blame-ignore-revs\n.mailfilter\n.mailmap\n.spi.yml\n.swift-forma"
},
{
"path": ".mailfilter",
"chars": 331,
"preview": "# This is a list of `shasum` hashed email addresses which are filtered from CONTRIBUTORS.txt, typically for privacy.\n# L"
},
{
"path": ".mailmap",
"chars": 4824,
"preview": "Tomer Doron <tomerd@apple.com> <tomer.doron@gmail.com>\nTomer Doron <tomerd@apple.com>\nTomer Doron <tomerd@apple.com> tom"
},
{
"path": ".spi.yml",
"chars": 219,
"preview": "version: 1\nbuilder:\n configs:\n - documentation_targets: [NIO, NIOConcurrencyHelpers, NIOCore, NIOEmbedded, NIOFounda"
},
{
"path": ".swift-format",
"chars": 2253,
"preview": "{\n \"version\" : 1,\n \"indentation\" : {\n \"spaces\" : 4\n },\n \"tabWidth\" : 4,\n \"fileScopedDeclarationPrivacy\" : {\n "
},
{
"path": "Benchmarks/.gitignore",
"chars": 179,
"preview": ".DS_Store\n/.build\n/Packages\nxcuserdata/\nDerivedData/\n.swiftpm/configuration/registries.json\n.swiftpm/xcode/package.xcwor"
},
{
"path": "Benchmarks/Benchmarks/NIOCoreBenchmarks/Benchmarks.swift",
"chars": 10798,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "Benchmarks/Benchmarks/NIOPosixBenchmarks/Benchmarks.swift",
"chars": 6317,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "Benchmarks/Benchmarks/NIOPosixBenchmarks/NIOThreadPoolBenchmark.swift",
"chars": 813,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "Benchmarks/Benchmarks/NIOPosixBenchmarks/TCPEcho.swift",
"chars": 3117,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "Benchmarks/Benchmarks/NIOPosixBenchmarks/TCPEchoAsyncChannel.swift",
"chars": 3487,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "Benchmarks/Benchmarks/NIOPosixBenchmarks/UDPEcho.swift",
"chars": 5120,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "Benchmarks/Benchmarks/NIOPosixBenchmarks/Util/GlobalExecutor.swift",
"chars": 1192,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "Benchmarks/Package.swift",
"chars": 1311,
"preview": "// swift-tools-version:5.10\n\nimport PackageDescription\n\nlet package = Package(\n name: \"benchmarks\",\n platforms: [\n"
},
{
"path": "Benchmarks/Thresholds/5.10/NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json",
"chars": 31,
"preview": "{\n \"mallocCountTotal\" : 8000\n}"
},
{
"path": "Benchmarks/Thresholds/5.10/NIOCoreBenchmarks.WaitOnPromise.p90.json",
"chars": 54,
"preview": "{\n \"mallocCountTotal\" : 6000,\n \"memoryLeaked\" : 0\n}\n"
},
{
"path": "Benchmarks/Thresholds/5.10/NIOPosixBenchmarks.TCPEcho.p90.json",
"chars": 31,
"preview": "{\n \"mallocCountTotal\" : 108\n}\n"
},
{
"path": "Benchmarks/Thresholds/5.10/NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json",
"chars": 33,
"preview": "{\n \"mallocCountTotal\" : 164375\n}"
},
{
"path": "Benchmarks/Thresholds/6.0/NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json",
"chars": 31,
"preview": "{\n \"mallocCountTotal\" : 8000\n}"
},
{
"path": "Benchmarks/Thresholds/6.0/NIOPosixBenchmarks.TCPEcho.p90.json",
"chars": 30,
"preview": "{\n \"mallocCountTotal\": 108\n}\n"
},
{
"path": "Benchmarks/Thresholds/6.0/NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json",
"chars": 32,
"preview": "{\n \"mallocCountTotal\": 82754\n}\n"
},
{
"path": "Benchmarks/Thresholds/6.1/NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json",
"chars": 31,
"preview": "{\n \"mallocCountTotal\" : 8000\n}"
},
{
"path": "Benchmarks/Thresholds/6.1/NIOPosixBenchmarks.TCPEcho.p90.json",
"chars": 30,
"preview": "{\n \"mallocCountTotal\": 108\n}\n"
},
{
"path": "Benchmarks/Thresholds/6.1/NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json",
"chars": 32,
"preview": "{\n \"mallocCountTotal\": 82614\n}\n"
},
{
"path": "Benchmarks/Thresholds/6.2/NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json",
"chars": 31,
"preview": "{\n \"mallocCountTotal\" : 8000\n}"
},
{
"path": "Benchmarks/Thresholds/6.2/NIOPosixBenchmarks.TCPEcho.p90.json",
"chars": 30,
"preview": "{\n \"mallocCountTotal\": 603\n}\n"
},
{
"path": "Benchmarks/Thresholds/6.2/NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json",
"chars": 30,
"preview": "{\n \"mallocCountTotal\": 387\n}\n"
},
{
"path": "Benchmarks/Thresholds/nightly-main/NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json",
"chars": 31,
"preview": "{\n \"mallocCountTotal\" : 8000\n}"
},
{
"path": "Benchmarks/Thresholds/nightly-main/NIOPosixBenchmarks.TCPEcho.p90.json",
"chars": 30,
"preview": "{\n \"mallocCountTotal\": 107\n}\n"
},
{
"path": "Benchmarks/Thresholds/nightly-main/NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json",
"chars": 30,
"preview": "{\n \"mallocCountTotal\": 389\n}\n"
},
{
"path": "Benchmarks/Thresholds/nightly-next/NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json",
"chars": 31,
"preview": "{\n \"mallocCountTotal\" : 8000\n}"
},
{
"path": "Benchmarks/Thresholds/nightly-next/NIOPosixBenchmarks.TCPEcho.p90.json",
"chars": 30,
"preview": "{\n \"mallocCountTotal\": 108\n}\n"
},
{
"path": "Benchmarks/Thresholds/nightly-next/NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json",
"chars": 30,
"preview": "{\n \"mallocCountTotal\": 391\n}\n"
},
{
"path": "CODE_OF_CONDUCT.md",
"chars": 198,
"preview": "# Code of Conduct\n\nThe code of conduct for this project can be found at https://swift.org/code-of-conduct.\n\n<!-- Copyrig"
},
{
"path": "CONTRIBUTING.md",
"chars": 4998,
"preview": "## Legal\n\nBy submitting a pull request, you represent that you have the right to license\nyour contribution to Apple and "
},
{
"path": "CONTRIBUTORS.txt",
"chars": 7403,
"preview": "For the purpose of tracking copyright, this is the list of individuals and\norganizations who have contributed source cod"
},
{
"path": "IntegrationTests/allocation-counter-tests-framework/run-allocation-counter.sh",
"chars": 8192,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/allocation-counter-tests-framework/template/AtomicCounter/Package.swift",
"chars": 943,
"preview": "// swift-tools-version:5.10\n// The swift-tools-version declares the minimum version of Swift required to build this pack"
},
{
"path": "IntegrationTests/allocation-counter-tests-framework/template/AtomicCounter/Sources/AtomicCounter/include/atomic-counter.h",
"chars": 1080,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/allocation-counter-tests-framework/template/AtomicCounter/Sources/AtomicCounter/src/atomic-counter.c",
"chars": 4993,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/allocation-counter-tests-framework/template/HookedFunctionsDoHook/Package.swift",
"chars": 980,
"preview": "// swift-tools-version:5.10\n// The swift-tools-version declares the minimum version of Swift required to build this pack"
},
{
"path": "IntegrationTests/allocation-counter-tests-framework/template/HookedFunctionsDoHook/Sources/HookedFunctions/include/hooked-functions.h",
"chars": 1800,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/allocation-counter-tests-framework/template/HookedFunctionsDoHook/Sources/HookedFunctions/src/hooked-functions-darwin.c",
"chars": 5727,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/allocation-counter-tests-framework/template/HookedFunctionsDoHook/Sources/HookedFunctions/src/hooked-functions-unix.c",
"chars": 9425,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/allocation-counter-tests-framework/template/HookedFunctionsDoNotHook/Package.swift",
"chars": 980,
"preview": "// swift-tools-version:5.10\n// The swift-tools-version declares the minimum version of Swift required to build this pack"
},
{
"path": "IntegrationTests/allocation-counter-tests-framework/template/HookedFunctionsDoNotHook/Sources/HookedFunctions/include/hooked-functions.h",
"chars": 546,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/allocation-counter-tests-framework/template/HookedFunctionsDoNotHook/Sources/HookedFunctions/src/hooked-functions.c",
"chars": 497,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/allocation-counter-tests-framework/template/Sources/bootstrapDoHook/main.c",
"chars": 1764,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/allocation-counter-tests-framework/template/Sources/bootstrapDoNotHook/main.c",
"chars": 555,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/allocation-counter-tests-framework/template/scaffolding.swift",
"chars": 7961,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/plugin_echo.sh",
"chars": 1246,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/plugin_junit_xml.sh",
"chars": 3312,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/run-single-test.sh",
"chars": 1076,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/run-tests.sh",
"chars": 3733,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/test_functions.sh",
"chars": 2211,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_01_http/defines.sh",
"chars": 6024,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_01_http/test_01_get_file.sh",
"chars": 995,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_01_http/test_02_get_random_bytes.sh",
"chars": 1056,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_01_http/test_03_post_random_bytes.sh",
"chars": 913,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_01_http/test_04_keep_alive_works.sh",
"chars": 1355,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_01_http/test_05_repeated_reqs_work.sh",
"chars": 886,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_01_http/test_06_http_1.0.sh",
"chars": 899,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_01_http/test_07_headers_work.sh",
"chars": 862,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_01_http/test_08_survive_signals.sh",
"chars": 1373,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_01_http/test_09_curl_happy_with_trailers.sh",
"chars": 1187,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_01_http/test_10_connection_drop_in_body_ok.sh",
"chars": 1023,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_01_http/test_11_res_body_streaming.sh",
"chars": 1130,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_01_http/test_12_headers_too_large.sh",
"chars": 1836,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_01_http/test_13_http_pipelining.sh",
"chars": 1891,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_01_http/test_14_strict_mode_assertion.sh",
"chars": 1262,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_01_http/test_15_post_in_chunked_encoding.sh",
"chars": 965,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_01_http/test_16_tcp_client_ip.sh",
"chars": 1118,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_01_http/test_17_serve_massive_sparse_file.sh",
"chars": 1190,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_01_http/test_18_close_with_no_keepalive.sh",
"chars": 1508,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_01_http/test_19_connection_drop_while_waiting_for_response_uds.sh",
"chars": 1118,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_01_http/test_20_connection_drop_while_waiting_for_response_tcp.sh",
"chars": 989,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_01_http/test_21_connection_reset_tcp.sh",
"chars": 1270,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_01_http/test_22_http_1.0_keep_alive.sh",
"chars": 905,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_01_http/test_23_repeated_reqs_with_half_closure.sh",
"chars": 964,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_01_http/test_24_http_over_stdio.sh",
"chars": 1640,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_02_syscall_wrappers/defines.sh",
"chars": 2652,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_02_syscall_wrappers/test_01_syscall_wrapper_fast.sh",
"chars": 1494,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_02_syscall_wrappers/test_02_unacceptable_errnos.sh",
"chars": 3288,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_02_syscall_wrappers/test_03_unacceptable_read_errnos.sh",
"chars": 3749,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_03_debug_binary_checks/defines.sh",
"chars": 706,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_03_debug_binary_checks/test_01_check_we_do_not_link_Foundation.sh",
"chars": 1463,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_03_debug_binary_checks/test_02_expected_crashes_work.sh",
"chars": 652,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_04_performance/Thresholds/5.10.json",
"chars": 2567,
"preview": "{\n \"10000000_asyncsequenceproducer\": 19,\n \"1000000_asyncwriter\": 1000050,\n \"1000_addHandlers\": 44050,\n \"1000"
},
{
"path": "IntegrationTests/tests_04_performance/Thresholds/5.8.json",
"chars": 2113,
"preview": "{\n \"10000000_asyncsequenceproducer\": 20,\n \"1000000_asyncwriter\": 1000015,\n \"1000_addHandlers\": 43000,\n \"1000"
},
{
"path": "IntegrationTests/tests_04_performance/Thresholds/6.0.json",
"chars": 2567,
"preview": "{\n \"10000000_asyncsequenceproducer\": 18,\n \"1000000_asyncwriter\": 1000050,\n \"1000_addHandlers\": 46050,\n \"1000"
},
{
"path": "IntegrationTests/tests_04_performance/Thresholds/6.1.json",
"chars": 2567,
"preview": "{\n \"10000000_asyncsequenceproducer\": 18,\n \"1000000_asyncwriter\": 1000050,\n \"1000_addHandlers\": 46050,\n \"1000"
},
{
"path": "IntegrationTests/tests_04_performance/Thresholds/6.2.json",
"chars": 2567,
"preview": "{\n \"10000000_asyncsequenceproducer\": 18,\n \"1000000_asyncwriter\": 1000050,\n \"1000_addHandlers\": 46050,\n \"1000"
},
{
"path": "IntegrationTests/tests_04_performance/Thresholds/nightly-main.json",
"chars": 2567,
"preview": "{\n \"10000000_asyncsequenceproducer\": 21,\n \"1000000_asyncwriter\": 1000050,\n \"1000_addHandlers\": 46050,\n \"1000"
},
{
"path": "IntegrationTests/tests_04_performance/Thresholds/nightly-next.json",
"chars": 2567,
"preview": "{\n \"10000000_asyncsequenceproducer\": 21,\n \"1000000_asyncwriter\": 1000050,\n \"1000_addHandlers\": 46050,\n \"1000"
},
{
"path": "IntegrationTests/tests_04_performance/defines.sh",
"chars": 509,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_allocation_counts.sh",
"chars": 3836,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/README.md",
"chars": 3538,
"preview": "# Allocation Counting Test\n\nThis briefly describes how the allocation counting test works.\n\n## How does it work?\n\nThis i"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/run-nio-alloc-counter-tests.sh",
"chars": 1109,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/shared.swift",
"chars": 9827,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_10000000_asyncsequenceproducer.swift",
"chars": 1741,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_1000000_asyncwriter.swift",
"chars": 1228,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_1000_addHandlers.swift",
"chars": 1061,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_1000_addHandlers_sync.swift",
"chars": 1064,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_1000_addRemoveHandlers.swift",
"chars": 2053,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_1000_autoReadGetAndSet.swift",
"chars": 1144,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_1000_autoReadGetAndSet_sync.swift",
"chars": 1211,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_1000_copying_bytebufferview_to_array.swift",
"chars": 812,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_1000_copying_circularbuffer_to_array.swift",
"chars": 805,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_1000_getHandlers.swift",
"chars": 1057,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_1000_getHandlers_sync.swift",
"chars": 1065,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_1000_reqs_1_conn.swift",
"chars": 711,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_1000_rst_connections.swift",
"chars": 1924,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_1000_tcpbootstraps.swift",
"chars": 1212,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_1000_tcpconnections.swift",
"chars": 3151,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_1000_udp_reqs.swift",
"chars": 4329,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_1000_udpbootstraps.swift",
"chars": 1069,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_1000_udpconnections.swift",
"chars": 2600,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_1_reqs_1000_conn.swift",
"chars": 809,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_assume_isolated_scheduling_10000_executions.swift",
"chars": 1006,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_bytebuffer_lots_of_rw.swift",
"chars": 2619,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_creating_10000_headers.swift",
"chars": 830,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_decode_1000_ws_frames.swift",
"chars": 1413,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_encode_1000_ws_frames.swift",
"chars": 5332,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_execute_hop_10000_tasks.swift",
"chars": 908,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_flat_schedule_10000_tasks.swift",
"chars": 1202,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_flat_schedule_assume_isolated_10000_tasks.swift",
"chars": 1219,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_future_assume_isolated_lots_of_callbacks.swift",
"chars": 4706,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_future_erase_result.swift",
"chars": 1440,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_future_lots_of_callbacks.swift",
"chars": 4405,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_get_100000_headers_canonical_form.swift",
"chars": 1799,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_modifying_1000_circular_buffer_elements.swift",
"chars": 951,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_modifying_byte_buffer_view.swift",
"chars": 1255,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_ping_pong_1000_reqs_1_conn.swift",
"chars": 5326,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_read_10000_chunks_from_file.swift",
"chars": 2201,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_schedule_10000_tasks.swift",
"chars": 1059,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_schedule_and_run_10000_tasks.swift",
"chars": 1092,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_schedule_assume_isolated_10000_tasks.swift",
"chars": 1076,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_schedule_with_deadline_10000_tasks.swift",
"chars": 1137,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_schedule_with_deadline_assume_isolated_10000_tasks.swift",
"chars": 1189,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_scheduling_10000_executions.swift",
"chars": 989,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_submit_10000_tasks.swift",
"chars": 1077,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_submit_assume_isolated_10000_tasks.swift",
"chars": 1094,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_udp_1000_reqs_1_conn.swift",
"chars": 741,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_04_performance/test_01_resources/test_udp_1_reqs_1000_conn.swift",
"chars": 839,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "IntegrationTests/tests_05_assertions/defines.sh",
"chars": 1901,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "IntegrationTests/tests_05_assertions/test_01_syscall_wrapper_fast.sh",
"chars": 1720,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "LICENSE.txt",
"chars": 11358,
"preview": "\n Apache License\n Version 2.0, January 2004\n "
},
{
"path": "NOTICE.txt",
"chars": 3266,
"preview": "\n The SwiftNIO Project\n ====================\n\nPlease visit the Swi"
},
{
"path": "Package.swift",
"chars": 20314,
"preview": "// swift-tools-version:6.0\n//===----------------------------------------------------------------------===//\n//\n// This s"
},
{
"path": "README.md",
"chars": 30737,
"preview": "[](https://github.com/swift-server/sswg/b"
},
{
"path": "SECURITY.md",
"chars": 2646,
"preview": "# Security\n\nThis document specifies the security process for the SwiftNIO project.\n\n## Versions\n\nThe SwiftNIO core team "
},
{
"path": "Snippets/NIOFileSystemTour.swift",
"chars": 4583,
"preview": "// snippet.hide\n\nimport NIOCore\nimport _NIOFileSystem\n\n@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)\nfunc"
},
{
"path": "Sources/CNIOAtomics/include/CNIOAtomics.h",
"chars": 5214,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "Sources/CNIOAtomics/src/c-atomics.c",
"chars": 3156,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "Sources/CNIOAtomics/src/c-nioatomics.c",
"chars": 2949,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "Sources/CNIOAtomics/src/cpp_magic.h",
"chars": 16420,
"preview": "//\n// this is https://github.com/18sg/uSHET/blob/c09e0acafd86720efe42dc15c63e0cc228244c32/lib/cpp_magic.h\n// LICENSE: MI"
},
{
"path": "Sources/CNIODarwin/include/CNIODarwin.h",
"chars": 2523,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "Sources/CNIODarwin/shim.c",
"chars": 3144,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "Sources/CNIOLLHTTP/LICENSE",
"chars": 1105,
"preview": "This software is licensed under the MIT License.\n\nCopyright Fedor Indutny, 2018.\n\nPermission is hereby granted, free of "
},
{
"path": "Sources/CNIOLLHTTP/c_nio_api.c",
"chars": 13622,
"preview": "/* Additional changes for SwiftNIO:\n - prefixed all symbols by 'c_nio_'\n*/\n#include <stdlib.h>\n#include <stdio.h>\n#in"
},
{
"path": "Sources/CNIOLLHTTP/c_nio_http.c",
"chars": 5367,
"preview": "/* Additional changes for SwiftNIO:\n - prefixed all symbols by 'c_nio_'\n*/\n#include <stdio.h>\n#ifndef LLHTTP__TEST\n# "
},
{
"path": "Sources/CNIOLLHTTP/c_nio_llhttp.c",
"chars": 318327,
"preview": "/* Additional changes for SwiftNIO:\n - prefixed all symbols by 'c_nio_'\n*/\n#include <stdlib.h>\n#include <stdint.h>\n#i"
},
{
"path": "Sources/CNIOLLHTTP/include/CNIOLLHTTP.h",
"chars": 949,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "Sources/CNIOLLHTTP/include/c_nio_llhttp.h",
"chars": 31122,
"preview": "/* Additional changes for SwiftNIO:\n - prefixed all symbols by 'c_nio_'\n*/\n\n#ifndef INCLUDE_LLHTTP_H_\n#define INCLUDE"
},
{
"path": "Sources/CNIOLLHTTP/update_and_patch_llhttp.sh",
"chars": 5344,
"preview": "#!/bin/bash\n##===----------------------------------------------------------------------===##\n##\n## This source file is p"
},
{
"path": "Sources/CNIOLinux/include/CNIOLinux.h",
"chars": 5976,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "Sources/CNIOLinux/include/liburing_nio.h",
"chars": 1095,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "Sources/CNIOLinux/liburing_shims.c",
"chars": 1146,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "Sources/CNIOLinux/shim.c",
"chars": 7274,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "Sources/CNIOOpenBSD/include/CNIOOpenBSD.h",
"chars": 3632,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "Sources/CNIOOpenBSD/shim.c",
"chars": 4167,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "Sources/CNIOPosix/event_loop_id.c",
"chars": 877,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "Sources/CNIOPosix/include/CNIOPosix.h",
"chars": 1060,
"preview": "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the S"
},
{
"path": "Sources/CNIOSHA1/c_nio_sha1.c",
"chars": 9658,
"preview": "/* Additional changes for SwiftNIO:\n - prefixed all symbols by 'c_nio_'\n - removed the _KERNEL include guards\n "
}
]
// ... and 566 more files (download for full content)
About this extraction
This page contains the full source code of the apple/swift-nio GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 766 files (8.5 MB), approximately 2.3M tokens, and a symbol index with 368 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.