From 5171d9c402a0cdd19e79b8c2d300102d443500ca Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Mon, 2 Feb 2026 09:35:21 +0900 Subject: [PATCH] Fix `ExperimentalCustomExecutors` SPI import build issues The custom executor feature is now hidden behind the `ExperimentalCustomExecutors` SPI until it goes through the evolution process. https://github.com/swiftlang/swift/pull/86808 --- .../JavaScriptEventLoop+ExecutorFactory.swift | 5 ++++- Sources/JavaScriptEventLoop/JavaScriptEventLoop.swift | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Sources/JavaScriptEventLoop/JavaScriptEventLoop+ExecutorFactory.swift b/Sources/JavaScriptEventLoop/JavaScriptEventLoop+ExecutorFactory.swift index 574e8d03a..d31e03597 100644 --- a/Sources/JavaScriptEventLoop/JavaScriptEventLoop+ExecutorFactory.swift +++ b/Sources/JavaScriptEventLoop/JavaScriptEventLoop+ExecutorFactory.swift @@ -4,7 +4,7 @@ // See: https://github.com/swiftlang/swift/pull/80266 // See: https://forums.swift.org/t/pitch-2-custom-main-and-global-executors/78437 -import _Concurrency +@_spi(ExperimentalCustomExecutors) import _Concurrency import _CJavaScriptKit #if compiler(>=6.3) @@ -12,6 +12,7 @@ import _CJavaScriptKit // MARK: - MainExecutor Implementation // MainExecutor is used by the main actor to execute tasks on the main thread @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, visionOS 9999, *) +@_spi(ExperimentalCustomExecutors) extension JavaScriptEventLoop: MainExecutor { public func run() throws { // This method is called from `swift_task_asyncMainDrainQueueImpl`. @@ -27,6 +28,7 @@ extension JavaScriptEventLoop: MainExecutor { extension JavaScriptEventLoop: TaskExecutor {} @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, visionOS 9999, *) +@_spi(ExperimentalCustomExecutors) extension JavaScriptEventLoop: SchedulingExecutor { public func enqueue( _ job: consuming ExecutorJob, @@ -65,6 +67,7 @@ extension JavaScriptEventLoop: SchedulingExecutor { // MARK: - ExecutorFactory Implementation @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, visionOS 9999, *) +@_spi(ExperimentalCustomExecutors) extension JavaScriptEventLoop: ExecutorFactory { // Forward all operations to the current thread's JavaScriptEventLoop instance final class CurrentThread: TaskExecutor, SchedulingExecutor, MainExecutor, SerialExecutor { diff --git a/Sources/JavaScriptEventLoop/JavaScriptEventLoop.swift b/Sources/JavaScriptEventLoop/JavaScriptEventLoop.swift index 960a59be0..4b4115602 100644 --- a/Sources/JavaScriptEventLoop/JavaScriptEventLoop.swift +++ b/Sources/JavaScriptEventLoop/JavaScriptEventLoop.swift @@ -1,5 +1,5 @@ import JavaScriptKit -import _Concurrency +@_spi(ExperimentalCustomExecutors) import _Concurrency import _CJavaScriptEventLoop import _CJavaScriptKit