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 2.0.4 (7de014), with Swift 6.0 for Linux on 31 Oct 2024 04:06:37 UTC.

Swift 6 data race errors: 0

Build Command

bash -c docker run --pull=always --rm -v "checkouts-4609320-2":/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 2>&1

Build Log

========================================
RunAll
========================================
Builder version: 4.56.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/khanlou/Promise.git
Reference: 2.0.4
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/khanlou/Promise
 * tag               2.0.4      -> FETCH_HEAD
HEAD is now at 7de0149 update to version 2.0.4
Cloned https://github.com/khanlou/Promise.git
Revision (git rev-parse @):
7de01494163478adb1aa83740914a4ca29059169
SUCCESS checkout https://github.com/khanlou/Promise.git at 2.0.4
========================================
Build
========================================
Selected platform:         linux
Swift version:             6.0
Building package at path:  $PWD
https://github.com/khanlou/Promise.git
Running build ...
bash -c docker run --pull=always --rm -v "checkouts-4609320-2":/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 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/5] Compiling Promise Promise+Extras.swift
/host/spi-builder-workspace/Promise/Promise+Extras.swift:39:17: warning: capture of 'fulfill' with non-sendable type '(()) -> Void' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 37 |         return Promise<()>(work: { fulfill, reject in
 38 |             DispatchQueue.main.asyncAfter(deadline: .now() + delay, execute: {
 39 |                 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'
 40 |             })
 41 |         })
/host/spi-builder-workspace/Promise/Promise+Extras.swift:39:17: warning: sending 'fulfill' risks causing data races; this is an error in the Swift 6 language mode
 37 |         return Promise<()>(work: { fulfill, reject in
 38 |             DispatchQueue.main.asyncAfter(deadline: .now() + delay, execute: {
 39 |                 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
 40 |             })
 41 |         })
[4/5] Emitting module Promise
[5/5] Compiling Promise Promise.swift
/host/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 | }
/host/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 |
/host/spi-builder-workspace/Promise/Promise.swift:154: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
152 |         queue.async(execute: {
153 |             do {
154 |                 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'
155 |             } catch let error {
156 |                 self.reject(error)
/host/spi-builder-workspace/Promise/Promise.swift:154: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>
    :
152 |         queue.async(execute: {
153 |             do {
154 |                 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
155 |             } catch let error {
156 |                 self.reject(error)
/host/spi-builder-workspace/Promise/Promise.swift:236: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>
    :
234 |     private func updateState(_ newState: State<Value>) {
235 |         lockQueue.async(execute: {
236 |             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
237 |             self.state = newState
238 |             self.fireIfCompleted(callbacks: callbacks)
/host/spi-builder-workspace/Promise/Promise.swift:237: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.
    :
235 |         lockQueue.async(execute: {
236 |             guard case .pending(let callbacks) = self.state else { return }
237 |             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
238 |             self.fireIfCompleted(callbacks: callbacks)
239 |         })
/host/spi-builder-workspace/Promise/Promise.swift:245: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>
    :
243 |         let callback = Callback(onFulfilled: onFulfilled, onRejected: onRejected, executionContext: queue)
244 |         lockQueue.async(flags: .barrier, execute: {
245 |             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
246 |             case .pending(let callbacks):
247 |                 self.state = .pending(callbacks: callbacks + [callback])
/host/spi-builder-workspace/Promise/Promise.swift:247: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
    :
245 |             switch self.state {
246 |             case .pending(let callbacks):
247 |                 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
248 |             case .fulfilled(let value):
249 |                 callback.callFulfill(value)
/host/spi-builder-workspace/Promise/Promise.swift:261: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>
    :
259 |         }
260 |         lockQueue.async(execute: {
261 |             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
262 |             case .pending:
263 |                 break
/host/spi-builder-workspace/Promise/Promise.swift:265: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
    :
263 |                 break
264 |             case let .fulfilled(value):
265 |                 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
266 |                 let firstCallback = mutableCallbacks.removeFirst()
267 |                 firstCallback.callFulfill(value, completion: {
/host/spi-builder-workspace/Promise/Promise.swift:268: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>
    :
266 |                 let firstCallback = mutableCallbacks.removeFirst()
267 |                 firstCallback.callFulfill(value, completion: {
268 |                     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
269 |                 })
270 |             case let .rejected(error):
/host/spi-builder-workspace/Promise/Promise.swift:274: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>
    :
272 |                 let firstCallback = mutableCallbacks.removeFirst()
273 |                 firstCallback.callReject(error, completion: {
274 |                     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
275 |                 })
276 |             }
Build complete! (9.35s)
Build complete.
{
  "dependencies" : [
  ],
  "manifest_display_name" : "Promises",
  "name" : "Promises",
  "path" : "/host/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",
        "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"
}
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.