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 PerfectThread, reference 3.0.7 (a50b9a), with Swift 6.0 for macOS (SPM) on 31 Oct 2024 11:26:22 UTC.

Swift 6 data race errors: 4

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/perfectlysoft/perfect-thread.git
Reference: 3.0.7
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/.git/
From https://github.com/perfectlysoft/perfect-thread
 * tag               3.0.7      -> FETCH_HEAD
HEAD is now at a50b9a3 Merge pull request #10 from PerfectlySoft/promisespromises
Cloned https://github.com/perfectlysoft/perfect-thread.git
Revision (git rev-parse @):
a50b9a33f08fce638f33ae3121613fe499cc23ec
SUCCESS checkout https://github.com/perfectlysoft/perfect-thread.git at 3.0.7
========================================
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": "perfect-thread",
      "name": "PerfectThread",
      "url": "https://github.com/perfectlysoft/perfect-thread.git",
      "version": "unspecified",
      "path": "/Users/admin/builder/spi-builder-workspace/.resolve-product-dependencies/.build/checkouts/perfect-thread",
      "dependencies": [
      ]
    }
  ]
}
Fetching https://github.com/perfectlysoft/perfect-thread.git
[1/379] Fetching perfect-thread
Fetched https://github.com/perfectlysoft/perfect-thread.git from cache (0.83s)
Creating working copy for https://github.com/perfectlysoft/perfect-thread.git
Working copy of https://github.com/perfectlysoft/perfect-thread.git resolved at 3.0.7 (a50b9a3)
warning: '.resolve-product-dependencies': dependency 'perfect-thread' 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/perfectlysoft/perfect-thread.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/6] Compiling PerfectThread Threading.swift
[4/6] Compiling PerfectThread Promise.swift
/Users/admin/builder/spi-builder-workspace/Sources/PerfectThread/Promise.swift:63:9: warning: capture of 'closure' with non-sendable type '(Promise<ReturnType>) throws -> ()' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 61 | 		queue.async {
 62 | 			do {
 63 | 				try closure(self)
    |         |- warning: capture of 'closure' with non-sendable type '(Promise<ReturnType>) throws -> ()' 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'
 64 | 			} catch {
 65 | 				self.fail(error)
/Users/admin/builder/spi-builder-workspace/Sources/PerfectThread/Promise.swift:63:17: warning: capture of 'self' with non-sendable type 'Promise<ReturnType>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 47 | import Dispatch
 48 |
 49 | public class Promise<ReturnType> {
    |              `- note: generic class 'Promise' does not conform to the 'Sendable' protocol
 50 |
 51 | 	let event = Threading.Event()
    :
 61 | 		queue.async {
 62 | 			do {
 63 | 				try closure(self)
    |                 `- warning: capture of 'self' with non-sendable type 'Promise<ReturnType>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 64 | 			} catch {
 65 | 				self.fail(error)
/Users/admin/builder/spi-builder-workspace/Sources/PerfectThread/Promise.swift:77:5: warning: capture of 'self' with non-sendable type 'Promise<ReturnType>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 47 | import Dispatch
 48 |
 49 | public class Promise<ReturnType> {
    |              `- note: generic class 'Promise' does not conform to the 'Sendable' protocol
 50 |
 51 | 	let event = Threading.Event()
    :
 75 | 		queue.async {
 76 | 			do {
 77 | 				self.set(try closure())
    |     `- warning: capture of 'self' with non-sendable type 'Promise<ReturnType>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 78 | 			} catch {
 79 | 				self.fail(error)
/Users/admin/builder/spi-builder-workspace/Sources/PerfectThread/Promise.swift:77:18: warning: capture of 'closure' with non-sendable type '() throws -> ReturnType' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 75 | 		queue.async {
 76 | 			do {
 77 | 				self.set(try closure())
    |                  |- warning: capture of 'closure' with non-sendable type '() throws -> ReturnType' 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'
 78 | 			} catch {
 79 | 				self.fail(error)
/Users/admin/builder/spi-builder-workspace/Sources/PerfectThread/Promise.swift:87:5: warning: capture of 'self' with non-sendable type 'Promise<ReturnType>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 47 | import Dispatch
 48 |
 49 | public class Promise<ReturnType> {
    |              `- note: generic class 'Promise' does not conform to the 'Sendable' protocol
 50 |
 51 | 	let event = Threading.Event()
    :
 85 | 		queue.async {
 86 | 			do {
 87 | 				self.set(try closure({ guard let v = try from.wait() else { throw BrokenPromise() } ; return v }))
    |     `- warning: capture of 'self' with non-sendable type 'Promise<ReturnType>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 88 | 			} catch {
 89 | 				self.fail(error)
/Users/admin/builder/spi-builder-workspace/Sources/PerfectThread/Promise.swift:87:18: warning: capture of 'closure' with non-sendable type '(() throws -> LastType) throws -> ReturnType' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 85 | 		queue.async {
 86 | 			do {
 87 | 				self.set(try closure({ guard let v = try from.wait() else { throw BrokenPromise() } ; return v }))
    |                  |- warning: capture of 'closure' with non-sendable type '(() throws -> LastType) throws -> ReturnType' 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'
 88 | 			} catch {
 89 | 				self.fail(error)
/Users/admin/builder/spi-builder-workspace/Sources/PerfectThread/Promise.swift:87:46: warning: capture of 'from' with non-sendable type 'Promise<LastType>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 47 | import Dispatch
 48 |
 49 | public class Promise<ReturnType> {
    |              `- note: generic class 'Promise' does not conform to the 'Sendable' protocol
 50 |
 51 | 	let event = Threading.Event()
    :
 85 | 		queue.async {
 86 | 			do {
 87 | 				self.set(try closure({ guard let v = try from.wait() else { throw BrokenPromise() } ; return v }))
    |                                              `- warning: capture of 'from' with non-sendable type 'Promise<LastType>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 88 | 			} catch {
 89 | 				self.fail(error)
/Users/admin/builder/spi-builder-workspace/Sources/PerfectThread/Promise.swift:87:46: warning: capture of 'from' with non-sendable type 'Promise<LastType>' in an isolated closure; this is an error in the Swift 6 language mode
 47 | import Dispatch
 48 |
 49 | public class Promise<ReturnType> {
    |              `- note: generic class 'Promise' does not conform to the 'Sendable' protocol
 50 |
 51 | 	let event = Threading.Event()
    :
 85 | 		queue.async {
 86 | 			do {
 87 | 				self.set(try closure({ guard let v = try from.wait() else { throw BrokenPromise() } ; return v }))
    |                                              `- warning: capture of 'from' with non-sendable type 'Promise<LastType>' in an isolated closure; this is an error in the Swift 6 language mode
 88 | 			} catch {
 89 | 				self.fail(error)
[5/6] Compiling PerfectThread ThreadQueue.swift
/Users/admin/builder/spi-builder-workspace/Sources/PerfectThread/ThreadQueue.swift:48:21: warning: static property 'serialQueues' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
 46 | public extension Threading {
 47 |
 48 | 	private static var serialQueues = [String:ThreadQueue]()
    |                     |- warning: static property 'serialQueues' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
    |                     |- note: convert 'serialQueues' to a 'let' constant to make 'Sendable' shared state immutable
    |                     |- note: annotate 'serialQueues' 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
 49 | 	private static var concurrentQueues = [String:ThreadQueue]()
 50 | 	private static let queuesLock = Threading.Lock()
/Users/admin/builder/spi-builder-workspace/Sources/PerfectThread/ThreadQueue.swift:49:21: warning: static property 'concurrentQueues' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
 47 |
 48 | 	private static var serialQueues = [String:ThreadQueue]()
 49 | 	private static var concurrentQueues = [String:ThreadQueue]()
    |                     |- warning: static property 'concurrentQueues' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
    |                     |- note: convert 'concurrentQueues' to a 'let' constant to make 'Sendable' shared state immutable
    |                     |- note: annotate 'concurrentQueues' 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
 50 | 	private static let queuesLock = Threading.Lock()
 51 |
/Users/admin/builder/spi-builder-workspace/Sources/PerfectThread/ThreadQueue.swift:50:21: warning: static property 'queuesLock' is not concurrency-safe because non-'Sendable' type 'Threading.Lock' may have shared mutable state; this is an error in the Swift 6 language mode
 48 | 	private static var serialQueues = [String:ThreadQueue]()
 49 | 	private static var concurrentQueues = [String:ThreadQueue]()
 50 | 	private static let queuesLock = Threading.Lock()
    |                     |- warning: static property 'queuesLock' is not concurrency-safe because non-'Sendable' type 'Threading.Lock' may have shared mutable state; this is an error in the Swift 6 language mode
    |                     |- note: annotate 'queuesLock' 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
 51 |
 52 | 	private static let defaultQueue = DefaultQueue()
/Users/admin/builder/spi-builder-workspace/Sources/PerfectThread/Threading.swift:68:8: note: class 'Lock' does not conform to the 'Sendable' protocol
 66 | 	/// The lock can be held by only one thread. Other threads attempting to secure the lock while it is held will block.
 67 | 	/// The lock is initialized as being recursive. The locking thread may lock multiple times, but each lock should be accompanied by an unlock.
 68 | 	class Lock {
    |        `- note: class 'Lock' does not conform to the 'Sendable' protocol
 69 | 		var mutex = pthread_mutex_t()
 70 | 		/// Initialize a new lock object.
/Users/admin/builder/spi-builder-workspace/Sources/PerfectThread/ThreadQueue.swift:52:21: warning: static property 'defaultQueue' is not concurrency-safe because non-'Sendable' type 'Threading.DefaultQueue' may have shared mutable state; this is an error in the Swift 6 language mode
 50 | 	private static let queuesLock = Threading.Lock()
 51 |
 52 | 	private static let defaultQueue = DefaultQueue()
    |                     |- warning: static property 'defaultQueue' is not concurrency-safe because non-'Sendable' type 'Threading.DefaultQueue' may have shared mutable state; this is an error in the Swift 6 language mode
    |                     |- note: annotate 'defaultQueue' 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
 53 |
 54 | 	/// Queue type indicator.
    :
 60 | 	}
 61 |
 62 | 	private class DefaultQueue: ThreadQueue {
    |                `- note: class 'DefaultQueue' does not conform to the 'Sendable' protocol
 63 | 		let name = "default"
 64 | 		let type = Threading.QueueType.concurrent
/Users/admin/builder/spi-builder-workspace/Sources/PerfectThread/ThreadQueue.swift:68:25: warning: passing non-sendable parameter 'closure' to function expecting a @Sendable closure
 65 | 		let queue = DispatchQueue(label: "default", attributes: .concurrent)
 66 | 		@inline(__always)
 67 | 		final func dispatch(_ closure: @escaping Threading.ThreadClosure) {
    |                         `- note: parameter 'closure' is implicitly non-sendable
 68 | 			queue.async(execute: closure)
    |                         `- warning: passing non-sendable parameter 'closure' to function expecting a @Sendable closure
 69 | 		}
 70 | 	}
[6/6] Emitting module PerfectThread
/Users/admin/builder/spi-builder-workspace/Sources/PerfectThread/ThreadQueue.swift:48:21: warning: static property 'serialQueues' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
 46 | public extension Threading {
 47 |
 48 | 	private static var serialQueues = [String:ThreadQueue]()
    |                     |- warning: static property 'serialQueues' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
    |                     |- note: convert 'serialQueues' to a 'let' constant to make 'Sendable' shared state immutable
    |                     |- note: annotate 'serialQueues' 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
 49 | 	private static var concurrentQueues = [String:ThreadQueue]()
 50 | 	private static let queuesLock = Threading.Lock()
/Users/admin/builder/spi-builder-workspace/Sources/PerfectThread/ThreadQueue.swift:49:21: warning: static property 'concurrentQueues' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
 47 |
 48 | 	private static var serialQueues = [String:ThreadQueue]()
 49 | 	private static var concurrentQueues = [String:ThreadQueue]()
    |                     |- warning: static property 'concurrentQueues' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
    |                     |- note: convert 'concurrentQueues' to a 'let' constant to make 'Sendable' shared state immutable
    |                     |- note: annotate 'concurrentQueues' 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
 50 | 	private static let queuesLock = Threading.Lock()
 51 |
/Users/admin/builder/spi-builder-workspace/Sources/PerfectThread/ThreadQueue.swift:50:21: warning: static property 'queuesLock' is not concurrency-safe because non-'Sendable' type 'Threading.Lock' may have shared mutable state; this is an error in the Swift 6 language mode
 48 | 	private static var serialQueues = [String:ThreadQueue]()
 49 | 	private static var concurrentQueues = [String:ThreadQueue]()
 50 | 	private static let queuesLock = Threading.Lock()
    |                     |- warning: static property 'queuesLock' is not concurrency-safe because non-'Sendable' type 'Threading.Lock' may have shared mutable state; this is an error in the Swift 6 language mode
    |                     |- note: annotate 'queuesLock' 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
 51 |
 52 | 	private static let defaultQueue = DefaultQueue()
/Users/admin/builder/spi-builder-workspace/Sources/PerfectThread/Threading.swift:68:8: note: class 'Lock' does not conform to the 'Sendable' protocol
 66 | 	/// The lock can be held by only one thread. Other threads attempting to secure the lock while it is held will block.
 67 | 	/// The lock is initialized as being recursive. The locking thread may lock multiple times, but each lock should be accompanied by an unlock.
 68 | 	class Lock {
    |        `- note: class 'Lock' does not conform to the 'Sendable' protocol
 69 | 		var mutex = pthread_mutex_t()
 70 | 		/// Initialize a new lock object.
/Users/admin/builder/spi-builder-workspace/Sources/PerfectThread/ThreadQueue.swift:52:21: warning: static property 'defaultQueue' is not concurrency-safe because non-'Sendable' type 'Threading.DefaultQueue' may have shared mutable state; this is an error in the Swift 6 language mode
 50 | 	private static let queuesLock = Threading.Lock()
 51 |
 52 | 	private static let defaultQueue = DefaultQueue()
    |                     |- warning: static property 'defaultQueue' is not concurrency-safe because non-'Sendable' type 'Threading.DefaultQueue' may have shared mutable state; this is an error in the Swift 6 language mode
    |                     |- note: annotate 'defaultQueue' 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
 53 |
 54 | 	/// Queue type indicator.
    :
 60 | 	}
 61 |
 62 | 	private class DefaultQueue: ThreadQueue {
    |                `- note: class 'DefaultQueue' does not conform to the 'Sendable' protocol
 63 | 		let name = "default"
 64 | 		let type = Threading.QueueType.concurrent
Build complete! (5.32s)
Build complete.
{
  "dependencies" : [
  ],
  "manifest_display_name" : "PerfectThread",
  "name" : "PerfectThread",
  "path" : "/Users/admin/builder/spi-builder-workspace",
  "platforms" : [
  ],
  "products" : [
    {
      "name" : "PerfectThread",
      "targets" : [
        "PerfectThread"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "PerfectThreadTests",
      "module_type" : "SwiftTarget",
      "name" : "PerfectThreadTests",
      "path" : "Tests/PerfectThreadTests",
      "sources" : [
        "PerfectThreadTests.swift"
      ],
      "target_dependencies" : [
        "PerfectThread"
      ],
      "type" : "test"
    },
    {
      "c99name" : "PerfectThread",
      "module_type" : "SwiftTarget",
      "name" : "PerfectThread",
      "path" : "Sources/PerfectThread",
      "product_memberships" : [
        "PerfectThread"
      ],
      "sources" : [
        "Promise.swift",
        "ThreadQueue.swift",
        "Threading.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "4.0"
}
Done.