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 Promises, reference master (2949f5), with Swift 6.0 for macOS (SPM) on 31 Oct 2024 04:13:44 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/khanlou/Promise.git
Reference: master
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/.git/
From https://github.com/khanlou/Promise
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> origin/master
HEAD is now at 2949f58 Add promise async getter (#79)
Cloned https://github.com/khanlou/Promise.git
Revision (git rev-parse @):
2949f58f2ca81964447a1435f6e162d5cb4bb092
SUCCESS checkout https://github.com/khanlou/Promise.git at master
========================================
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": "promise",
      "name": "Promises",
      "url": "https://github.com/khanlou/Promise.git",
      "version": "unspecified",
      "path": "/Users/admin/builder/spi-builder-workspace/.resolve-product-dependencies/.build/checkouts/Promise",
      "dependencies": [
      ]
    }
  ]
}
Fetching https://github.com/khanlou/Promise.git
[1/1230] Fetching promise
Fetched https://github.com/khanlou/Promise.git from cache (0.94s)
Creating working copy for https://github.com/khanlou/Promise.git
Working copy of https://github.com/khanlou/Promise.git resolved at master (2949f58)
warning: '.resolve-product-dependencies': dependency 'promise' is not used by any target
Found 0 product dependencies
========================================
Build
========================================
Selected platform:         macosSpm
Swift version:             6.0
Building package at path:  $PWD
https://github.com/khanlou/Promise.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/2] Write sources
[1/2] Write swift-version--7754E27361AE5C74.txt
[3/5] Emitting module Promise
[4/5] Compiling Promise Promise+Extras.swift
/Users/admin/builder/spi-builder-workspace/Promise/Promise+Extras.swift:48:17: warning: capture of 'fulfill' with non-sendable type '(()) -> Void' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 46 |         return Promise<()>(work: { fulfill, reject in
 47 |             DispatchQueue.main.asyncAfter(deadline: .now() + delay, execute: {
 48 |                 fulfill(())
    |                 |- warning: capture of 'fulfill' with non-sendable type '(()) -> Void' 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'
 49 |             })
 50 |         })
/Users/admin/builder/spi-builder-workspace/Promise/Promise+Extras.swift:48:17: warning: sending 'fulfill' risks causing data races; this is an error in the Swift 6 language mode
 46 |         return Promise<()>(work: { fulfill, reject in
 47 |             DispatchQueue.main.asyncAfter(deadline: .now() + delay, execute: {
 48 |                 fulfill(())
    |                 |- warning: sending 'fulfill' risks causing data races; this is an error in the Swift 6 language mode
    |                 `- note: task-isolated 'fulfill' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
 49 |             })
 50 |         })
/Users/admin/builder/spi-builder-workspace/Promise/Promise+Extras.swift:311:30: warning: task-isolated value of type 'Result<Value, any Error>' passed as a strongly transferred parameter; later accesses could race; this is an error in the Swift 6 language mode
309 |         try await withCheckedThrowingContinuation { continuation in
310 |             self.then(on: queue) { value in
311 |                 continuation.resume(with: .success(value))
    |                              `- warning: task-isolated value of type 'Result<Value, any Error>' passed as a strongly transferred parameter; later accesses could race; this is an error in the Swift 6 language mode
312 |             }.catch(on: queue) { error in
313 |                 continuation.resume(with: .failure(error))
[5/5] Compiling Promise Promise.swift
/Users/admin/builder/spi-builder-workspace/Promise/Promise.swift:21:29: warning: passing non-sendable parameter 'work' to function expecting a @Sendable closure
 18 | extension DispatchQueue: ExecutionContext {
 19 |
 20 |     public func execute(_ work: @escaping () -> Void) {
    |                           `- note: parameter 'work' is implicitly non-sendable
 21 |         self.async(execute: work)
    |                             `- warning: passing non-sendable parameter 'work' to function expecting a @Sendable closure
 22 |     }
 23 | }
/Users/admin/builder/spi-builder-workspace/Promise/Promise.swift:41:35: warning: passing non-sendable parameter 'work' to function expecting a @Sendable closure
 37 |     }
 38 |
 39 |     public func execute(_ work: @escaping () -> Void) {
    |                           `- note: parameter 'work' is implicitly non-sendable
 40 |         guard valid else { return }
 41 |         self.queue.async(execute: work)
    |                                   `- warning: passing non-sendable parameter 'work' to function expecting a @Sendable closure
 42 |     }
 43 |
/Users/admin/builder/spi-builder-workspace/Promise/Promise.swift:177:21: warning: capture of 'work' with non-sendable type '(@escaping (Value) -> Void, @escaping (any Error) -> Void) throws -> Void' in a `@Sendable` closure; this is an error in the Swift 6 language mode
175 |         queue.async(execute: {
176 |             do {
177 |                 try work(self.fulfill, self.reject)
    |                     |- warning: capture of 'work' with non-sendable type '(@escaping (Value) -> Void, @escaping (any Error) -> Void) throws -> Void' 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'
178 |             } catch let error {
179 |                 self.reject(error)
/Users/admin/builder/spi-builder-workspace/Promise/Promise.swift:177:26: warning: capture of 'self' with non-sendable type 'Promise<Value>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
131 |
132 |
133 | public final class Promise<Value> {
    |                    `- note: generic class 'Promise' does not conform to the 'Sendable' protocol
134 |
135 |     private var state: State<Value>
    :
175 |         queue.async(execute: {
176 |             do {
177 |                 try work(self.fulfill, self.reject)
    |                          `- warning: capture of 'self' with non-sendable type 'Promise<Value>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
178 |             } catch let error {
179 |                 self.reject(error)
/Users/admin/builder/spi-builder-workspace/Promise/Promise.swift:298:50: warning: capture of 'self' with non-sendable type 'Promise<Value>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
131 |
132 |
133 | public final class Promise<Value> {
    |                    `- note: generic class 'Promise' does not conform to the 'Sendable' protocol
134 |
135 |     private var state: State<Value>
    :
296 |     private func updateState(_ newState: State<Value>) {
297 |         lockQueue.async(execute: {
298 |             guard case .pending(let callbacks) = self.state else { return }
    |                                                  `- warning: capture of 'self' with non-sendable type 'Promise<Value>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
299 |             self.state = newState
300 |             self.fireIfCompleted(callbacks: callbacks)
/Users/admin/builder/spi-builder-workspace/Promise/Promise.swift:299:26: warning: capture of 'newState' with non-sendable type 'State<Value>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 64 | }
 65 |
 66 | enum State<Value>: CustomStringConvertible {
    |      `- note: consider making generic enum 'State' conform to the 'Sendable' protocol
 67 |
 68 |     /// The promise has not completed yet.
    :
297 |         lockQueue.async(execute: {
298 |             guard case .pending(let callbacks) = self.state else { return }
299 |             self.state = newState
    |                          `- warning: capture of 'newState' with non-sendable type 'State<Value>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
300 |             self.fireIfCompleted(callbacks: callbacks)
301 |         })
/Users/admin/builder/spi-builder-workspace/Promise/Promise.swift:307:20: warning: capture of 'self' with non-sendable type 'Promise<Value>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
131 |
132 |
133 | public final class Promise<Value> {
    |                    `- note: generic class 'Promise' does not conform to the 'Sendable' protocol
134 |
135 |     private var state: State<Value>
    :
305 |         let callback = Callback(onFulfilled: onFulfilled, onRejected: onRejected, executionContext: queue)
306 |         lockQueue.async(flags: .barrier, execute: {
307 |             switch self.state {
    |                    `- warning: capture of 'self' with non-sendable type 'Promise<Value>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
308 |             case .pending(let callbacks):
309 |                 self.state = .pending(callbacks: callbacks + [callback])
/Users/admin/builder/spi-builder-workspace/Promise/Promise.swift:309:63: warning: capture of 'callback' with non-sendable type 'Callback<Value>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 44 | }
 45 |
 46 | struct Callback<Value> {
    |        `- note: consider making generic struct 'Callback' conform to the 'Sendable' protocol
 47 |     let onFulfilled: (Value) -> Void
 48 |     let onRejected: (Error) -> Void
    :
307 |             switch self.state {
308 |             case .pending(let callbacks):
309 |                 self.state = .pending(callbacks: callbacks + [callback])
    |                                                               `- warning: capture of 'callback' with non-sendable type 'Callback<Value>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
310 |             case .fulfilled(let value):
311 |                 callback.callFulfill(value)
/Users/admin/builder/spi-builder-workspace/Promise/Promise.swift:323:20: warning: capture of 'self' with non-sendable type 'Promise<Value>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
131 |
132 |
133 | public final class Promise<Value> {
    |                    `- note: generic class 'Promise' does not conform to the 'Sendable' protocol
134 |
135 |     private var state: State<Value>
    :
321 |         }
322 |         lockQueue.async(execute: {
323 |             switch self.state {
    |                    `- warning: capture of 'self' with non-sendable type 'Promise<Value>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
324 |             case .pending:
325 |                 break
/Users/admin/builder/spi-builder-workspace/Promise/Promise.swift:327:40: warning: capture of 'callbacks' with non-sendable type '[Callback<Value>]' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 44 | }
 45 |
 46 | struct Callback<Value> {
    |        `- note: consider making generic struct 'Callback' conform to the 'Sendable' protocol
 47 |     let onFulfilled: (Value) -> Void
 48 |     let onRejected: (Error) -> Void
    :
325 |                 break
326 |             case let .fulfilled(value):
327 |                 var mutableCallbacks = callbacks
    |                                        `- warning: capture of 'callbacks' with non-sendable type '[Callback<Value>]' in a `@Sendable` closure; this is an error in the Swift 6 language mode
328 |                 let firstCallback = mutableCallbacks.removeFirst()
329 |                 firstCallback.callFulfill(value, completion: {
/Users/admin/builder/spi-builder-workspace/Promise/Promise.swift:330:21: warning: capture of 'self' with non-sendable type 'Promise<Value>' in an isolated closure; this is an error in the Swift 6 language mode
131 |
132 |
133 | public final class Promise<Value> {
    |                    `- note: generic class 'Promise' does not conform to the 'Sendable' protocol
134 |
135 |     private var state: State<Value>
    :
328 |                 let firstCallback = mutableCallbacks.removeFirst()
329 |                 firstCallback.callFulfill(value, completion: {
330 |                     self.fireIfCompleted(callbacks: mutableCallbacks)
    |                     `- warning: capture of 'self' with non-sendable type 'Promise<Value>' in an isolated closure; this is an error in the Swift 6 language mode
331 |                 })
332 |             case let .rejected(error):
/Users/admin/builder/spi-builder-workspace/Promise/Promise.swift:336:21: warning: capture of 'self' with non-sendable type 'Promise<Value>' in an isolated closure; this is an error in the Swift 6 language mode
131 |
132 |
133 | public final class Promise<Value> {
    |                    `- note: generic class 'Promise' does not conform to the 'Sendable' protocol
134 |
135 |     private var state: State<Value>
    :
334 |                 let firstCallback = mutableCallbacks.removeFirst()
335 |                 firstCallback.callReject(error, completion: {
336 |                     self.fireIfCompleted(callbacks: mutableCallbacks)
    |                     `- warning: capture of 'self' with non-sendable type 'Promise<Value>' in an isolated closure; this is an error in the Swift 6 language mode
337 |                 })
338 |             }
Build complete! (6.36s)
Build complete.
{
  "dependencies" : [
  ],
  "manifest_display_name" : "Promises",
  "name" : "Promises",
  "path" : "/Users/admin/builder/spi-builder-workspace",
  "platforms" : [
  ],
  "products" : [
    {
      "name" : "Promise",
      "targets" : [
        "Promise"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "PromiseTests",
      "module_type" : "SwiftTarget",
      "name" : "PromiseTests",
      "path" : "PromiseTests",
      "sources" : [
        "ExecutionContextTests.swift",
        "PromiseAllTests.swift",
        "PromiseAlwaysTests.swift",
        "PromiseDelayTests.swift",
        "PromiseEnsureTests.swift",
        "PromiseErrorMatcherTests.swift",
        "PromiseErrorTests.swift",
        "PromiseKickoffTests.swift",
        "PromiseRaceTests.swift",
        "PromiseRecoverTests.swift",
        "PromiseRetryTests.swift",
        "PromiseTests.swift",
        "PromiseThrowsTests.swift",
        "PromiseZipTests.swift",
        "Wrench.swift",
        "delay.swift"
      ],
      "target_dependencies" : [
        "Promise"
      ],
      "type" : "test"
    },
    {
      "c99name" : "Promise",
      "module_type" : "SwiftTarget",
      "name" : "Promise",
      "path" : "Promise",
      "product_memberships" : [
        "Promise"
      ],
      "sources" : [
        "Promise+Extras.swift",
        "Promise.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "4.0"
}
Done.