From a8ffbdf9ef4529a08d81914f18b19fca2f7b65ce Mon Sep 17 00:00:00 2001 From: Owen Voorhees Date: Wed, 29 Oct 2025 17:22:42 -0700 Subject: [PATCH] Retroactively conform DispatchData to Sendable when building with older macOS SDKs in Swift CI --- Sources/Subprocess/IO/AsyncIO+Dispatch.swift | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Sources/Subprocess/IO/AsyncIO+Dispatch.swift b/Sources/Subprocess/IO/AsyncIO+Dispatch.swift index 3bebe122..36abe67d 100644 --- a/Sources/Subprocess/IO/AsyncIO+Dispatch.swift +++ b/Sources/Subprocess/IO/AsyncIO+Dispatch.swift @@ -166,8 +166,16 @@ final class AsyncIO: Sendable { } } -#if !canImport(Darwin) +#if canImport(Darwin) +// Dispatch has a -user-module-version of 54 in the macOS 15.3 SDK +#if canImport(Dispatch, _version: "54") +// DispatchData is annotated as Sendable +#else +// Retroactively conform DispatchData to Sendable extension DispatchData: @retroactive @unchecked Sendable {} -#endif +#endif // canImport(Dispatch, _version: "54") +#else +extension DispatchData: @retroactive @unchecked Sendable {} +#endif // canImport(Darwin) -#endif +#endif // SUBPROCESS_ASYNCIO_DISPATCH