This is a staging environment. For live and up-to-date package information, visit swiftpackageindex.com.

The Swift Package Index logo.Swift Package Index

Track the adoption of Swift 6 strict concurrency checks for data race safety. How many packages are Ready for Swift 6?

Build Information

Successful build of JSBridge with Swift 6.0 for macOS (SPM).

Swift 6 data race errors: 1

Build Command

env DEVELOPER_DIR=/Applications/Xcode-15.3.0.app xcrun --toolchain org.swift.600202405261a swift build --arch arm64 -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete

Build Log

========================================
RunAll
========================================
Builder version: 4.40.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/LinusU/JSBridge.git
Reference: master
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/.git/
From https://github.com/LinusU/JSBridge
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> origin/master
HEAD is now at cb5846a Merge pull request #8 from LinusU/lu-fix
Cloned https://github.com/LinusU/JSBridge.git
Revision (git rev-parse @):
cb5846a525a31c79f7040fd9df024438883d8924
SUCCESS checkout https://github.com/LinusU/JSBridge.git at master
========================================
Build
========================================
Selected platform:         macosSpm
Swift version:             6.0
Building package at path:  $workDir
https://github.com/LinusU/JSBridge.git
Running build ...
env DEVELOPER_DIR=/Applications/Xcode-15.3.0.app xcrun --toolchain org.swift.600202405261a swift build --arch arm64 -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete
Building for debugging...
[0/3] Write sources
[2/3] Write swift-version-6F35C1178C84523A.txt
[4/18] Compiling PromiseKit firstly.swift
[5/19] Compiling PromiseKit hang.swift
[6/19] Compiling PromiseKit race.swift
[7/19] Compiling PromiseKit after.swift
[8/19] Compiling PromiseKit Resolver.swift
[9/19] Compiling PromiseKit Thenable.swift
[10/19] Compiling PromiseKit Error.swift
[11/19] Compiling PromiseKit Guarantee.swift
[12/19] Compiling PromiseKit Configuration.swift
[13/19] Compiling PromiseKit CustomStringConvertible.swift
[14/19] Compiling PromiseKit Box.swift
[15/19] Compiling PromiseKit Catchable.swift
[16/19] Emitting module PromiseKit
[17/19] Compiling PromiseKit LogEvent.swift
[18/19] Compiling PromiseKit Promise.swift
[19/19] Compiling PromiseKit when.swift
[20/22] Compiling JSBridge JSBridge.swift
[21/22] Emitting module JSBridge
/Users/admin/builder/spi-builder-workspace/Sources/Context.swift:150:24: warning: static property 'errorEncoder' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
148 |     private var functions = [String: ([String]) throws -> Promise<String>]()
149 |
150 |     private static var errorEncoder = JSONEncoder()
    |                        |- warning: static property 'errorEncoder' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
    |                        |- note: convert 'errorEncoder' to a 'let' constant to make 'Sendable' shared state immutable
    |                        |- note: annotate 'errorEncoder' with '@MainActor' if property should only be accessed from the main actor
    |                        `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
151 |
152 |     internal let webView: WKWebView
[22/22] Compiling JSBridge Context.swift
/Users/admin/builder/spi-builder-workspace/Sources/Context.swift:150:24: warning: static property 'errorEncoder' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
148 |     private var functions = [String: ([String]) throws -> Promise<String>]()
149 |
150 |     private static var errorEncoder = JSONEncoder()
    |                        |- warning: static property 'errorEncoder' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
    |                        |- note: convert 'errorEncoder' to a 'let' constant to make 'Sendable' shared state immutable
    |                        |- note: annotate 'errorEncoder' with '@MainActor' if property should only be accessed from the main actor
    |                        `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
151 |
152 |     internal let webView: WKWebView
/Users/admin/builder/spi-builder-workspace/Sources/Context.swift:155:29: warning: call to main actor-isolated initializer 'init(frame:configuration:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode
153 |
154 |     init(libraryCode: String, customOrigin: URL?, incognito: Bool) {
155 |         webView = WKWebView.init(frame: .zero, configuration: buildWebViewConfig(libraryCode: libraryCode, incognito: incognito))
    |                             `- warning: call to main actor-isolated initializer 'init(frame:configuration:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode
156 |
157 |         super.init()
WebKit.WKWebView:9:23: note: calls to initializer 'init(frame:configuration:)' from outside of its actor context are implicitly asynchronous
  7 |     weak open var UIDelegate: (any WKUIDelegate)? { get set }
  8 |     open var backForwardList: WKBackForwardList { get }
  9 |     @MainActor public init(frame: CGRect, configuration: WKWebViewConfiguration)
    |                       `- note: calls to initializer 'init(frame:configuration:)' from outside of its actor context are implicitly asynchronous
 10 |     public init?(coder: NSCoder)
 11 |     open func load(_ request: URLRequest) -> WKNavigation?
/Users/admin/builder/spi-builder-workspace/Sources/Context.swift:159:17: warning: main actor-isolated property 'configuration' can not be referenced from a non-isolated context; this is an error in the Swift 6 language mode
157 |         super.init()
158 |
159 |         webView.configuration.userContentController.add(self, name: "scriptHandler")
    |                 `- warning: main actor-isolated property 'configuration' can not be referenced from a non-isolated context; this is an error in the Swift 6 language mode
160 |         webView.load(html, mimeType: "text/html", characterEncodingName: "utf8", baseURL: customOrigin ?? defaultOrigin)
161 |     }
WebKit.WKWebView:3:25: note: property declared here
  1 | @available(macOS 10.10, *)
  2 | @MainActor open class WKWebView : NSView {
  3 |     @NSCopying open var configuration: WKWebViewConfiguration { get }
    |                         `- note: property declared here
  4 |     weak open var navigationDelegate: (any WKNavigationDelegate)? { get set }
  5 |     weak open var uiDelegate: (any WKUIDelegate)? { get set }
/Users/admin/builder/spi-builder-workspace/Sources/Context.swift:160:17: warning: call to main actor-isolated instance method 'load(_:mimeType:characterEncodingName:baseURL:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode
158 |
159 |         webView.configuration.userContentController.add(self, name: "scriptHandler")
160 |         webView.load(html, mimeType: "text/html", characterEncodingName: "utf8", baseURL: customOrigin ?? defaultOrigin)
    |                 `- warning: call to main actor-isolated instance method 'load(_:mimeType:characterEncodingName:baseURL:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode
161 |     }
162 |
WebKit.WKWebView:21:26: note: calls to instance method 'load(_:mimeType:characterEncodingName:baseURL:)' from outside of its actor context are implicitly asynchronous
 19 |     open func loadHTMLString(_ string: String, baseURL: URL?) -> WKNavigation?
 20 |     @available(macOS 10.11, *)
 21 |     @MainActor open func load(_ data: Data, mimeType MIMEType: String, characterEncodingName: String, baseURL: URL) -> WKNavigation?
    |                          `- note: calls to instance method 'load(_:mimeType:characterEncodingName:baseURL:)' from outside of its actor context are implicitly asynchronous
 22 |     @available(macOS 10.11, *)
 23 |     @available(swift, obsoleted: 3, renamed: "load(_:mimeType:characterEncodingName:baseURL:)")
/Users/admin/builder/spi-builder-workspace/Sources/Context.swift:201:30: warning: call to main actor-isolated instance method 'evaluateJavaScript(_:completionHandler:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode
199 |                 try fn(params)
200 |             }.done {
201 |                 self.webView.evaluateJavaScript("__JSBridge__resolve__(\(id), \($0))")
    |                              `- warning: call to main actor-isolated instance method 'evaluateJavaScript(_:completionHandler:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode
202 |             }.catch {
203 |                 if let error = $0 as? JSError, let encoded = try? Context.errorEncoder.encode(error), let props = String(data: encoded, encoding: .utf8) {
WebKit.WKWebView:46:15: note: calls to instance method 'evaluateJavaScript(_:completionHandler:)' from outside of its actor context are implicitly asynchronous
 44 |     open func reloadFromOrigin() -> WKNavigation?
 45 |     open func stopLoading()
 46 |     open func evaluateJavaScript(_ javaScriptString: String, completionHandler: ((Any?, (any Error)?) -> Void)? = nil)
    |               `- note: calls to instance method 'evaluateJavaScript(_:completionHandler:)' from outside of its actor context are implicitly asynchronous
 47 |     open func evaluateJavaScript(_ javaScriptString: String) async throws -> Any
 48 |     @available(macOS 11.0, *)
/Users/admin/builder/spi-builder-workspace/Sources/Context.swift:204:34: warning: call to main actor-isolated instance method 'evaluateJavaScript(_:completionHandler:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode
202 |             }.catch {
203 |                 if let error = $0 as? JSError, let encoded = try? Context.errorEncoder.encode(error), let props = String(data: encoded, encoding: .utf8) {
204 |                     self.webView.evaluateJavaScript("__JSBridge__reject__(\(id), Object.assign(new Error(''), \(props)))")
    |                                  `- warning: call to main actor-isolated instance method 'evaluateJavaScript(_:completionHandler:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode
205 |                 } else {
206 |                     self.webView.evaluateJavaScript("__JSBridge__reject__(\(id), new Error('\($0.localizedDescription)'))")
WebKit.WKWebView:46:15: note: calls to instance method 'evaluateJavaScript(_:completionHandler:)' from outside of its actor context are implicitly asynchronous
 44 |     open func reloadFromOrigin() -> WKNavigation?
 45 |     open func stopLoading()
 46 |     open func evaluateJavaScript(_ javaScriptString: String, completionHandler: ((Any?, (any Error)?) -> Void)? = nil)
    |               `- note: calls to instance method 'evaluateJavaScript(_:completionHandler:)' from outside of its actor context are implicitly asynchronous
 47 |     open func evaluateJavaScript(_ javaScriptString: String) async throws -> Any
 48 |     @available(macOS 11.0, *)
/Users/admin/builder/spi-builder-workspace/Sources/Context.swift:206:34: warning: call to main actor-isolated instance method 'evaluateJavaScript(_:completionHandler:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode
204 |                     self.webView.evaluateJavaScript("__JSBridge__reject__(\(id), Object.assign(new Error(''), \(props)))")
205 |                 } else {
206 |                     self.webView.evaluateJavaScript("__JSBridge__reject__(\(id), new Error('\($0.localizedDescription)'))")
    |                                  `- warning: call to main actor-isolated instance method 'evaluateJavaScript(_:completionHandler:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode
207 |                 }
208 |             }
WebKit.WKWebView:46:15: note: calls to instance method 'evaluateJavaScript(_:completionHandler:)' from outside of its actor context are implicitly asynchronous
 44 |     open func reloadFromOrigin() -> WKNavigation?
 45 |     open func stopLoading()
 46 |     open func evaluateJavaScript(_ javaScriptString: String, completionHandler: ((Any?, (any Error)?) -> Void)? = nil)
    |               `- note: calls to instance method 'evaluateJavaScript(_:completionHandler:)' from outside of its actor context are implicitly asynchronous
 47 |     open func evaluateJavaScript(_ javaScriptString: String) async throws -> Any
 48 |     @available(macOS 11.0, *)
/Users/admin/builder/spi-builder-workspace/Sources/Context.swift:216:26: warning: call to main actor-isolated instance method 'evaluateJavaScript(_:completionHandler:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode
214 |             self.ready
215 |         }.done {
216 |             self.webView.evaluateJavaScript(javaScriptString, completionHandler: completionHandler)
    |                          `- warning: call to main actor-isolated instance method 'evaluateJavaScript(_:completionHandler:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode
217 |         }.catch {
218 |             completionHandler?(nil, $0)
WebKit.WKWebView:46:15: note: calls to instance method 'evaluateJavaScript(_:completionHandler:)' from outside of its actor context are implicitly asynchronous
 44 |     open func reloadFromOrigin() -> WKNavigation?
 45 |     open func stopLoading()
 46 |     open func evaluateJavaScript(_ javaScriptString: String, completionHandler: ((Any?, (any Error)?) -> Void)? = nil)
    |               `- note: calls to instance method 'evaluateJavaScript(_:completionHandler:)' from outside of its actor context are implicitly asynchronous
 47 |     open func evaluateJavaScript(_ javaScriptString: String) async throws -> Any
 48 |     @available(macOS 11.0, *)
/Users/admin/builder/spi-builder-workspace/Sources/Context.swift:216:26: warning: sending task-isolated value of type '((Any?, (any Error)?) -> Void)?' with later accesses to main actor-isolated context risks causing data races; this is an error in the Swift 6 language mode
214 |             self.ready
215 |         }.done {
216 |             self.webView.evaluateJavaScript(javaScriptString, completionHandler: completionHandler)
    |                          `- warning: sending task-isolated value of type '((Any?, (any Error)?) -> Void)?' with later accesses to main actor-isolated context risks causing data races; this is an error in the Swift 6 language mode
217 |         }.catch {
218 |             completionHandler?(nil, $0)
Build complete! (49.77s)
Fetching https://github.com/mxcl/PromiseKit
[1/16963] Fetching promisekit
Fetched https://github.com/mxcl/PromiseKit from cache (2.17s)
Computing version for https://github.com/mxcl/PromiseKit
Computed https://github.com/mxcl/PromiseKit at 6.16.0 (0.72s)
Creating working copy for https://github.com/mxcl/PromiseKit
Working copy of https://github.com/mxcl/PromiseKit resolved at 6.16.0
Build complete.
{
  "dependencies" : [
    {
      "identity" : "promisekit",
      "requirement" : {
        "range" : [
          {
            "lower_bound" : "6.0.0",
            "upper_bound" : "7.0.0"
          }
        ]
      },
      "type" : "sourceControl",
      "url" : "https://github.com/mxcl/PromiseKit"
    }
  ],
  "manifest_display_name" : "JSBridge",
  "name" : "JSBridge",
  "path" : "/Users/admin/builder/spi-builder-workspace",
  "platforms" : [
  ],
  "products" : [
    {
      "name" : "JSBridge",
      "targets" : [
        "JSBridge"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "JSBridgeTests",
      "module_type" : "SwiftTarget",
      "name" : "JSBridgeTests",
      "path" : "Tests",
      "sources" : [
        "JSBridgeTests.swift"
      ],
      "target_dependencies" : [
        "JSBridge"
      ],
      "type" : "test"
    },
    {
      "c99name" : "JSBridge",
      "module_type" : "SwiftTarget",
      "name" : "JSBridge",
      "path" : "Sources",
      "product_dependencies" : [
        "PromiseKit"
      ],
      "product_memberships" : [
        "JSBridge"
      ],
      "sources" : [
        "Context.swift",
        "JSBridge.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.0"
}
Done.
This is a staging environment. For live and up-to-date package information, visit swiftpackageindex.com.