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

Failed to build WebView, reference 0.1.1 (f41d4b), with Swift 6.0 for macOS (SPM) on 31 Oct 2024 12:11:58 UTC.

Build Command

env DEVELOPER_DIR=/Applications/Xcode-16.1.0.app xcrun swift build --arch arm64 -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete

Build Log

========================================
RunAll
========================================
Builder version: 4.56.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/phatblat/WebView.git
Reference: 0.1.1
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/.git/
From https://github.com/phatblat/WebView
 * tag               0.1.1      -> FETCH_HEAD
HEAD is now at f41d4b7 🐛 Fix compile error on iOS
Cloned https://github.com/phatblat/WebView.git
Revision (git rev-parse @):
f41d4b73c19bdb4b0227fd43b2d464d6c2e8d64e
SUCCESS checkout https://github.com/phatblat/WebView.git at 0.1.1
========================================
ResolveProductDependencies
========================================
Resolving dependencies ...
{
  "identity": ".resolve-product-dependencies",
  "name": "resolve-dependencies",
  "url": "/Users/admin/builder/spi-builder-workspace/.resolve-product-dependencies",
  "version": "unspecified",
  "path": "/Users/admin/builder/spi-builder-workspace/.resolve-product-dependencies",
  "dependencies": [
    {
      "identity": "webview",
      "name": "WebView",
      "url": "https://github.com/phatblat/WebView.git",
      "version": "unspecified",
      "path": "/Users/admin/builder/spi-builder-workspace/.resolve-product-dependencies/.build/checkouts/WebView",
      "dependencies": [
      ]
    }
  ]
}
Fetching https://github.com/phatblat/WebView.git
[1/188] Fetching webview
Fetched https://github.com/phatblat/WebView.git from cache (0.69s)
Creating working copy for https://github.com/phatblat/WebView.git
Working copy of https://github.com/phatblat/WebView.git resolved at 0.1.1 (f41d4b7)
warning: '.resolve-product-dependencies': dependency 'webview' is not used by any target
Found 0 product dependencies
========================================
Build
========================================
Selected platform:         macosSpm
Swift version:             6.0
Building package at path:  $PWD
https://github.com/phatblat/WebView.git
Running build ...
env DEVELOPER_DIR=/Applications/Xcode-16.1.0.app xcrun swift build --arch arm64 -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete
Building for debugging...
[0/2] Write sources
[1/2] Write swift-version--7754E27361AE5C74.txt
error: emit-module command failed with exit code 1 (use -v to see invocation)
[3/7] Compiling WebView NSViewContainerView.swift
[4/7] Compiling WebView WebView.swift
[5/7] Emitting module WebView
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:13:17: error: main actor-isolated default value in a nonisolated context
11 |     }
12 |
13 |     public init(webView: WKWebView = .init()) {
   |                 `- error: main actor-isolated default value in a nonisolated context
14 |         self.webView = webView
15 |
[6/7] Compiling WebView UIViewContainerView.swift
[7/7] Compiling WebView WebViewStore.swift
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:13:17: error: main actor-isolated default value in a nonisolated context
11 |     }
12 |
13 |     public init(webView: WKWebView = .init()) {
   |                 `- error: main actor-isolated default value in a nonisolated context
14 |         self.webView = webView
15 |
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:19:12: warning: main actor-isolated property 'preferences' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
17 |         self.webView
18 |           .configuration
19 |           .preferences
   |            `- warning: main actor-isolated property 'preferences' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
20 |           .setValue(true, forKey: "developerExtrasEnabled")
21 |         #endif
WebKit.WKWebViewConfiguration:4:25: note: property declared here
 2 | @MainActor open class WKWebViewConfiguration : NSObject, NSSecureCoding, NSCopying {
 3 |     open var processPool: WKProcessPool { get set }
 4 |     @MainActor open var preferences: WKPreferences { get set }
   |                         `- note: property declared here
 5 |     open var userContentController: WKUserContentController { get set }
 6 |     @available(macOS 10.11, *)
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:18:12: warning: main actor-isolated property 'configuration' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
16 |         #if DEBUG
17 |         self.webView
18 |           .configuration
   |            `- warning: main actor-isolated property 'configuration' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
19 |           .preferences
20 |           .setValue(true, forKey: "developerExtrasEnabled")
WebKit.WKWebView:3:36: note: property declared here
  1 | @available(macOS 10.10, *)
  2 | @MainActor open class WKWebView : NSView {
  3 |     @NSCopying @MainActor 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/WebView/WebViewStore.swift:30:21: warning: capture of 'self' with non-sendable type 'WebViewStore' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 2 | import Combine
 3 |
 4 | public class WebViewStore: ObservableObject {
   |              `- note: class 'WebViewStore' does not conform to the 'Sendable' protocol
 5 |     private var observers = Set<NSKeyValueObservation>()
 6 |
   :
28 |             return webView.observe(keyPath, options: [.prior]) { _, change in
29 |                 if change.isPrior {
30 |                     self.objectWillChange.send()
   |                     `- warning: capture of 'self' with non-sendable type 'WebViewStore' in a `@Sendable` closure; this is an error in the Swift 6 language mode
31 |                 }
32 |             }
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:37:31: warning: cannot form key path to main actor-isolated property 'title'; this is an error in the Swift 6 language mode
35 |         // Observers for all KVO compliant properties
36 |         observers = [
37 |             subscriber(for: \.title),
   |                               `- warning: cannot form key path to main actor-isolated property 'title'; this is an error in the Swift 6 language mode
38 |             subscriber(for: \.url),
39 |             subscriber(for: \.isLoading),
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:38:31: warning: cannot form key path to main actor-isolated property 'url'; this is an error in the Swift 6 language mode
36 |         observers = [
37 |             subscriber(for: \.title),
38 |             subscriber(for: \.url),
   |                               `- warning: cannot form key path to main actor-isolated property 'url'; this is an error in the Swift 6 language mode
39 |             subscriber(for: \.isLoading),
40 |             subscriber(for: \.estimatedProgress),
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:39:31: warning: cannot form key path to main actor-isolated property 'isLoading'; this is an error in the Swift 6 language mode
37 |             subscriber(for: \.title),
38 |             subscriber(for: \.url),
39 |             subscriber(for: \.isLoading),
   |                               `- warning: cannot form key path to main actor-isolated property 'isLoading'; this is an error in the Swift 6 language mode
40 |             subscriber(for: \.estimatedProgress),
41 |             subscriber(for: \.hasOnlySecureContent),
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:40:31: warning: cannot form key path to main actor-isolated property 'estimatedProgress'; this is an error in the Swift 6 language mode
38 |             subscriber(for: \.url),
39 |             subscriber(for: \.isLoading),
40 |             subscriber(for: \.estimatedProgress),
   |                               `- warning: cannot form key path to main actor-isolated property 'estimatedProgress'; this is an error in the Swift 6 language mode
41 |             subscriber(for: \.hasOnlySecureContent),
42 |             subscriber(for: \.serverTrust),
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:41:31: warning: cannot form key path to main actor-isolated property 'hasOnlySecureContent'; this is an error in the Swift 6 language mode
39 |             subscriber(for: \.isLoading),
40 |             subscriber(for: \.estimatedProgress),
41 |             subscriber(for: \.hasOnlySecureContent),
   |                               `- warning: cannot form key path to main actor-isolated property 'hasOnlySecureContent'; this is an error in the Swift 6 language mode
42 |             subscriber(for: \.serverTrust),
43 |             subscriber(for: \.canGoBack),
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:42:31: warning: cannot form key path to main actor-isolated property 'serverTrust'; this is an error in the Swift 6 language mode
40 |             subscriber(for: \.estimatedProgress),
41 |             subscriber(for: \.hasOnlySecureContent),
42 |             subscriber(for: \.serverTrust),
   |                               `- warning: cannot form key path to main actor-isolated property 'serverTrust'; this is an error in the Swift 6 language mode
43 |             subscriber(for: \.canGoBack),
44 |             subscriber(for: \.canGoForward)
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:43:31: warning: cannot form key path to main actor-isolated property 'canGoBack'; this is an error in the Swift 6 language mode
41 |             subscriber(for: \.hasOnlySecureContent),
42 |             subscriber(for: \.serverTrust),
43 |             subscriber(for: \.canGoBack),
   |                               `- warning: cannot form key path to main actor-isolated property 'canGoBack'; this is an error in the Swift 6 language mode
44 |             subscriber(for: \.canGoForward)
45 |         ]
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:44:31: warning: cannot form key path to main actor-isolated property 'canGoForward'; this is an error in the Swift 6 language mode
42 |             subscriber(for: \.serverTrust),
43 |             subscriber(for: \.canGoBack),
44 |             subscriber(for: \.canGoForward)
   |                               `- warning: cannot form key path to main actor-isolated property 'canGoForward'; this is an error in the Swift 6 language mode
45 |         ]
46 |     }
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:59:17: 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
56 |
57 | extension WebViewStore {
58 |     func update(_ HTML: String, baseURL: URL) {
   |          `- note: add '@MainActor' to make instance method 'update(_:baseURL:)' part of global actor 'MainActor'
59 |         webView.evaluateJavaScript("window.pageYOffset") { [weak self] object, error in
   |                 `- 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
60 |             self?.webView.loadHTMLString(HTML, baseURL: baseURL)
61 |
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: (@MainActor @Sendable (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/WebView/WebViewStore.swift:60:13: warning: capture of 'self' with non-sendable type 'WebViewStore?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 2 | import Combine
 3 |
 4 | public class WebViewStore: ObservableObject {
   |              `- note: class 'WebViewStore' does not conform to the 'Sendable' protocol
 5 |     private var observers = Set<NSKeyValueObservation>()
 6 |
   :
58 |     func update(_ HTML: String, baseURL: URL) {
59 |         webView.evaluateJavaScript("window.pageYOffset") { [weak self] object, error in
60 |             self?.webView.loadHTMLString(HTML, baseURL: baseURL)
   |             `- warning: capture of 'self' with non-sendable type 'WebViewStore?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
61 |
62 |             if let offset = object as? Int {
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:70:28: warning: call to main actor-isolated initializer 'init(source:injectionTime:forMainFrameOnly:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode
66 |     }
67 |
68 |     private func scrollTo(_ YOffset: Int) {
   |                  `- note: add '@MainActor' to make instance method 'scrollTo' part of global actor 'MainActor'
69 |         let script = "window.scrollTo(0, \(YOffset));"
70 |         let scrollScript = WKUserScript(source: script, injectionTime: .atDocumentEnd, forMainFrameOnly: true)
   |                            `- warning: call to main actor-isolated initializer 'init(source:injectionTime:forMainFrameOnly:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode
71 |         self.webView.configuration.userContentController.addUserScript(scrollScript)
72 |     }
WebKit.WKUserScript:8:23: note: calls to initializer 'init(source:injectionTime:forMainFrameOnly:)' from outside of its actor context are implicitly asynchronous
 6 |     @available(swift, obsoleted: 3, renamed: "isForMainFrameOnly")
 7 |     open var forMainFrameOnly: Bool { get }
 8 |     @MainActor public init(source: String, injectionTime: WKUserScriptInjectionTime, forMainFrameOnly: Bool)
   |                       `- note: calls to initializer 'init(source:injectionTime:forMainFrameOnly:)' from outside of its actor context are implicitly asynchronous
 9 |     @available(macOS 11.0, *)
10 |     public init(source: String, injectionTime: WKUserScriptInjectionTime, forMainFrameOnly: Bool, in contentWorld: WKContentWorld)
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:71:58: warning: call to main actor-isolated instance method 'addUserScript' in a synchronous nonisolated context; this is an error in the Swift 6 language mode
66 |     }
67 |
68 |     private func scrollTo(_ YOffset: Int) {
   |                  `- note: add '@MainActor' to make instance method 'scrollTo' part of global actor 'MainActor'
69 |         let script = "window.scrollTo(0, \(YOffset));"
70 |         let scrollScript = WKUserScript(source: script, injectionTime: .atDocumentEnd, forMainFrameOnly: true)
71 |         self.webView.configuration.userContentController.addUserScript(scrollScript)
   |                                                          `- warning: call to main actor-isolated instance method 'addUserScript' in a synchronous nonisolated context; this is an error in the Swift 6 language mode
72 |     }
73 | }
WebKit.WKUserContentController:4:26: note: calls to instance method 'addUserScript' from outside of its actor context are implicitly asynchronous
 2 | @MainActor open class WKUserContentController : NSObject, NSSecureCoding {
 3 |     open var userScripts: [WKUserScript] { get }
 4 |     @MainActor open func addUserScript(_ userScript: WKUserScript)
   |                          `- note: calls to instance method 'addUserScript' from outside of its actor context are implicitly asynchronous
 5 |     open func removeAllUserScripts()
 6 |     @available(macOS 11.0, *)
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:71:36: warning: main actor-isolated property 'userContentController' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
66 |     }
67 |
68 |     private func scrollTo(_ YOffset: Int) {
   |                  `- note: add '@MainActor' to make instance method 'scrollTo' part of global actor 'MainActor'
69 |         let script = "window.scrollTo(0, \(YOffset));"
70 |         let scrollScript = WKUserScript(source: script, injectionTime: .atDocumentEnd, forMainFrameOnly: true)
71 |         self.webView.configuration.userContentController.addUserScript(scrollScript)
   |                                    `- warning: main actor-isolated property 'userContentController' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
72 |     }
73 | }
WebKit.WKWebViewConfiguration:5:14: note: property declared here
 3 |     open var processPool: WKProcessPool { get set }
 4 |     @MainActor open var preferences: WKPreferences { get set }
 5 |     open var userContentController: WKUserContentController { get set }
   |              `- note: property declared here
 6 |     @available(macOS 10.11, *)
 7 |     open var websiteDataStore: WKWebsiteDataStore { get set }
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:71:22: warning: main actor-isolated property 'configuration' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
66 |     }
67 |
68 |     private func scrollTo(_ YOffset: Int) {
   |                  `- note: add '@MainActor' to make instance method 'scrollTo' part of global actor 'MainActor'
69 |         let script = "window.scrollTo(0, \(YOffset));"
70 |         let scrollScript = WKUserScript(source: script, injectionTime: .atDocumentEnd, forMainFrameOnly: true)
71 |         self.webView.configuration.userContentController.addUserScript(scrollScript)
   |                      `- warning: main actor-isolated property 'configuration' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
72 |     }
73 | }
WebKit.WKWebView:3:36: note: property declared here
  1 | @available(macOS 10.10, *)
  2 | @MainActor open class WKWebView : NSView {
  3 |     @NSCopying @MainActor 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 }
BUILD FAILURE 6.0 macosSpm