Build Information
Successful build of KVObserver with Swift 6.0 for macOS (SPM).
Swift 6 data race errors: 2
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/Frizlab/KVObserver.git
Reference: main
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/.git/
From https://github.com/Frizlab/KVObserver
* branch main -> FETCH_HEAD
* [new branch] main -> origin/main
HEAD is now at 478e517 Dummy comment fixes
Cloned https://github.com/Frizlab/KVObserver.git
Revision (git rev-parse @):
478e517176a7c6e3c4ae524079a28a1ab7d602db
SUCCESS checkout https://github.com/Frizlab/KVObserver.git at main
========================================
Build
========================================
Selected platform: macosSpm
Swift version: 6.0
Building package at path: $workDir
https://github.com/Frizlab/KVObserver.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/6] Compiling KVObserver KVTreeObserver.swift
[4/6] Compiling KVObserver Loggers.swift
/Users/admin/builder/spi-builder-workspace/Sources/KVObserver/Private/Loggers.swift:8:13: warning: static property 'kvObserver' is not concurrency-safe because non-'Sendable' type 'OSLog' may have shared mutable state; this is an error in the Swift 6 language mode
6 | extension OSLog {
7 |
8 | static let kvObserver = {
| `- warning: static property 'kvObserver' is not concurrency-safe because non-'Sendable' type 'OSLog' may have shared mutable state; this is an error in the Swift 6 language mode
9 | return OSLog(subsystem: loggerSubsystem, category: "KVObserver")
10 | }()
os.OSLog:1:12: note: class 'OSLog' does not conform to the 'Sendable' protocol
1 | open class OSLog : NSObject {
| `- note: class 'OSLog' does not conform to the 'Sendable' protocol
2 | @available(*, unavailable, message: "Unavailable in Swift")
3 | public init!()
/Users/admin/builder/spi-builder-workspace/Sources/KVObserver/Private/Loggers.swift:2:1: warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'os'
1 | import Foundation
2 | import os.log
| `- warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'os'
3 |
4 |
:
6 | extension OSLog {
7 |
8 | static let kvObserver = {
| |- note: annotate 'kvObserver' 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
9 | return OSLog(subsystem: loggerSubsystem, category: "KVObserver")
10 | }()
/Users/admin/builder/spi-builder-workspace/Sources/KVObserver/Private/Loggers.swift:12:13: warning: static property 'kvTreeObserver' is not concurrency-safe because non-'Sendable' type 'OSLog' may have shared mutable state; this is an error in the Swift 6 language mode
10 | }()
11 |
12 | static let kvTreeObserver = {
| |- warning: static property 'kvTreeObserver' is not concurrency-safe because non-'Sendable' type 'OSLog' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'kvTreeObserver' 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
13 | return OSLog(subsystem: loggerSubsystem, category: "KVTreeObserver")
14 | }()
os.OSLog:1:12: note: class 'OSLog' does not conform to the 'Sendable' protocol
1 | open class OSLog : NSObject {
| `- note: class 'OSLog' does not conform to the 'Sendable' protocol
2 | @available(*, unavailable, message: "Unavailable in Swift")
3 | public init!()
[5/6] Emitting module KVObserver
/Users/admin/builder/spi-builder-workspace/Sources/KVObserver/Private/Loggers.swift:8:13: warning: static property 'kvObserver' is not concurrency-safe because non-'Sendable' type 'OSLog' may have shared mutable state; this is an error in the Swift 6 language mode
6 | extension OSLog {
7 |
8 | static let kvObserver = {
| `- warning: static property 'kvObserver' is not concurrency-safe because non-'Sendable' type 'OSLog' may have shared mutable state; this is an error in the Swift 6 language mode
9 | return OSLog(subsystem: loggerSubsystem, category: "KVObserver")
10 | }()
os.OSLog:1:12: note: class 'OSLog' does not conform to the 'Sendable' protocol
1 | open class OSLog : NSObject {
| `- note: class 'OSLog' does not conform to the 'Sendable' protocol
2 | @available(*, unavailable, message: "Unavailable in Swift")
3 | public init!()
/Users/admin/builder/spi-builder-workspace/Sources/KVObserver/Private/Loggers.swift:2:1: warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'os'
1 | import Foundation
2 | import os.log
| `- warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'os'
3 |
4 |
:
6 | extension OSLog {
7 |
8 | static let kvObserver = {
| |- note: annotate 'kvObserver' 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
9 | return OSLog(subsystem: loggerSubsystem, category: "KVObserver")
10 | }()
/Users/admin/builder/spi-builder-workspace/Sources/KVObserver/Private/Loggers.swift:12:13: warning: static property 'kvTreeObserver' is not concurrency-safe because non-'Sendable' type 'OSLog' may have shared mutable state; this is an error in the Swift 6 language mode
10 | }()
11 |
12 | static let kvTreeObserver = {
| |- warning: static property 'kvTreeObserver' is not concurrency-safe because non-'Sendable' type 'OSLog' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'kvTreeObserver' 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
13 | return OSLog(subsystem: loggerSubsystem, category: "KVTreeObserver")
14 | }()
os.OSLog:1:12: note: class 'OSLog' does not conform to the 'Sendable' protocol
1 | open class OSLog : NSObject {
| `- note: class 'OSLog' does not conform to the 'Sendable' protocol
2 | @available(*, unavailable, message: "Unavailable in Swift")
3 | public init!()
[6/6] Compiling KVObserver KVObserver.swift
/Users/admin/builder/spi-builder-workspace/Sources/KVObserver/KVObserver.swift:204:77: warning: capture of 'self' with non-sendable type 'KVObserver.KVOContext' in a `@Sendable` closure; this is an error in the Swift 6 language mode
154 | /* Two contexts are equal iff the observed objects and key paths of the contexts are the same.
155 | * If any of the observed objects has been deallocated the contexts are considered different. */
156 | private final class KVOContext : Equatable {
| `- note: class 'KVOContext' does not conform to the 'Sendable' protocol
157 |
158 | static func ==(lhs: KVObserver.KVOContext, rhs: KVObserver.KVOContext) -> Bool {
:
202 |
203 | case (.unsafeSync(let queue), _): queue.sync{ self.handler(change) }
204 | case (.async(let queue), _): queue.async{ self.handler(change) }
| `- warning: capture of 'self' with non-sendable type 'KVObserver.KVOContext' in a `@Sendable` closure; this is an error in the Swift 6 language mode
205 | case (.asyncOnMainQueue, _): DispatchQueue.main.async{ self.handler(change) }
206 | case (.asyncDirectInitial(let queue), false): queue.async{ self.handler(change) }
/Users/admin/builder/spi-builder-workspace/Sources/KVObserver/KVObserver.swift:204:90: warning: capture of 'change' with non-sendable type '[NSKeyValueChangeKey : Any]?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
202 |
203 | case (.unsafeSync(let queue), _): queue.sync{ self.handler(change) }
204 | case (.async(let queue), _): queue.async{ self.handler(change) }
| `- warning: capture of 'change' with non-sendable type '[NSKeyValueChangeKey : Any]?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
205 | case (.asyncOnMainQueue, _): DispatchQueue.main.async{ self.handler(change) }
206 | case (.asyncDirectInitial(let queue), false): queue.async{ self.handler(change) }
/Users/admin/builder/spi-builder-workspace/Sources/KVObserver/KVObserver.swift:205:77: warning: capture of 'self' with non-sendable type 'KVObserver.KVOContext' in a `@Sendable` closure; this is an error in the Swift 6 language mode
154 | /* Two contexts are equal iff the observed objects and key paths of the contexts are the same.
155 | * If any of the observed objects has been deallocated the contexts are considered different. */
156 | private final class KVOContext : Equatable {
| `- note: class 'KVOContext' does not conform to the 'Sendable' protocol
157 |
158 | static func ==(lhs: KVObserver.KVOContext, rhs: KVObserver.KVOContext) -> Bool {
:
203 | case (.unsafeSync(let queue), _): queue.sync{ self.handler(change) }
204 | case (.async(let queue), _): queue.async{ self.handler(change) }
205 | case (.asyncOnMainQueue, _): DispatchQueue.main.async{ self.handler(change) }
| `- warning: capture of 'self' with non-sendable type 'KVObserver.KVOContext' in a `@Sendable` closure; this is an error in the Swift 6 language mode
206 | case (.asyncDirectInitial(let queue), false): queue.async{ self.handler(change) }
207 | case (.asyncOnMainQueueDirectInitial, false): DispatchQueue.main.async{ self.handler(change) }
/Users/admin/builder/spi-builder-workspace/Sources/KVObserver/KVObserver.swift:205:90: warning: capture of 'change' with non-sendable type '[NSKeyValueChangeKey : Any]?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
203 | case (.unsafeSync(let queue), _): queue.sync{ self.handler(change) }
204 | case (.async(let queue), _): queue.async{ self.handler(change) }
205 | case (.asyncOnMainQueue, _): DispatchQueue.main.async{ self.handler(change) }
| `- warning: capture of 'change' with non-sendable type '[NSKeyValueChangeKey : Any]?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
206 | case (.asyncDirectInitial(let queue), false): queue.async{ self.handler(change) }
207 | case (.asyncOnMainQueueDirectInitial, false): DispatchQueue.main.async{ self.handler(change) }
/Users/admin/builder/spi-builder-workspace/Sources/KVObserver/KVObserver.swift:206:77: warning: capture of 'self' with non-sendable type 'KVObserver.KVOContext' in a `@Sendable` closure; this is an error in the Swift 6 language mode
154 | /* Two contexts are equal iff the observed objects and key paths of the contexts are the same.
155 | * If any of the observed objects has been deallocated the contexts are considered different. */
156 | private final class KVOContext : Equatable {
| `- note: class 'KVOContext' does not conform to the 'Sendable' protocol
157 |
158 | static func ==(lhs: KVObserver.KVOContext, rhs: KVObserver.KVOContext) -> Bool {
:
204 | case (.async(let queue), _): queue.async{ self.handler(change) }
205 | case (.asyncOnMainQueue, _): DispatchQueue.main.async{ self.handler(change) }
206 | case (.asyncDirectInitial(let queue), false): queue.async{ self.handler(change) }
| `- warning: capture of 'self' with non-sendable type 'KVObserver.KVOContext' in a `@Sendable` closure; this is an error in the Swift 6 language mode
207 | case (.asyncOnMainQueueDirectInitial, false): DispatchQueue.main.async{ self.handler(change) }
208 | case (.directOrAsyncOnMainQueue, _):
/Users/admin/builder/spi-builder-workspace/Sources/KVObserver/KVObserver.swift:206:90: warning: capture of 'change' with non-sendable type '[NSKeyValueChangeKey : Any]?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
204 | case (.async(let queue), _): queue.async{ self.handler(change) }
205 | case (.asyncOnMainQueue, _): DispatchQueue.main.async{ self.handler(change) }
206 | case (.asyncDirectInitial(let queue), false): queue.async{ self.handler(change) }
| `- warning: capture of 'change' with non-sendable type '[NSKeyValueChangeKey : Any]?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
207 | case (.asyncOnMainQueueDirectInitial, false): DispatchQueue.main.async{ self.handler(change) }
208 | case (.directOrAsyncOnMainQueue, _):
/Users/admin/builder/spi-builder-workspace/Sources/KVObserver/KVObserver.swift:207:77: warning: capture of 'self' with non-sendable type 'KVObserver.KVOContext' in a `@Sendable` closure; this is an error in the Swift 6 language mode
154 | /* Two contexts are equal iff the observed objects and key paths of the contexts are the same.
155 | * If any of the observed objects has been deallocated the contexts are considered different. */
156 | private final class KVOContext : Equatable {
| `- note: class 'KVOContext' does not conform to the 'Sendable' protocol
157 |
158 | static func ==(lhs: KVObserver.KVOContext, rhs: KVObserver.KVOContext) -> Bool {
:
205 | case (.asyncOnMainQueue, _): DispatchQueue.main.async{ self.handler(change) }
206 | case (.asyncDirectInitial(let queue), false): queue.async{ self.handler(change) }
207 | case (.asyncOnMainQueueDirectInitial, false): DispatchQueue.main.async{ self.handler(change) }
| `- warning: capture of 'self' with non-sendable type 'KVObserver.KVOContext' in a `@Sendable` closure; this is an error in the Swift 6 language mode
208 | case (.directOrAsyncOnMainQueue, _):
209 | if Thread.isMainThread {handler(change)}
/Users/admin/builder/spi-builder-workspace/Sources/KVObserver/KVObserver.swift:207:90: warning: capture of 'change' with non-sendable type '[NSKeyValueChangeKey : Any]?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
205 | case (.asyncOnMainQueue, _): DispatchQueue.main.async{ self.handler(change) }
206 | case (.asyncDirectInitial(let queue), false): queue.async{ self.handler(change) }
207 | case (.asyncOnMainQueueDirectInitial, false): DispatchQueue.main.async{ self.handler(change) }
| `- warning: capture of 'change' with non-sendable type '[NSKeyValueChangeKey : Any]?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
208 | case (.directOrAsyncOnMainQueue, _):
209 | if Thread.isMainThread {handler(change)}
/Users/admin/builder/spi-builder-workspace/Sources/KVObserver/KVObserver.swift:210:56: warning: capture of 'self' with non-sendable type 'KVObserver.KVOContext' in a `@Sendable` closure; this is an error in the Swift 6 language mode
154 | /* Two contexts are equal iff the observed objects and key paths of the contexts are the same.
155 | * If any of the observed objects has been deallocated the contexts are considered different. */
156 | private final class KVOContext : Equatable {
| `- note: class 'KVOContext' does not conform to the 'Sendable' protocol
157 |
158 | static func ==(lhs: KVObserver.KVOContext, rhs: KVObserver.KVOContext) -> Bool {
:
208 | case (.directOrAsyncOnMainQueue, _):
209 | if Thread.isMainThread {handler(change)}
210 | else {DispatchQueue.main.async{ self.handler(change) }}
| `- warning: capture of 'self' with non-sendable type 'KVObserver.KVOContext' in a `@Sendable` closure; this is an error in the Swift 6 language mode
211 |
212 | case (.coreDataSync(let context), _): context.performAndWait{ self.handler(change) }
/Users/admin/builder/spi-builder-workspace/Sources/KVObserver/KVObserver.swift:210:69: warning: capture of 'change' with non-sendable type '[NSKeyValueChangeKey : Any]?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
208 | case (.directOrAsyncOnMainQueue, _):
209 | if Thread.isMainThread {handler(change)}
210 | else {DispatchQueue.main.async{ self.handler(change) }}
| `- warning: capture of 'change' with non-sendable type '[NSKeyValueChangeKey : Any]?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
211 |
212 | case (.coreDataSync(let context), _): context.performAndWait{ self.handler(change) }
/Users/admin/builder/spi-builder-workspace/Sources/KVObserver/KVObserver.swift:207:77: warning: sending 'self' risks causing data races; this is an error in the Swift 6 language mode
205 | case (.asyncOnMainQueue, _): DispatchQueue.main.async{ self.handler(change) }
206 | case (.asyncDirectInitial(let queue), false): queue.async{ self.handler(change) }
207 | case (.asyncOnMainQueueDirectInitial, false): DispatchQueue.main.async{ self.handler(change) }
| |- 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
208 | case (.directOrAsyncOnMainQueue, _):
209 | if Thread.isMainThread {handler(change)}
/Users/admin/builder/spi-builder-workspace/Sources/KVObserver/KVObserver.swift:207:90: warning: sending 'change' risks causing data races; this is an error in the Swift 6 language mode
205 | case (.asyncOnMainQueue, _): DispatchQueue.main.async{ self.handler(change) }
206 | case (.asyncDirectInitial(let queue), false): queue.async{ self.handler(change) }
207 | case (.asyncOnMainQueueDirectInitial, false): DispatchQueue.main.async{ self.handler(change) }
| |- warning: sending 'change' risks causing data races; this is an error in the Swift 6 language mode
| `- note: task-isolated 'change' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
208 | case (.directOrAsyncOnMainQueue, _):
209 | if Thread.isMainThread {handler(change)}
/Users/admin/builder/spi-builder-workspace/Sources/KVObserver/KVObserver.swift:205:77: warning: sending 'self' risks causing data races; this is an error in the Swift 6 language mode
203 | case (.unsafeSync(let queue), _): queue.sync{ self.handler(change) }
204 | case (.async(let queue), _): queue.async{ self.handler(change) }
205 | case (.asyncOnMainQueue, _): DispatchQueue.main.async{ self.handler(change) }
| |- 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
206 | case (.asyncDirectInitial(let queue), false): queue.async{ self.handler(change) }
207 | case (.asyncOnMainQueueDirectInitial, false): DispatchQueue.main.async{ self.handler(change) }
/Users/admin/builder/spi-builder-workspace/Sources/KVObserver/KVObserver.swift:205:90: warning: sending 'change' risks causing data races; this is an error in the Swift 6 language mode
203 | case (.unsafeSync(let queue), _): queue.sync{ self.handler(change) }
204 | case (.async(let queue), _): queue.async{ self.handler(change) }
205 | case (.asyncOnMainQueue, _): DispatchQueue.main.async{ self.handler(change) }
| |- warning: sending 'change' risks causing data races; this is an error in the Swift 6 language mode
| `- note: task-isolated 'change' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
206 | case (.asyncDirectInitial(let queue), false): queue.async{ self.handler(change) }
207 | case (.asyncOnMainQueueDirectInitial, false): DispatchQueue.main.async{ self.handler(change) }
/Users/admin/builder/spi-builder-workspace/Sources/KVObserver/KVObserver.swift:210:56: warning: sending 'self' risks causing data races; this is an error in the Swift 6 language mode
208 | case (.directOrAsyncOnMainQueue, _):
209 | if Thread.isMainThread {handler(change)}
210 | else {DispatchQueue.main.async{ self.handler(change) }}
| |- 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
211 |
212 | case (.coreDataSync(let context), _): context.performAndWait{ self.handler(change) }
/Users/admin/builder/spi-builder-workspace/Sources/KVObserver/KVObserver.swift:210:69: warning: sending 'change' risks causing data races; this is an error in the Swift 6 language mode
208 | case (.directOrAsyncOnMainQueue, _):
209 | if Thread.isMainThread {handler(change)}
210 | else {DispatchQueue.main.async{ self.handler(change) }}
| |- warning: sending 'change' risks causing data races; this is an error in the Swift 6 language mode
| `- note: task-isolated 'change' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
211 |
212 | case (.coreDataSync(let context), _): context.performAndWait{ self.handler(change) }
Build complete! (17.83s)
Build complete.
{
"dependencies" : [
],
"manifest_display_name" : "KVObserver",
"name" : "KVObserver",
"path" : "/Users/admin/builder/spi-builder-workspace",
"platforms" : [
],
"products" : [
{
"name" : "KVObserver",
"targets" : [
"KVObserver"
],
"type" : {
"library" : [
"automatic"
]
}
}
],
"targets" : [
{
"c99name" : "KVObserverTests",
"module_type" : "SwiftTarget",
"name" : "KVObserverTests",
"path" : "Tests/KVObserverTests",
"sources" : [
"Helpers/AutoObservedNSManagedObject.swift",
"Helpers/AutoObservedObject.swift",
"Helpers/ObservedObject.swift",
"KVObserverTests.swift"
],
"target_dependencies" : [
"KVObserver"
],
"type" : "test"
},
{
"c99name" : "KVObserver",
"module_type" : "SwiftTarget",
"name" : "KVObserver",
"path" : "Sources/KVObserver",
"product_memberships" : [
"KVObserver"
],
"sources" : [
"KVObserver.swift",
"KVTreeObserver.swift",
"Private/Loggers.swift"
],
"type" : "library"
}
],
"tools_version" : "5.0"
}
Done.