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 WebView, reference main (6cc553), with Swift 6.1 for macOS (SPM) on 25 Apr 2025 01:14:38 UTC.

Swift 6 data race errors: 1

Build Command

env DEVELOPER_DIR=/Applications/Xcode-16.3.0.app xcrun swift build --arch arm64 -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete -Xswiftc -enable-upcoming-feature -Xswiftc StrictConcurrency -Xswiftc -enable-upcoming-feature -Xswiftc DisableOutwardActorInference -Xswiftc -enable-upcoming-feature -Xswiftc GlobalActorIsolatedTypesUsability -Xswiftc -enable-upcoming-feature -Xswiftc InferSendableFromCaptures

Build Log

========================================
RunAll
========================================
Builder version: 4.61.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/phatblat/WebView.git
Reference: main
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/.git/
From https://github.com/phatblat/WebView
 * branch            main       -> FETCH_HEAD
 * [new branch]      main       -> origin/main
HEAD is now at 6cc5532 ✨ Add KeyPath subscripting
Cloned https://github.com/phatblat/WebView.git
Revision (git rev-parse @):
6cc5532aef4caa8fddd49062e2dac5c718e9e5c2
SUCCESS checkout https://github.com/phatblat/WebView.git at main
========================================
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
[4/188] Fetching webview
Fetched https://github.com/phatblat/WebView.git from cache (0.63s)
Creating working copy for https://github.com/phatblat/WebView.git
Working copy of https://github.com/phatblat/WebView.git resolved at main (6cc5532)
warning: '.resolve-product-dependencies': dependency 'webview' is not used by any target
Found 0 product dependencies
========================================
Build
========================================
Selected platform:         macosSpm
Swift version:             6.1
Building package at path:  $PWD
https://github.com/phatblat/WebView.git
https://github.com/phatblat/WebView.git
{
  "dependencies" : [
  ],
  "manifest_display_name" : "WebView",
  "name" : "WebView",
  "path" : "/Users/admin/builder/spi-builder-workspace",
  "platforms" : [
    {
      "name" : "ios",
      "version" : "13.0"
    },
    {
      "name" : "macos",
      "version" : "10.15"
    }
  ],
  "products" : [
    {
      "name" : "WebView",
      "targets" : [
        "WebView"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "WebViewTests",
      "module_type" : "SwiftTarget",
      "name" : "WebViewTests",
      "path" : "Tests/WebViewTests",
      "sources" : [
        "WebViewTests.swift"
      ],
      "target_dependencies" : [
        "WebView"
      ],
      "type" : "test"
    },
    {
      "c99name" : "WebView",
      "module_type" : "SwiftTarget",
      "name" : "WebView",
      "path" : "Sources/WebView",
      "product_memberships" : [
        "WebView"
      ],
      "sources" : [
        "WebView.swift",
        "WebViewStore.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.2"
}
Running build ...
env DEVELOPER_DIR=/Applications/Xcode-16.3.0.app xcrun swift build --arch arm64 -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete -Xswiftc -enable-upcoming-feature -Xswiftc StrictConcurrency -Xswiftc -enable-upcoming-feature -Xswiftc DisableOutwardActorInference -Xswiftc -enable-upcoming-feature -Xswiftc GlobalActorIsolatedTypesUsability -Xswiftc -enable-upcoming-feature -Xswiftc InferSendableFromCaptures
Building for debugging...
[0/2] Write sources
[1/2] Write swift-version-2F0A5646E1D333AE.txt
[3/5] Compiling WebView WebViewStore.swift
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:17:17: warning: main actor-isolated default value in a nonisolated context; this is an error in the Swift 6 language mode
15 |     /// Initializes a new WebView.
16 |     /// - Parameter webView: Optional custom webview. Default WKWebView will be constructed if not provided.
17 |     public init(webView: WKWebView = .init()) {
   |                 `- warning: main actor-isolated default value in a nonisolated context; this is an error in the Swift 6 language mode
18 |         self.webView = webView
19 |
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:23:14: warning: main actor-isolated property 'preferences' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
21 |         self.webView
22 |             .configuration
23 |             .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
24 |             .setValue(true, forKey: "developerExtrasEnabled")
25 |         #endif
/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebViewConfiguration.h:114:46: note: property declared here
112 | /*! @abstract The preference settings to be used by the web view.
113 | */
114 | @property (nonatomic, strong) WKPreferences *preferences;
    |                                              `- note: property declared here
115 |
116 | /*! @abstract The user content controller to associate with the web view.
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:22:14: warning: main actor-isolated property 'configuration' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
20 |         #if DEBUG
21 |         self.webView
22 |             .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
23 |             .preferences
24 |             .setValue(true, forKey: "developerExtrasEnabled")
/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebView.h:91:63: note: property declared here
 89 | /*! @abstract A copy of the configuration with which the web view was
 90 |  initialized. */
 91 | @property (nonatomic, readonly, copy) WKWebViewConfiguration *configuration;
    |                                                               `- note: property declared here
 92 |
 93 | /*! @abstract The web view's navigation delegate. */
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:51:21: warning: capture of 'self' with non-sendable type 'WebViewStore' in a '@Sendable' closure
 3 |
 4 | /// Provides access to webview data.
 5 | public class WebViewStore: ObservableObject {
   |              `- note: class 'WebViewStore' does not conform to the 'Sendable' protocol
 6 |     private var observers = Set<NSKeyValueObservation>()
 7 |
   :
49 |             return webView.observe(keyPath, options: [.prior]) { _, change in
50 |                 if change.isPrior {
51 |                     self.objectWillChange.send()
   |                     `- warning: capture of 'self' with non-sendable type 'WebViewStore' in a '@Sendable' closure
52 |                 }
53 |             }
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:58:31: warning: cannot form key path to main actor-isolated property 'title'; this is an error in the Swift 6 language mode
56 |         // Observers for all KVO compliant properties
57 |         observers = [
58 |             subscriber(for: \.title),
   |                               `- warning: cannot form key path to main actor-isolated property 'title'; this is an error in the Swift 6 language mode
59 |             subscriber(for: \.url),
60 |             subscriber(for: \.isLoading),
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:59:31: warning: cannot form key path to main actor-isolated property 'url'; this is an error in the Swift 6 language mode
57 |         observers = [
58 |             subscriber(for: \.title),
59 |             subscriber(for: \.url),
   |                               `- warning: cannot form key path to main actor-isolated property 'url'; this is an error in the Swift 6 language mode
60 |             subscriber(for: \.isLoading),
61 |             subscriber(for: \.estimatedProgress),
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:60:31: warning: cannot form key path to main actor-isolated property 'isLoading'; this is an error in the Swift 6 language mode
58 |             subscriber(for: \.title),
59 |             subscriber(for: \.url),
60 |             subscriber(for: \.isLoading),
   |                               `- warning: cannot form key path to main actor-isolated property 'isLoading'; this is an error in the Swift 6 language mode
61 |             subscriber(for: \.estimatedProgress),
62 |             subscriber(for: \.hasOnlySecureContent),
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:61:31: warning: cannot form key path to main actor-isolated property 'estimatedProgress'; this is an error in the Swift 6 language mode
59 |             subscriber(for: \.url),
60 |             subscriber(for: \.isLoading),
61 |             subscriber(for: \.estimatedProgress),
   |                               `- warning: cannot form key path to main actor-isolated property 'estimatedProgress'; this is an error in the Swift 6 language mode
62 |             subscriber(for: \.hasOnlySecureContent),
63 |             subscriber(for: \.serverTrust),
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:62:31: warning: cannot form key path to main actor-isolated property 'hasOnlySecureContent'; this is an error in the Swift 6 language mode
60 |             subscriber(for: \.isLoading),
61 |             subscriber(for: \.estimatedProgress),
62 |             subscriber(for: \.hasOnlySecureContent),
   |                               `- warning: cannot form key path to main actor-isolated property 'hasOnlySecureContent'; this is an error in the Swift 6 language mode
63 |             subscriber(for: \.serverTrust),
64 |             subscriber(for: \.canGoBack),
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:63:31: warning: cannot form key path to main actor-isolated property 'serverTrust'; this is an error in the Swift 6 language mode
61 |             subscriber(for: \.estimatedProgress),
62 |             subscriber(for: \.hasOnlySecureContent),
63 |             subscriber(for: \.serverTrust),
   |                               `- warning: cannot form key path to main actor-isolated property 'serverTrust'; this is an error in the Swift 6 language mode
64 |             subscriber(for: \.canGoBack),
65 |             subscriber(for: \.canGoForward)
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:64:31: warning: cannot form key path to main actor-isolated property 'canGoBack'; this is an error in the Swift 6 language mode
62 |             subscriber(for: \.hasOnlySecureContent),
63 |             subscriber(for: \.serverTrust),
64 |             subscriber(for: \.canGoBack),
   |                               `- warning: cannot form key path to main actor-isolated property 'canGoBack'; this is an error in the Swift 6 language mode
65 |             subscriber(for: \.canGoForward)
66 |         ]
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:65:31: warning: cannot form key path to main actor-isolated property 'canGoForward'; this is an error in the Swift 6 language mode
63 |             subscriber(for: \.serverTrust),
64 |             subscriber(for: \.canGoBack),
65 |             subscriber(for: \.canGoForward)
   |                               `- warning: cannot form key path to main actor-isolated property 'canGoForward'; this is an error in the Swift 6 language mode
66 |         ]
67 |     }
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:77: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
74 |     ///   - html: HTML string of the new document.
75 |     ///   - baseURL: Optional base URL.
76 |     func update(_ html: String, baseURL: URL? = nil) {
   |          `- note: add '@MainActor' to make instance method 'update(_:baseURL:)' part of global actor 'MainActor'
77 |         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
78 |             guard let strongSelf = self else { return }
79 |
WebKit.WKWebView.evaluateJavaScript:2:22: note: calls to instance method 'evaluateJavaScript(_:completionHandler:)' from outside of its actor context are implicitly asynchronous
1 | class WKWebView {
2 | @MainActor 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
3 |
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:92: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
88 |     /// Instructs the webview to scroll the viewport.
89 |     /// - Parameter yOffset: Vertical offset to scroll to.
90 |     private func scrollTo(_ yOffset: Int) {
   |                  `- note: add '@MainActor' to make instance method 'scrollTo' part of global actor 'MainActor'
91 |         let script = "window.scrollTo(0, \(yOffset));"
92 |         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
93 |         webView.configuration.userContentController.addUserScript(scrollScript)
94 |     }
/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKUserScript.h:64:1: note: calls to initializer 'init(source:injectionTime:forMainFrameOnly:)' from outside of its actor context are implicitly asynchronous
62 |  @discussion Calling this method is the same as calling `initWithSource:injectionTime:forMainFrameOnly:inContentWorld:` with a `contentWorld` value of `WKContentWorld.pageWorld`
63 |  */
64 | - (instancetype)initWithSource:(NSString *)source injectionTime:(WKUserScriptInjectionTime)injectionTime forMainFrameOnly:(BOOL)forMainFrameOnly;
   | `- note: calls to initializer 'init(source:injectionTime:forMainFrameOnly:)' from outside of its actor context are implicitly asynchronous
65 |
66 | /*! @abstract Returns an initialized user script that can be added to a @link WKUserContentController @/link.
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:93:53: warning: call to main actor-isolated instance method 'addUserScript' in a synchronous nonisolated context; this is an error in the Swift 6 language mode
88 |     /// Instructs the webview to scroll the viewport.
89 |     /// - Parameter yOffset: Vertical offset to scroll to.
90 |     private func scrollTo(_ yOffset: Int) {
   |                  `- note: add '@MainActor' to make instance method 'scrollTo' part of global actor 'MainActor'
91 |         let script = "window.scrollTo(0, \(yOffset));"
92 |         let scrollScript = WKUserScript(source: script, injectionTime: .atDocumentEnd, forMainFrameOnly: true)
93 |         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
94 |     }
95 | }
WebKit.WKUserContentController.addUserScript:2:22: note: calls to instance method 'addUserScript' from outside of its actor context are implicitly asynchronous
1 | class WKUserContentController {
2 | @MainActor open func addUserScript(_ userScript: WKUserScript)}
  |                      `- note: calls to instance method 'addUserScript' from outside of its actor context are implicitly asynchronous
3 |
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:93:31: warning: main actor-isolated property 'userContentController' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
88 |     /// Instructs the webview to scroll the viewport.
89 |     /// - Parameter yOffset: Vertical offset to scroll to.
90 |     private func scrollTo(_ yOffset: Int) {
   |                  `- note: add '@MainActor' to make instance method 'scrollTo' part of global actor 'MainActor'
91 |         let script = "window.scrollTo(0, \(yOffset));"
92 |         let scrollScript = WKUserScript(source: script, injectionTime: .atDocumentEnd, forMainFrameOnly: true)
93 |         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
94 |     }
95 | }
/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebViewConfiguration.h:118:56: note: property declared here
116 | /*! @abstract The user content controller to associate with the web view.
117 | */
118 | @property (nonatomic, strong) WKUserContentController *userContentController;
    |                                                        `- note: property declared here
119 |
120 | /*! @abstract The web extension controller to associate with the web view.
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:93:17: warning: main actor-isolated property 'configuration' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
88 |     /// Instructs the webview to scroll the viewport.
89 |     /// - Parameter yOffset: Vertical offset to scroll to.
90 |     private func scrollTo(_ yOffset: Int) {
   |                  `- note: add '@MainActor' to make instance method 'scrollTo' part of global actor 'MainActor'
91 |         let script = "window.scrollTo(0, \(yOffset));"
92 |         let scrollScript = WKUserScript(source: script, injectionTime: .atDocumentEnd, forMainFrameOnly: true)
93 |         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
94 |     }
95 | }
/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebView.h:91:63: note: property declared here
 89 | /*! @abstract A copy of the configuration with which the web view was
 90 |  initialized. */
 91 | @property (nonatomic, readonly, copy) WKWebViewConfiguration *configuration;
    |                                                               `- note: property declared here
 92 |
 93 | /*! @abstract The web view's navigation delegate. */
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:78:36: warning: sending 'self' risks causing data races; this is an error in the Swift 6 language mode
76 |     func update(_ html: String, baseURL: URL? = nil) {
77 |         webView.evaluateJavaScript("window.pageYOffset") { [weak self] object, error in
78 |             guard let strongSelf = self else { return }
   |                                    |- warning: sending 'self' risks causing data races; this is an error in the Swift 6 language mode
   |                                    `- note: task-isolated 'self' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
79 |
80 |             strongSelf.webView.loadHTMLString(html, baseURL: baseURL)
[4/5] Emitting module WebView
/Users/admin/builder/spi-builder-workspace/Sources/WebView/WebViewStore.swift:17:17: warning: main actor-isolated default value in a nonisolated context; this is an error in the Swift 6 language mode
15 |     /// Initializes a new WebView.
16 |     /// - Parameter webView: Optional custom webview. Default WKWebView will be constructed if not provided.
17 |     public init(webView: WKWebView = .init()) {
   |                 `- warning: main actor-isolated default value in a nonisolated context; this is an error in the Swift 6 language mode
18 |         self.webView = webView
19 |
[5/5] Compiling WebView WebView.swift
Build complete! (8.49s)
Build complete.
{
  "dependencies" : [
  ],
  "manifest_display_name" : "WebView",
  "name" : "WebView",
  "path" : "/Users/admin/builder/spi-builder-workspace",
  "platforms" : [
    {
      "name" : "ios",
      "version" : "13.0"
    },
    {
      "name" : "macos",
      "version" : "10.15"
    }
  ],
  "products" : [
    {
      "name" : "WebView",
      "targets" : [
        "WebView"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "WebViewTests",
      "module_type" : "SwiftTarget",
      "name" : "WebViewTests",
      "path" : "Tests/WebViewTests",
      "sources" : [
        "WebViewTests.swift"
      ],
      "target_dependencies" : [
        "WebView"
      ],
      "type" : "test"
    },
    {
      "c99name" : "WebView",
      "module_type" : "SwiftTarget",
      "name" : "WebView",
      "path" : "Sources/WebView",
      "product_memberships" : [
        "WebView"
      ],
      "sources" : [
        "WebView.swift",
        "WebViewStore.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.2"
}
Done.