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 MultiPeer, reference master (e2ea07), with Swift 6.0 for macOS (SPM) on 1 Nov 2024 16:54:30 UTC.

Swift 6 data race errors: 1

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/dingwilson/MultiPeer.git
Reference: master
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/.git/
From https://github.com/dingwilson/MultiPeer
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> origin/master
HEAD is now at e2ea072 Regen jazzy docs [ci skip]
Cloned https://github.com/dingwilson/MultiPeer.git
Revision (git rev-parse @):
e2ea072710fb566b0070a6b5d78b45c29307c218
SUCCESS checkout https://github.com/dingwilson/MultiPeer.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": "multipeer",
      "name": "MultiPeer",
      "url": "https://github.com/dingwilson/MultiPeer.git",
      "version": "unspecified",
      "path": "/Users/admin/builder/spi-builder-workspace/.resolve-product-dependencies/.build/checkouts/MultiPeer",
      "dependencies": [
      ]
    }
  ]
}
Fetching https://github.com/dingwilson/MultiPeer.git
[1/1394] Fetching multipeer
Fetched https://github.com/dingwilson/MultiPeer.git from cache (1.44s)
Creating working copy for https://github.com/dingwilson/MultiPeer.git
Working copy of https://github.com/dingwilson/MultiPeer.git resolved at master (e2ea072)
warning: '.resolve-product-dependencies': dependency 'multipeer' 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/dingwilson/MultiPeer.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 MultiPeer MultiPeer.swift
/Users/admin/builder/spi-builder-workspace/Sources/MultiPeer.swift:15:23: warning: static property 'instance' is not concurrency-safe because non-'Sendable' type 'MultiPeer' may have shared mutable state; this is an error in the Swift 6 language mode
 10 |
 11 | /// Main Class for MultiPeer
 12 | public class MultiPeer: NSObject {
    |              `- note: class 'MultiPeer' does not conform to the 'Sendable' protocol
 13 |
 14 |     /// Singleton instance - call via MultiPeer.instance
 15 |     public static let instance = MultiPeer()
    |                       |- warning: static property 'instance' is not concurrency-safe because non-'Sendable' type 'MultiPeer' may have shared mutable state; this is an error in the Swift 6 language mode
    |                       |- note: annotate 'instance' 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
 16 |
 17 |     // MARK: Properties
/Users/admin/builder/spi-builder-workspace/Sources/MultiPeer.swift:198:13: warning: capture of 'invitationHandler' with non-sendable type '(Bool, MCSession?) -> Void' in a `@Sendable` closure; this is an error in the Swift 6 language mode
196 |
197 |         OperationQueue.main.addOperation {
198 |             invitationHandler(true, self.session)
    |             |- warning: capture of 'invitationHandler' with non-sendable type '(Bool, MCSession?) -> 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'
199 |         }
200 |     }
/Users/admin/builder/spi-builder-workspace/Sources/MultiPeer.swift:198:37: warning: capture of 'self' with non-sendable type 'MultiPeer' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 10 |
 11 | /// Main Class for MultiPeer
 12 | public class MultiPeer: NSObject {
    |              `- note: class 'MultiPeer' does not conform to the 'Sendable' protocol
 13 |
 14 |     /// Singleton instance - call via MultiPeer.instance
    :
196 |
197 |         OperationQueue.main.addOperation {
198 |             invitationHandler(true, self.session)
    |                                     `- warning: capture of 'self' with non-sendable type 'MultiPeer' in a `@Sendable` closure; this is an error in the Swift 6 language mode
199 |         }
200 |     }
/Users/admin/builder/spi-builder-workspace/Sources/MultiPeer.swift:257:13: warning: capture of 'self' with non-sendable type 'MultiPeer' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 10 |
 11 | /// Main Class for MultiPeer
 12 | public class MultiPeer: NSObject {
    |              `- note: class 'MultiPeer' does not conform to the 'Sendable' protocol
 13 |
 14 |     /// Singleton instance - call via MultiPeer.instance
    :
255 |         // Send new connection list to delegate
256 |         OperationQueue.main.addOperation {
257 |             self.delegate?.multiPeer(connectedDevicesChanged: session.connectedPeers.map({$0.displayName}))
    |             `- warning: capture of 'self' with non-sendable type 'MultiPeer' in a `@Sendable` closure; this is an error in the Swift 6 language mode
258 |         }
259 |     }
/Users/admin/builder/spi-builder-workspace/Sources/MultiPeer.swift:257:63: warning: capture of 'session' with non-sendable type 'MCSession' in a `@Sendable` closure; this is an error in the Swift 6 language mode
255 |         // Send new connection list to delegate
256 |         OperationQueue.main.addOperation {
257 |             self.delegate?.multiPeer(connectedDevicesChanged: session.connectedPeers.map({$0.displayName}))
    |                                                               `- warning: capture of 'session' with non-sendable type 'MCSession' in a `@Sendable` closure; this is an error in the Swift 6 language mode
258 |         }
259 |     }
MultipeerConnectivity.MCSession:2:12: note: class 'MCSession' does not conform to the 'Sendable' protocol
 1 | @available(macOS 10.10, *)
 2 | open class MCSession : NSObject {
   |            `- note: class 'MCSession' does not conform to the 'Sendable' protocol
 3 |     public convenience init(peer myPeerID: MCPeerID)
 4 |     public init(peer myPeerID: MCPeerID, securityIdentity identity: [Any]?, encryptionPreference: MCEncryptionPreference)
/Users/admin/builder/spi-builder-workspace/Sources/MultiPeer.swift:9:1: warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'MultipeerConnectivity'
  7 |
  8 | import Foundation
  9 | import MultipeerConnectivity
    | `- warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'MultipeerConnectivity'
 10 |
 11 | /// Main Class for MultiPeer
/Users/admin/builder/spi-builder-workspace/Sources/MultiPeer.swift:270:13: warning: capture of 'self' with non-sendable type 'MultiPeer' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 10 |
 11 | /// Main Class for MultiPeer
 12 | public class MultiPeer: NSObject {
    |              `- note: class 'MultiPeer' does not conform to the 'Sendable' protocol
 13 |
 14 |     /// Singleton instance - call via MultiPeer.instance
    :
268 |
269 |         OperationQueue.main.addOperation {
270 |             self.delegate?.multiPeer(didReceiveData: item, ofType: type, from: peerID)
    |             `- warning: capture of 'self' with non-sendable type 'MultiPeer' in a `@Sendable` closure; this is an error in the Swift 6 language mode
271 |         }
272 |
/Users/admin/builder/spi-builder-workspace/Sources/MultiPeer.swift:270:80: warning: capture of 'peerID' with non-sendable type 'MCPeerID' in a `@Sendable` closure; this is an error in the Swift 6 language mode
268 |
269 |         OperationQueue.main.addOperation {
270 |             self.delegate?.multiPeer(didReceiveData: item, ofType: type, from: peerID)
    |                                                                                `- warning: capture of 'peerID' with non-sendable type 'MCPeerID' in a `@Sendable` closure; this is an error in the Swift 6 language mode
271 |         }
272 |
MultipeerConnectivity.MCPeerID:2:12: note: class 'MCPeerID' does not conform to the 'Sendable' protocol
 1 | @available(macOS 10.10, *)
 2 | open class MCPeerID : NSObject, NSCopying, NSSecureCoding {
   |            `- note: class 'MCPeerID' does not conform to the 'Sendable' protocol
 3 |     public init(displayName myDisplayName: String)
 4 |     open var displayName: String { get }
[4/6] Emitting module MultiPeer
/Users/admin/builder/spi-builder-workspace/Sources/MultiPeer.swift:15:23: warning: static property 'instance' is not concurrency-safe because non-'Sendable' type 'MultiPeer' may have shared mutable state; this is an error in the Swift 6 language mode
 10 |
 11 | /// Main Class for MultiPeer
 12 | public class MultiPeer: NSObject {
    |              `- note: class 'MultiPeer' does not conform to the 'Sendable' protocol
 13 |
 14 |     /// Singleton instance - call via MultiPeer.instance
 15 |     public static let instance = MultiPeer()
    |                       |- warning: static property 'instance' is not concurrency-safe because non-'Sendable' type 'MultiPeer' may have shared mutable state; this is an error in the Swift 6 language mode
    |                       |- note: annotate 'instance' 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
 16 |
 17 |     // MARK: Properties
[5/6] Compiling MultiPeer MultiPeerDelegate.swift
[6/6] Compiling MultiPeer Peer.swift
Build complete! (8.97s)
Build complete.
{
  "dependencies" : [
  ],
  "manifest_display_name" : "MultiPeer",
  "name" : "MultiPeer",
  "path" : "/Users/admin/builder/spi-builder-workspace",
  "platforms" : [
  ],
  "products" : [
    {
      "name" : "MultiPeer",
      "targets" : [
        "MultiPeer"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "MultiPeer",
      "module_type" : "SwiftTarget",
      "name" : "MultiPeer",
      "path" : "Sources",
      "product_memberships" : [
        "MultiPeer"
      ],
      "sources" : [
        "MultiPeer.swift",
        "MultiPeerDelegate.swift",
        "Peer.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "4.0"
}
Done.