Build Information
Successful build of SwiftEventBus 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/cesarferreira/SwiftEventBus.git
Reference: master
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/.git/
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: macosSpm
Swift version: 6.0
Building package at path: $workDir
https://github.com/cesarferreira/SwiftEventBus.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/2] Write sources
[1/2] Write swift-version-6F35C1178C84523A.txt
[3/4] Compiling SwiftEventBus SwiftEventBus.swift
/Users/admin/builder/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 | }
/Users/admin/builder/spi-builder-workspace/SwiftEventBus/SwiftEventBus.swift:37:94: warning: capture of 'sender' with non-sendable type 'Any?' in a `@Sendable` closure; 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: capture of 'sender' with non-sendable type 'Any?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
38 | }
39 | }
/Users/admin/builder/spi-builder-workspace/SwiftEventBus/SwiftEventBus.swift:43:94: warning: capture of 'sender' with non-sendable type 'NSObject?' in a `@Sendable` closure; 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: capture of 'sender' with non-sendable type 'NSObject?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
44 | }
45 | }
ObjectiveC.NSObject:2:12: note: class 'NSObject' does not conform to the 'Sendable' protocol
1 | @available(macOS 10.0, *)
2 | open class NSObject : NSObjectProtocol {
| `- note: class 'NSObject' does not conform to the 'Sendable' protocol
3 | open class func load()
4 | open class func initialize()
/Users/admin/builder/spi-builder-workspace/SwiftEventBus/SwiftEventBus.swift:1:1: warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'ObjectiveC'
1 | import Foundation
| `- warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'ObjectiveC'
2 |
3 | open class SwiftEventBus {
/Users/admin/builder/spi-builder-workspace/SwiftEventBus/SwiftEventBus.swift:49:94: warning: capture of 'sender' with non-sendable type 'Any?' in a `@Sendable` closure; 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: capture of 'sender' with non-sendable type 'Any?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
50 | }
51 | }
/Users/admin/builder/spi-builder-workspace/SwiftEventBus/SwiftEventBus.swift:49:112: warning: capture of 'userInfo' with non-sendable type '[AnyHashable : Any]?' in a `@Sendable` closure; 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: capture of 'userInfo' with non-sendable type '[AnyHashable : Any]?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
50 | }
51 | }
Swift.Optional:1:21: note: generic enum 'Optional' does not conform to the 'Sendable' protocol
1 | @frozen public enum Optional<Wrapped> : ~Copyable where Wrapped : ~Copyable {
| `- note: generic enum 'Optional' does not conform to the 'Sendable' protocol
2 | case none
3 | case some(Wrapped)
/Users/admin/builder/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 |
/Users/admin/builder/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 | }
/Users/admin/builder/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 | }
/Users/admin/builder/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 | }
/Users/admin/builder/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 | }
[4/4] Emitting module SwiftEventBus
/Users/admin/builder/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 | }
Build complete! (16.65s)
Build complete.
{
"dependencies" : [
],
"manifest_display_name" : "SwiftEventBus",
"name" : "SwiftEventBus",
"path" : "/Users/admin/builder/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"
}
Done.