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 SwiftEventBus, reference master (a30ff3), with Swift 6.0 for Linux on 29 Nov 2024 04:53:24 UTC.

Swift 6 data race errors: 1

Build Command

bash -c docker run --pull=always --rm -v "checkouts-4609320-0":/host -w "$PWD" registry.gitlab.com/finestructure/spi-images:basic-6.0-latest swift build --triple x86_64-unknown-linux-gnu -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 2>&1

Build Log

========================================
RunAll
========================================
Builder version: 4.58.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/cesarferreira/SwiftEventBus.git
Reference: master
Initialized empty Git repository in /host/spi-builder-workspace/.git/
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: 	git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: 	git branch -m <name>
From https://github.com/cesarferreira/SwiftEventBus
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> origin/master
HEAD is now at a30ff35 bumped to 5.1.0
Cloned https://github.com/cesarferreira/SwiftEventBus.git
Revision (git rev-parse @):
a30ff35e616f507d8a8d122dac32a2150371a87e
SUCCESS checkout https://github.com/cesarferreira/SwiftEventBus.git at master
========================================
Build
========================================
Selected platform:         linux
Swift version:             6.0
Building package at path:  $PWD
https://github.com/cesarferreira/SwiftEventBus.git
Running build ...
bash -c docker run --pull=always --rm -v "checkouts-4609320-0":/host -w "$PWD" registry.gitlab.com/finestructure/spi-images:basic-6.0-latest swift build --triple x86_64-unknown-linux-gnu -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 2>&1
basic-6.0-latest: Pulling from finestructure/spi-images
Digest: sha256:47d26c99ca4f1ac0a332c85fd5b13ff4390e72115219984a57a68fe9d1063a05
Status: Image is up to date for registry.gitlab.com/finestructure/spi-images:basic-6.0-latest
Building for debugging...
[0/2] Write sources
[1/2] Write swift-version-24593BA9C3E375BF.txt
[3/4] Emitting module SwiftEventBus
/host/spi-builder-workspace/SwiftEventBus/SwiftEventBus.swift:6:20: warning: static property 'instance' is not concurrency-safe because non-'Sendable' type 'SwiftEventBus' may have shared mutable state; this is an error in the Swift 6 language mode
  1 | import Foundation
  2 |
  3 | open class SwiftEventBus {
    |            `- note: class 'SwiftEventBus' does not conform to the 'Sendable' protocol
  4 |
  5 |     struct Static {
  6 |         static let instance = SwiftEventBus()
    |                    |- warning: static property 'instance' is not concurrency-safe because non-'Sendable' type 'SwiftEventBus' may have shared mutable state; this is an error in the Swift 6 language mode
    |                    |- note: annotate 'instance' 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
  7 |         static let queue = DispatchQueue(label: "com.cesarferreira.SwiftEventBus", attributes: [])
  8 |     }
[4/4] Compiling SwiftEventBus SwiftEventBus.swift
/host/spi-builder-workspace/SwiftEventBus/SwiftEventBus.swift:6:20: warning: static property 'instance' is not concurrency-safe because non-'Sendable' type 'SwiftEventBus' may have shared mutable state; this is an error in the Swift 6 language mode
  1 | import Foundation
  2 |
  3 | open class SwiftEventBus {
    |            `- note: class 'SwiftEventBus' does not conform to the 'Sendable' protocol
  4 |
  5 |     struct Static {
  6 |         static let instance = SwiftEventBus()
    |                    |- warning: static property 'instance' is not concurrency-safe because non-'Sendable' type 'SwiftEventBus' may have shared mutable state; this is an error in the Swift 6 language mode
    |                    |- note: annotate 'instance' 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
  7 |         static let queue = DispatchQueue(label: "com.cesarferreira.SwiftEventBus", attributes: [])
  8 |     }
/host/spi-builder-workspace/SwiftEventBus/SwiftEventBus.swift:62:146: warning: passing non-sendable parameter 'handler' to function expecting a @Sendable closure
 58 |
 59 |     @discardableResult
 60 |     open class func on(_ target: AnyObject, name: String, sender: Any? = nil, queue: OperationQueue?, handler: @escaping ((Notification?) -> Void)) -> NSObjectProtocol {
    |                                                                                                       `- note: parameter 'handler' is implicitly non-sendable
 61 |         let id = UInt(bitPattern: ObjectIdentifier(target))
 62 |         let observer = NotificationCenter.default.addObserver(forName: NSNotification.Name(rawValue: name), object: sender, queue: queue, using: handler)
    |                                                                                                                                                  `- warning: passing non-sendable parameter 'handler' to function expecting a @Sendable closure
 63 |         let namedObserver = NamedObserver(observer: observer, name: name)
 64 |
/host/spi-builder-workspace/SwiftEventBus/SwiftEventBus.swift:37:94: warning: sending 'sender' risks causing data races; this is an error in the Swift 6 language mode
 35 |     open class func postToMainThread(_ name: String, sender: Any? = nil) {
 36 |         DispatchQueue.main.async {
 37 |             NotificationCenter.default.post(name: Notification.Name(rawValue: name), object: sender)
    |                                                                                              |- warning: sending 'sender' risks causing data races; this is an error in the Swift 6 language mode
    |                                                                                              `- note: task-isolated 'sender' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
 38 |         }
 39 |     }
/host/spi-builder-workspace/SwiftEventBus/SwiftEventBus.swift:43:94: warning: sending 'sender' risks causing data races; this is an error in the Swift 6 language mode
 41 |     open class func postToMainThread(_ name: String, sender: NSObject?) {
 42 |         DispatchQueue.main.async {
 43 |             NotificationCenter.default.post(name: Notification.Name(rawValue: name), object: sender)
    |                                                                                              |- warning: sending 'sender' risks causing data races; this is an error in the Swift 6 language mode
    |                                                                                              `- note: task-isolated 'sender' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
 44 |         }
 45 |     }
/host/spi-builder-workspace/SwiftEventBus/SwiftEventBus.swift:49:94: warning: sending 'sender' risks causing data races; this is an error in the Swift 6 language mode
 47 |     open class func postToMainThread(_ name: String, sender: Any? = nil, userInfo: [AnyHashable: Any]?) {
 48 |         DispatchQueue.main.async {
 49 |             NotificationCenter.default.post(name: Notification.Name(rawValue: name), object: sender, userInfo: userInfo)
    |                                                                                              |- warning: sending 'sender' risks causing data races; this is an error in the Swift 6 language mode
    |                                                                                              `- note: task-isolated 'sender' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
 50 |         }
 51 |     }
/host/spi-builder-workspace/SwiftEventBus/SwiftEventBus.swift:49:112: warning: sending 'userInfo' risks causing data races; this is an error in the Swift 6 language mode
 47 |     open class func postToMainThread(_ name: String, sender: Any? = nil, userInfo: [AnyHashable: Any]?) {
 48 |         DispatchQueue.main.async {
 49 |             NotificationCenter.default.post(name: Notification.Name(rawValue: name), object: sender, userInfo: userInfo)
    |                                                                                                                |- warning: sending 'userInfo' risks causing data races; this is an error in the Swift 6 language mode
    |                                                                                                                `- note: task-isolated 'userInfo' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
 50 |         }
 51 |     }
Build complete! (13.55s)
Build complete.
{
  "dependencies" : [
  ],
  "manifest_display_name" : "SwiftEventBus",
  "name" : "SwiftEventBus",
  "path" : "/host/spi-builder-workspace",
  "platforms" : [
    {
      "name" : "macos",
      "version" : "10.10"
    },
    {
      "name" : "ios",
      "version" : "10.0"
    }
  ],
  "products" : [
    {
      "name" : "SwiftEventBus",
      "targets" : [
        "SwiftEventBus"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "swift_languages_versions" : [
    "5"
  ],
  "targets" : [
    {
      "c99name" : "SwiftEventBus",
      "module_type" : "SwiftTarget",
      "name" : "SwiftEventBus",
      "path" : "SwiftEventBus",
      "product_memberships" : [
        "SwiftEventBus"
      ],
      "sources" : [
        "SwiftEventBus.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.3"
}
basic-6.0-latest: Pulling from finestructure/spi-images
Digest: sha256:47d26c99ca4f1ac0a332c85fd5b13ff4390e72115219984a57a68fe9d1063a05
Status: Image is up to date for registry.gitlab.com/finestructure/spi-images:basic-6.0-latest
Done.