From a837a3801e1243cc44911dd473668392e709d873 Mon Sep 17 00:00:00 2001 From: Rick Newton-Rogers Date: Mon, 16 Dec 2024 14:03:52 +0000 Subject: [PATCH] Enable MemberImportVisibility check - attempt 2 Enable MemberImportVisibility check on all targets. Use a standard string header and footer to bracket the new block for ease of updating in the future with scripts. --- Package.swift | 11 +++++++++++ Sources/NIOCrashTester/CrashTests+Strict.swift | 1 + Sources/NIOCrashTester/CrashTests+System.swift | 1 + Sources/NIOMulticastChat/main.swift | 1 + Sources/NIOPosix/BaseSocket.swift | 1 + Sources/NIOPosix/Bootstrap.swift | 1 + Sources/NIOPosix/DatagramVectorReadManager.swift | 1 + Sources/NIOPosix/NonBlockingFileIO.swift | 1 + Sources/NIOPosix/PendingDatagramWritesManager.swift | 1 + Sources/NIOPosix/PendingWritesManager.swift | 1 + Sources/NIOPosix/SelectorEpoll.swift | 1 + Sources/NIOPosix/Socket.swift | 1 + Sources/NIOPosix/SocketChannel.swift | 1 + 13 files changed, 23 insertions(+) diff --git a/Package.swift b/Package.swift index 021ebf8e50..b1fcd3cc5f 100644 --- a/Package.swift +++ b/Package.swift @@ -566,3 +566,14 @@ if Context.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil { .package(path: "../swift-system"), ] } + +// --- STANDARD CROSS-REPO SETTINGS DO NOT EDIT --- // +for target in package.targets { + if target.type != .plugin { + var settings = target.swiftSettings ?? [] + // https://github.com/swiftlang/swift-evolution/blob/main/proposals/0444-member-import-visibility.md + settings.append(.enableUpcomingFeature("MemberImportVisibility")) + target.swiftSettings = settings + } +} +// --- END: STANDARD CROSS-REPO SETTINGS DO NOT EDIT --- // diff --git a/Sources/NIOCrashTester/CrashTests+Strict.swift b/Sources/NIOCrashTester/CrashTests+Strict.swift index d97a737a00..cbbe46a52e 100644 --- a/Sources/NIOCrashTester/CrashTests+Strict.swift +++ b/Sources/NIOCrashTester/CrashTests+Strict.swift @@ -13,6 +13,7 @@ //===----------------------------------------------------------------------===// #if !canImport(Darwin) || os(macOS) +import NIOCore import NIOPosix struct StrictCrashTests { diff --git a/Sources/NIOCrashTester/CrashTests+System.swift b/Sources/NIOCrashTester/CrashTests+System.swift index 3147ff081a..b5863eb20a 100644 --- a/Sources/NIOCrashTester/CrashTests+System.swift +++ b/Sources/NIOCrashTester/CrashTests+System.swift @@ -13,6 +13,7 @@ //===----------------------------------------------------------------------===// #if !canImport(Darwin) || os(macOS) +import NIOCore import NIOPosix import Foundation diff --git a/Sources/NIOMulticastChat/main.swift b/Sources/NIOMulticastChat/main.swift index 94beddc8fd..2d17af22cb 100644 --- a/Sources/NIOMulticastChat/main.swift +++ b/Sources/NIOMulticastChat/main.swift @@ -13,6 +13,7 @@ //===----------------------------------------------------------------------===// import NIOCore import NIOPosix +import CNIOLinux /// Implements a simple chat protocol. private final class ChatMessageDecoder: ChannelInboundHandler { diff --git a/Sources/NIOPosix/BaseSocket.swift b/Sources/NIOPosix/BaseSocket.swift index 58e20d3e86..23886c8d81 100644 --- a/Sources/NIOPosix/BaseSocket.swift +++ b/Sources/NIOPosix/BaseSocket.swift @@ -14,6 +14,7 @@ import NIOConcurrencyHelpers import NIOCore +import CNIOLinux #if os(Windows) import let WinSDK.EAFNOSUPPORT diff --git a/Sources/NIOPosix/Bootstrap.swift b/Sources/NIOPosix/Bootstrap.swift index e3b5710ffe..ad4dafc165 100644 --- a/Sources/NIOPosix/Bootstrap.swift +++ b/Sources/NIOPosix/Bootstrap.swift @@ -12,6 +12,7 @@ // //===----------------------------------------------------------------------===// import NIOCore +import CNIOLinux #if os(Windows) import ucrt diff --git a/Sources/NIOPosix/DatagramVectorReadManager.swift b/Sources/NIOPosix/DatagramVectorReadManager.swift index 2d4987a9d6..5a8289f5bd 100644 --- a/Sources/NIOPosix/DatagramVectorReadManager.swift +++ b/Sources/NIOPosix/DatagramVectorReadManager.swift @@ -12,6 +12,7 @@ // //===----------------------------------------------------------------------===// import NIOCore +import CNIOLinux /// An object that manages issuing vector reads for datagram channels. /// diff --git a/Sources/NIOPosix/NonBlockingFileIO.swift b/Sources/NIOPosix/NonBlockingFileIO.swift index fe3448d11a..1ed37ad8b0 100644 --- a/Sources/NIOPosix/NonBlockingFileIO.swift +++ b/Sources/NIOPosix/NonBlockingFileIO.swift @@ -14,6 +14,7 @@ import NIOConcurrencyHelpers import NIOCore +import CNIOLinux /// ``NonBlockingFileIO`` is a helper that allows you to read files without blocking the calling thread. /// diff --git a/Sources/NIOPosix/PendingDatagramWritesManager.swift b/Sources/NIOPosix/PendingDatagramWritesManager.swift index ace953fbcc..94c88a5ac6 100644 --- a/Sources/NIOPosix/PendingDatagramWritesManager.swift +++ b/Sources/NIOPosix/PendingDatagramWritesManager.swift @@ -14,6 +14,7 @@ import Atomics import NIOCore +import CNIOLinux private struct PendingDatagramWrite { var data: ByteBuffer diff --git a/Sources/NIOPosix/PendingWritesManager.swift b/Sources/NIOPosix/PendingWritesManager.swift index 001b05c215..cc503952a1 100644 --- a/Sources/NIOPosix/PendingWritesManager.swift +++ b/Sources/NIOPosix/PendingWritesManager.swift @@ -14,6 +14,7 @@ import Atomics import NIOCore +import CNIOLinux private struct PendingStreamWrite { var data: IOData diff --git a/Sources/NIOPosix/SelectorEpoll.swift b/Sources/NIOPosix/SelectorEpoll.swift index 832dc41dff..7889be8688 100644 --- a/Sources/NIOPosix/SelectorEpoll.swift +++ b/Sources/NIOPosix/SelectorEpoll.swift @@ -13,6 +13,7 @@ //===----------------------------------------------------------------------===// import NIOCore +import NIOConcurrencyHelpers #if !SWIFTNIO_USE_IO_URING diff --git a/Sources/NIOPosix/Socket.swift b/Sources/NIOPosix/Socket.swift index 1535e42d03..458b1a3600 100644 --- a/Sources/NIOPosix/Socket.swift +++ b/Sources/NIOPosix/Socket.swift @@ -13,6 +13,7 @@ //===----------------------------------------------------------------------===// import NIOCore +import CNIOLinux /// The container used for writing multiple buffers via `writev`. typealias IOVector = iovec diff --git a/Sources/NIOPosix/SocketChannel.swift b/Sources/NIOPosix/SocketChannel.swift index e1a9a473c0..ac1ac28e3c 100644 --- a/Sources/NIOPosix/SocketChannel.swift +++ b/Sources/NIOPosix/SocketChannel.swift @@ -12,6 +12,7 @@ // //===----------------------------------------------------------------------===// import NIOCore +import CNIOLinux #if os(Windows) import let WinSDK.ECONNABORTED