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 Future, reference main (98b12a), with Swift 6.0 for macOS (SPM) on 27 Nov 2024 11:38:32 UTC.

Swift 6 data race errors: 3

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 -Xswiftc -enable-upcoming-feature -Xswiftc StrictConcurrency -Xswiftc -enable-upcoming-feature -Xswiftc DisableOutwardActorInference -Xswiftc -enable-upcoming-feature -Xswiftc GlobalActorIsolatedTypesUsability -Xswiftc -enable-upcoming-feature -Xswiftc InferSendableFromCaptures

Build Log

========================================
RunAll
========================================
Builder version: 4.58.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/kean/Future.git
Reference: main
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/.git/
From https://github.com/kean/Future
 * branch            main       -> FETCH_HEAD
 * [new branch]      main       -> origin/main
HEAD is now at 98b12a2 Update project settings
Cloned https://github.com/kean/Future.git
Revision (git rev-parse @):
98b12a274f3fbaa08c4d5e44693ab15dd4648150
SUCCESS checkout https://github.com/kean/Future.git at main
========================================
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": "future",
      "name": "Future",
      "url": "https://github.com/kean/Future.git",
      "version": "unspecified",
      "path": "/Users/admin/builder/spi-builder-workspace/.resolve-product-dependencies/.build/checkouts/Future",
      "dependencies": [
      ]
    }
  ]
}
Fetching https://github.com/kean/Future.git
[1/1723] Fetching future
Fetched https://github.com/kean/Future.git from cache (0.94s)
Creating working copy for https://github.com/kean/Future.git
Working copy of https://github.com/kean/Future.git resolved at main (98b12a2)
warning: '.resolve-product-dependencies': dependency 'future' 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/kean/Future.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 -Xswiftc -enable-upcoming-feature -Xswiftc StrictConcurrency -Xswiftc -enable-upcoming-feature -Xswiftc DisableOutwardActorInference -Xswiftc -enable-upcoming-feature -Xswiftc GlobalActorIsolatedTypesUsability -Xswiftc -enable-upcoming-feature -Xswiftc InferSendableFromCaptures
Building for debugging...
[0/2] Write sources
[1/2] Write swift-version--7754E27361AE5C74.txt
[3/7] Compiling Future FutureExtensions.swift
/Users/admin/builder/spi-builder-workspace/Sources/FutureExtensions.swift:53:13: warning: capture of 'promise' with non-sendable type 'Future<(), Never>.Promise' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 51 |         let promise = Promise()
 52 |         queue.asyncAfter(deadline: deadline) {
 53 |             promise.succeed(value: ()) // Never produces an error
    |             `- warning: capture of 'promise' with non-sendable type 'Future<(), Never>.Promise' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 54 |         }
 55 |         return promise.future
/Users/admin/builder/spi-builder-workspace/Sources/Future.swift:202:24: note: class 'Promise' does not conform to the 'Sendable' protocol
200 |
201 |     /// A promise to provide a result later.
202 |     public final class Promise: CustomDebugStringConvertible {
    |                        `- note: class 'Promise' does not conform to the 'Sendable' protocol
203 |         private var memoizedResult: Result? // nil when pending
204 |         private var inlinedHandler: ((Result) -> Void)?
[4/7] Compiling Future Future.swift
/Users/admin/builder/spi-builder-workspace/Sources/Future.swift:292:23: warning: static property 'default' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
290 |     /// behavior where callbacks attached via `on` method are always called on
291 |     /// the main thread.
292 |     public static var `default` = Scheduler.main
    |                       |- warning: static property 'default' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
    |                       |- note: convert 'default' to a 'let' constant to make 'Sendable' shared state immutable
    |                       |- note: annotate 'default' 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
293 |
294 |     /// If the task finishes on the main thread, the callbacks are executed
<unknown>:0: note: a function type must be marked '@Sendable' to conform to 'Sendable'
/Users/admin/builder/spi-builder-workspace/Sources/Future.swift:297:23: warning: static property 'main' is not concurrency-safe because non-'Sendable' type 'ScheduleWork' (aka '(@escaping () -> ()) -> ()') may have shared mutable state; this is an error in the Swift 6 language mode
295 |     /// immediately. Otherwise, they are dispatched to be executed
296 |     /// asynchronously on the main thread.
297 |     public static let main: ScheduleWork = { work in
    |                       |- warning: static property 'main' is not concurrency-safe because non-'Sendable' type 'ScheduleWork' (aka '(@escaping () -> ()) -> ()') may have shared mutable state; this is an error in the Swift 6 language mode
    |                       |- note: annotate 'main' 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
298 |         Thread.isMainThread ? work() : DispatchQueue.main.async(execute: work)
299 |     }
/Users/admin/builder/spi-builder-workspace/Sources/Future.swift:298:74: warning: passing non-sendable parameter 'work' to function expecting a @Sendable closure
295 |     /// immediately. Otherwise, they are dispatched to be executed
296 |     /// asynchronously on the main thread.
297 |     public static let main: ScheduleWork = { work in
    |                                              `- note: parameter 'work' is implicitly non-sendable
298 |         Thread.isMainThread ? work() : DispatchQueue.main.async(execute: work)
    |                                                                          `- warning: passing non-sendable parameter 'work' to function expecting a @Sendable closure
299 |     }
300 |
<unknown>:0: note: a function type must be marked '@Sendable' to conform to 'Sendable'
/Users/admin/builder/spi-builder-workspace/Sources/Future.swift:302:23: warning: static property 'immediate' is not concurrency-safe because non-'Sendable' type 'ScheduleWork' (aka '(@escaping () -> ()) -> ()') may have shared mutable state; this is an error in the Swift 6 language mode
300 |
301 |     /// Immediately executes the given closure.
302 |     public static let immediate: ScheduleWork = { work in
    |                       |- warning: static property 'immediate' is not concurrency-safe because non-'Sendable' type 'ScheduleWork' (aka '(@escaping () -> ()) -> ()') may have shared mutable state; this is an error in the Swift 6 language mode
    |                       |- note: annotate 'immediate' 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
303 |         work()
304 |     }
/Users/admin/builder/spi-builder-workspace/Sources/Future.swift:309:48: warning: passing non-sendable parameter 'work' to function expecting a @Sendable closure
306 |     /// Runs asynchronously on the given queue.
307 |     public static func async(on queue: DispatchQueue, flags: DispatchWorkItemFlags = []) -> ScheduleWork {
308 |         return { work in
    |                  `- note: parameter 'work' is implicitly non-sendable
309 |             queue.async(flags: flags, execute: work)
    |                                                `- warning: passing non-sendable parameter 'work' to function expecting a @Sendable closure
310 |         }
311 |     }
[5/7] Emitting module Future
/Users/admin/builder/spi-builder-workspace/Sources/Future.swift:292:23: warning: static property 'default' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
290 |     /// behavior where callbacks attached via `on` method are always called on
291 |     /// the main thread.
292 |     public static var `default` = Scheduler.main
    |                       |- warning: static property 'default' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
    |                       |- note: convert 'default' to a 'let' constant to make 'Sendable' shared state immutable
    |                       |- note: annotate 'default' 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
293 |
294 |     /// If the task finishes on the main thread, the callbacks are executed
<unknown>:0: note: a function type must be marked '@Sendable' to conform to 'Sendable'
/Users/admin/builder/spi-builder-workspace/Sources/Future.swift:297:23: warning: static property 'main' is not concurrency-safe because non-'Sendable' type 'ScheduleWork' (aka '(@escaping () -> ()) -> ()') may have shared mutable state; this is an error in the Swift 6 language mode
295 |     /// immediately. Otherwise, they are dispatched to be executed
296 |     /// asynchronously on the main thread.
297 |     public static let main: ScheduleWork = { work in
    |                       |- warning: static property 'main' is not concurrency-safe because non-'Sendable' type 'ScheduleWork' (aka '(@escaping () -> ()) -> ()') may have shared mutable state; this is an error in the Swift 6 language mode
    |                       |- note: annotate 'main' 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
298 |         Thread.isMainThread ? work() : DispatchQueue.main.async(execute: work)
299 |     }
/Users/admin/builder/spi-builder-workspace/Sources/Future.swift:298:74: warning: passing non-sendable parameter 'work' to function expecting a @Sendable closure
295 |     /// immediately. Otherwise, they are dispatched to be executed
296 |     /// asynchronously on the main thread.
297 |     public static let main: ScheduleWork = { work in
    |                                              `- note: parameter 'work' is implicitly non-sendable
298 |         Thread.isMainThread ? work() : DispatchQueue.main.async(execute: work)
    |                                                                          `- warning: passing non-sendable parameter 'work' to function expecting a @Sendable closure
299 |     }
300 |
<unknown>:0: note: a function type must be marked '@Sendable' to conform to 'Sendable'
/Users/admin/builder/spi-builder-workspace/Sources/Future.swift:302:23: warning: static property 'immediate' is not concurrency-safe because non-'Sendable' type 'ScheduleWork' (aka '(@escaping () -> ()) -> ()') may have shared mutable state; this is an error in the Swift 6 language mode
300 |
301 |     /// Immediately executes the given closure.
302 |     public static let immediate: ScheduleWork = { work in
    |                       |- warning: static property 'immediate' is not concurrency-safe because non-'Sendable' type 'ScheduleWork' (aka '(@escaping () -> ()) -> ()') may have shared mutable state; this is an error in the Swift 6 language mode
    |                       |- note: annotate 'immediate' 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
303 |         work()
304 |     }
[6/7] Compiling Future CancellationToken.swift
[7/7] Compiling Future FutureOperators.swift
Build complete! (6.73s)
Build complete.
{
  "dependencies" : [
  ],
  "manifest_display_name" : "Future",
  "name" : "Future",
  "path" : "/Users/admin/builder/spi-builder-workspace",
  "platforms" : [
    {
      "name" : "macos",
      "version" : "10.13"
    },
    {
      "name" : "ios",
      "version" : "11.0"
    },
    {
      "name" : "tvos",
      "version" : "11.0"
    },
    {
      "name" : "watchos",
      "version" : "4.0"
    }
  ],
  "products" : [
    {
      "name" : "Future",
      "targets" : [
        "Future"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "FutureTests",
      "module_type" : "SwiftTarget",
      "name" : "FutureTests",
      "path" : "Tests/FutureTests",
      "sources" : [
        "A+Tests.swift",
        "CancellationTokenTests.swift",
        "Extensions.swift",
        "FutureExtensionsTests.swift",
        "FutureTests.swift",
        "StressTests.swift"
      ],
      "target_dependencies" : [
        "Future"
      ],
      "type" : "test"
    },
    {
      "c99name" : "Future",
      "module_type" : "SwiftTarget",
      "name" : "Future",
      "path" : "Sources",
      "product_memberships" : [
        "Future"
      ],
      "sources" : [
        "CancellationToken.swift",
        "Future.swift",
        "FutureExtensions.swift",
        "FutureOperators.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.1"
}
Done.