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 Observable, reference 2.0.0 (d510e7), with Swift 6.0 for macOS (SPM) on 2 Nov 2024 15:55:12 UTC.

Swift 6 data race errors: 0

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/Flowduino/Observable.git
Reference: 2.0.0
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/.git/
From https://github.com/Flowduino/Observable
 * tag               2.0.0      -> FETCH_HEAD
HEAD is now at d510e71 Version 2.0.0
Cloned https://github.com/Flowduino/Observable.git
Revision (git rev-parse @):
d510e710900ea52bbfd9aa037addd708cbff526c
SUCCESS checkout https://github.com/Flowduino/Observable.git at 2.0.0
Fetching https://github.com/Flowduino/ThreadSafeSwift.git
[1/53] Fetching threadsafeswift
Fetched https://github.com/Flowduino/ThreadSafeSwift.git from cache (0.69s)
Computing version for https://github.com/Flowduino/ThreadSafeSwift.git
Computed https://github.com/Flowduino/ThreadSafeSwift.git at 1.1.0 (0.65s)
Creating working copy for https://github.com/Flowduino/ThreadSafeSwift.git
Working copy of https://github.com/Flowduino/ThreadSafeSwift.git resolved at 1.1.0
========================================
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": "observable",
      "name": "Observable",
      "url": "https://github.com/Flowduino/Observable.git",
      "version": "unspecified",
      "path": "/Users/admin/builder/spi-builder-workspace/.resolve-product-dependencies/.build/checkouts/Observable",
      "dependencies": [
        {
          "identity": "threadsafeswift",
          "name": "ThreadSafeSwift",
          "url": "https://github.com/Flowduino/ThreadSafeSwift.git",
          "version": "1.1.0",
          "path": "/Users/admin/builder/spi-builder-workspace/.resolve-product-dependencies/.build/checkouts/ThreadSafeSwift",
          "dependencies": [
          ]
        }
      ]
    }
  ]
}
Fetching https://github.com/Flowduino/Observable.git
[1/116] Fetching observable
Fetched https://github.com/Flowduino/Observable.git from cache (0.70s)
Fetching https://github.com/Flowduino/ThreadSafeSwift.git from cache
Fetched https://github.com/Flowduino/ThreadSafeSwift.git from cache (0.47s)
Computing version for https://github.com/Flowduino/ThreadSafeSwift.git
Computed https://github.com/Flowduino/ThreadSafeSwift.git at 1.1.0 (0.02s)
Creating working copy for https://github.com/Flowduino/ThreadSafeSwift.git
Working copy of https://github.com/Flowduino/ThreadSafeSwift.git resolved at 1.1.0
Creating working copy for https://github.com/Flowduino/Observable.git
Working copy of https://github.com/Flowduino/Observable.git resolved at 2.0.0 (d510e71)
warning: '.resolve-product-dependencies': dependency 'observable' is not used by any target
Found 1 product dependencies
  - ThreadSafeSwift
========================================
Build
========================================
Selected platform:         macosSpm
Swift version:             6.0
Building package at path:  $PWD
https://github.com/Flowduino/Observable.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/3] Write sources
[2/3] Write swift-version--7754E27361AE5C74.txt
[4/5] Emitting module ThreadSafeSwift
[5/5] Compiling ThreadSafeSwift ThreadSafeSemaphore.swift
[6/14] Compiling Observable ObservableClass.swift
[7/14] Compiling Observable Observable.swift
[8/14] Compiling Observable KeyedObservableThreadSafeClass.swift
[9/14] Compiling Observable KeyedObservableThread.swift
[10/14] Compiling Observable ObservableThreadSafeClass.swift
/Users/admin/builder/spi-builder-workspace/Sources/Observable/ObservableThreadSafeClass.swift:105:25: warning: capture of 'code' with non-sendable type '(TObservationProtocol) -> ()' in a `@Sendable` closure; this is an error in the Swift 6 language mode
103 |                     let dispatchQueue = observation.dispatchQueue ?? DispatchQueue.main
104 |                     dispatchQueue.async {
105 |                         code(typedObserver)
    |                         |- warning: capture of 'code' with non-sendable type '(TObservationProtocol) -> ()' in a `@Sendable` closure; this is an error in the Swift 6 language mode
    |                         `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
106 |                     }
107 |                 }
/Users/admin/builder/spi-builder-workspace/Sources/Observable/ObservableThreadSafeClass.swift:105:30: warning: capture of 'typedObserver' with non-sendable type 'TObservationProtocol' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 92 |      - Version: 1.0.6
 93 |      */
 94 |     public func withObservers<TObservationProtocol>(_ code: @escaping (_ observer: TObservationProtocol) -> ()) {
    |                               `- note: consider making generic parameter 'TObservationProtocol' conform to the 'Sendable' protocol
 95 |         _observers.withLock { observers in
 96 |             for (id, observation) in observers {
    :
103 |                     let dispatchQueue = observation.dispatchQueue ?? DispatchQueue.main
104 |                     dispatchQueue.async {
105 |                         code(typedObserver)
    |                              `- warning: capture of 'typedObserver' with non-sendable type 'TObservationProtocol' in a `@Sendable` closure; this is an error in the Swift 6 language mode
106 |                     }
107 |                 }
/Users/admin/builder/spi-builder-workspace/Sources/Observable/ObservableThreadSafeClass.swift:140:13: warning: capture of 'self' with non-sendable type 'ObservableThreadSafeClass' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 18 |  */
 19 | @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
 20 | open class ObservableThreadSafeClass: Observable, ObservableObject {
    |            `- note: class 'ObservableThreadSafeClass' does not conform to the 'Sendable' protocol
 21 |     /**
 22 |      Contains a Weak Reference to an Observer.
    :
138 |     open func notifyChange() async {
139 |         await MainActor.run {
140 |             objectWillChange.send()
    |             `- warning: capture of 'self' with non-sendable type 'ObservableThreadSafeClass' in a `@Sendable` closure; this is an error in the Swift 6 language mode
141 |         }
142 |     }
/Users/admin/builder/spi-builder-workspace/Sources/Observable/ObservableThreadSafeClass.swift:133:14: warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
131 |
132 |     open func notifyChange() {
133 |         Task {
    |              `- warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
134 |             await notifyChange()
    |                   `- note: closure captures 'self' which is accessible to code in the current task
135 |         }
136 |     }
/Users/admin/builder/spi-builder-workspace/Sources/Observable/ObservableThreadSafeClass.swift:140:13: warning: sending 'self' risks causing data races; this is an error in the Swift 6 language mode
138 |     open func notifyChange() async {
139 |         await MainActor.run {
140 |             objectWillChange.send()
    |             |- 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
141 |         }
142 |     }
[11/14] Compiling Observable ObservableThread.swift
/Users/admin/builder/spi-builder-workspace/Sources/Observable/ObservableThread.swift:105:25: warning: capture of 'code' with non-sendable type '(TObservationProtocol) -> ()' in a `@Sendable` closure; this is an error in the Swift 6 language mode
103 |                     let dispatchQueue = observation.dispatchQueue ?? DispatchQueue.main
104 |                     dispatchQueue.async {
105 |                         code(typedObserver)
    |                         |- warning: capture of 'code' with non-sendable type '(TObservationProtocol) -> ()' in a `@Sendable` closure; this is an error in the Swift 6 language mode
    |                         `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
106 |                     }
107 |                 }
/Users/admin/builder/spi-builder-workspace/Sources/Observable/ObservableThread.swift:105:30: warning: capture of 'typedObserver' with non-sendable type 'TObservationProtocol' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 92 |      - Version: 1.0.6
 93 |      */
 94 |     public func withObservers<TObservationProtocol>(_ code: @escaping (_ observer: TObservationProtocol) -> ()) {
    |                               `- note: consider making generic parameter 'TObservationProtocol' conform to the 'Sendable' protocol
 95 |         _observers.withLock { observers in
 96 |             for (id, observation) in observers {
    :
103 |                     let dispatchQueue = observation.dispatchQueue ?? DispatchQueue.main
104 |                     dispatchQueue.async {
105 |                         code(typedObserver)
    |                              `- warning: capture of 'typedObserver' with non-sendable type 'TObservationProtocol' in a `@Sendable` closure; this is an error in the Swift 6 language mode
106 |                     }
107 |                 }
/Users/admin/builder/spi-builder-workspace/Sources/Observable/ObservableThread.swift:140:13: warning: capture of 'self' with non-sendable type 'ObservableThread' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 18 |  */
 19 | @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
 20 | open class ObservableThread: Thread, Observable, ObservableObject {
    |            `- note: class 'ObservableThread' does not conform to the 'Sendable' protocol
 21 |     /**
 22 |      Contains a Weak Reference to an Observer.
    :
138 |     open func notifyChange() async {
139 |         await MainActor.run {
140 |             objectWillChange.send()
    |             `- warning: capture of 'self' with non-sendable type 'ObservableThread' in a `@Sendable` closure; this is an error in the Swift 6 language mode
141 |         }
142 |     }
/Users/admin/builder/spi-builder-workspace/Sources/Observable/ObservableThread.swift:133:14: warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
131 |
132 |     open func notifyChange() {
133 |         Task {
    |              `- warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
134 |             await notifyChange()
    |                   `- note: closure captures 'self' which is accessible to code in the current task
135 |         }
136 |     }
/Users/admin/builder/spi-builder-workspace/Sources/Observable/ObservableThread.swift:140:13: warning: sending 'self' risks causing data races; this is an error in the Swift 6 language mode
138 |     open func notifyChange() async {
139 |         await MainActor.run {
140 |             objectWillChange.send()
    |             |- 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
141 |         }
142 |     }
[12/14] Compiling Observable KeyedObservable.swift
[13/14] Emitting module Observable
[14/14] Compiling Observable KeyedObservableClass.swift
Build complete! (9.21s)
Build complete.
{
  "dependencies" : [
    {
      "identity" : "threadsafeswift",
      "requirement" : {
        "range" : [
          {
            "lower_bound" : "1.1.0",
            "upper_bound" : "2.0.0"
          }
        ]
      },
      "type" : "sourceControl",
      "url" : "https://github.com/Flowduino/ThreadSafeSwift.git"
    }
  ],
  "manifest_display_name" : "Observable",
  "name" : "Observable",
  "path" : "/Users/admin/builder/spi-builder-workspace",
  "platforms" : [
    {
      "name" : "macos",
      "version" : "10.15"
    },
    {
      "name" : "ios",
      "version" : "13.0"
    },
    {
      "name" : "tvos",
      "version" : "13.0"
    },
    {
      "name" : "watchos",
      "version" : "6.0"
    }
  ],
  "products" : [
    {
      "name" : "Observable",
      "targets" : [
        "Observable"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "ObservableTests",
      "module_type" : "SwiftTarget",
      "name" : "ObservableTests",
      "path" : "Tests/ObservableTests",
      "product_dependencies" : [
        "ThreadSafeSwift"
      ],
      "sources" : [
        "KeyedObservableClassTests.swift",
        "ObservableClassTests.swift"
      ],
      "target_dependencies" : [
        "Observable"
      ],
      "type" : "test"
    },
    {
      "c99name" : "Observable",
      "module_type" : "SwiftTarget",
      "name" : "Observable",
      "path" : "Sources/Observable",
      "product_dependencies" : [
        "ThreadSafeSwift"
      ],
      "product_memberships" : [
        "Observable"
      ],
      "sources" : [
        "Keyed/KeyedObservable.swift",
        "Keyed/KeyedObservableClass.swift",
        "Keyed/KeyedObservableThread.swift",
        "Keyed/KeyedObservableThreadSafeClass.swift",
        "Observable.swift",
        "ObservableClass.swift",
        "ObservableThread.swift",
        "ObservableThreadSafeClass.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.6"
}
Done.