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 APIRequest, reference master (0f0e8e), with Swift 6.1 for macOS (SPM) on 27 Apr 2025 08:47:46 UTC.

Swift 6 data race errors: 3

Build Command

env DEVELOPER_DIR=/Applications/Xcode-16.3.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.61.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/NathanFallet/APIRequest.git
Reference: master
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/.git/
From https://github.com/NathanFallet/APIRequest
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> origin/master
HEAD is now at 0f0e8e7 Fixing README
Cloned https://github.com/NathanFallet/APIRequest.git
Revision (git rev-parse @):
0f0e8e78d50be27444704022cc8740730f1efa54
SUCCESS checkout https://github.com/NathanFallet/APIRequest.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": "apirequest",
      "name": "APIRequest",
      "url": "https://github.com/NathanFallet/APIRequest.git",
      "version": "unspecified",
      "path": "/Users/admin/builder/spi-builder-workspace/.resolve-product-dependencies/.build/checkouts/APIRequest",
      "dependencies": [
      ]
    }
  ]
}
Fetching https://github.com/NathanFallet/APIRequest.git
[1/275] Fetching apirequest
Fetched https://github.com/NathanFallet/APIRequest.git from cache (0.80s)
Creating working copy for https://github.com/NathanFallet/APIRequest.git
Working copy of https://github.com/NathanFallet/APIRequest.git resolved at master (0f0e8e7)
warning: '.resolve-product-dependencies': dependency 'apirequest' is not used by any target
Found 0 product dependencies
========================================
Build
========================================
Selected platform:         macosSpm
Swift version:             6.1
Building package at path:  $PWD
https://github.com/NathanFallet/APIRequest.git
https://github.com/NathanFallet/APIRequest.git
{
  "dependencies" : [
  ],
  "manifest_display_name" : "APIRequest",
  "name" : "APIRequest",
  "path" : "/Users/admin/builder/spi-builder-workspace",
  "platforms" : [
  ],
  "products" : [
    {
      "name" : "APIRequest",
      "targets" : [
        "APIRequest"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "APIRequestTests",
      "module_type" : "SwiftTarget",
      "name" : "APIRequestTests",
      "path" : "Tests/APIRequestTests",
      "sources" : [
        "APIRequestTests.swift",
        "XCTestManifests.swift"
      ],
      "target_dependencies" : [
        "APIRequest"
      ],
      "type" : "test"
    },
    {
      "c99name" : "APIRequest",
      "module_type" : "SwiftTarget",
      "name" : "APIRequest",
      "path" : "Sources/APIRequest",
      "product_memberships" : [
        "APIRequest"
      ],
      "sources" : [
        "Decoder/APIDecoder.swift",
        "Decoder/JSONAPIDecoder.swift",
        "Encoder/APIEncoder.swift",
        "Encoder/EncodableExtension.swift",
        "Encoder/JSONAPIEncoder.swift",
        "Request/APIConfiguration.swift",
        "Request/APIRequest.swift",
        "Request/APIResponseStatus.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.2"
}
Running build ...
env DEVELOPER_DIR=/Applications/Xcode-16.3.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-2F0A5646E1D333AE.txt
[3/11] Compiling APIRequest APIRequest.swift
/Users/admin/builder/spi-builder-workspace/Sources/APIRequest/Request/APIRequest.swift:26:14: warning: non-final class 'APIRequest' cannot conform to 'Sendable'; use '@unchecked Sendable'; this is an error in the Swift 6 language mode
 24 | #endif
 25 |
 26 | public class APIRequest: NSObject, URLSessionDelegate, URLSessionTaskDelegate {
    |              `- warning: non-final class 'APIRequest' cannot conform to 'Sendable'; use '@unchecked Sendable'; this is an error in the Swift 6 language mode
 27 |
 28 |     /// Completion handler of an APIRequest
/Users/admin/builder/spi-builder-workspace/Sources/APIRequest/Request/APIRequest.swift:40:17: warning: stored property 'method' of 'Sendable'-conforming class 'APIRequest' is mutable; this is an error in the Swift 6 language mode
 38 |
 39 |     // Object properties
 40 |     private var method: String
    |                 `- warning: stored property 'method' of 'Sendable'-conforming class 'APIRequest' is mutable; this is an error in the Swift 6 language mode
 41 |     private var path: String
 42 |     private var configuration: APIConfiguration
/Users/admin/builder/spi-builder-workspace/Sources/APIRequest/Request/APIRequest.swift:211:82: warning: capture of 'completionHandler' with non-sendable type 'APIRequest.CompletionHandler<T>' (aka '(Optional<T>, APIResponseStatus) -> ()') in a '@Sendable' closure
209 |                     if (error as NSError).code == -1009 {
210 |                         // Device is offline
211 |                         self.end(data: nil, status: .offline, completionHandler: completionHandler)
    |                                                                                  |- warning: capture of 'completionHandler' with non-sendable type 'APIRequest.CompletionHandler<T>' (aka '(Optional<T>, APIResponseStatus) -> ()') in a '@Sendable' closure
    |                                                                                  `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
212 |                         return
213 |                     }
/Users/admin/builder/spi-builder-workspace/Sources/APIRequest/Request/APIRequest.swift:252:17: warning: sending 'completionHandler' risks causing data races; this is an error in the Swift 6 language mode
250 |             DispatchQueue.main.async {
251 |                 // And complete
252 |                 completionHandler(data, status)
    |                 |- warning: sending 'completionHandler' risks causing data races; this is an error in the Swift 6 language mode
    |                 `- note: task-isolated 'completionHandler' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
253 |             }
254 |         } else {
/Users/admin/builder/spi-builder-workspace/Sources/APIRequest/Request/APIRequest.swift:252:35: warning: sending 'data' risks causing data races; this is an error in the Swift 6 language mode
250 |             DispatchQueue.main.async {
251 |                 // And complete
252 |                 completionHandler(data, status)
    |                                   |- warning: sending 'data' risks causing data races; this is an error in the Swift 6 language mode
    |                                   `- note: task-isolated 'data' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
253 |             }
254 |         } else {
/Users/admin/builder/spi-builder-workspace/Sources/APIRequest/Request/APIRequest.swift:252:41: warning: sending 'status' risks causing data races; this is an error in the Swift 6 language mode
250 |             DispatchQueue.main.async {
251 |                 // And complete
252 |                 completionHandler(data, status)
    |                                         |- warning: sending 'status' risks causing data races; this is an error in the Swift 6 language mode
    |                                         `- note: task-isolated 'status' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
253 |             }
254 |         } else {
[4/11] Compiling APIRequest JSONAPIEncoder.swift
[5/11] Compiling APIRequest APIConfiguration.swift
/Users/admin/builder/spi-builder-workspace/Sources/APIRequest/Request/APIConfiguration.swift:25:23: warning: static property 'current' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
23 |
24 |     // Default configuration
25 |     public static var current: APIConfiguration?
   |                       |- warning: static property 'current' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
   |                       |- note: convert 'current' to a 'let' constant to make 'Sendable' shared state immutable
   |                       |- note: add '@MainActor' to make static property 'current' part of global actor 'MainActor'
   |                       `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
26 |
27 |     // Configuration variables
[6/11] Compiling APIRequest EncodableExtension.swift
[7/11] Compiling APIRequest JSONAPIDecoder.swift
[8/11] Compiling APIRequest APIEncoder.swift
[9/11] Compiling APIRequest APIDecoder.swift
[10/11] Emitting module APIRequest
/Users/admin/builder/spi-builder-workspace/Sources/APIRequest/Request/APIConfiguration.swift:25:23: warning: static property 'current' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
23 |
24 |     // Default configuration
25 |     public static var current: APIConfiguration?
   |                       |- warning: static property 'current' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
   |                       |- note: convert 'current' to a 'let' constant to make 'Sendable' shared state immutable
   |                       |- note: add '@MainActor' to make static property 'current' part of global actor 'MainActor'
   |                       `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
26 |
27 |     // Configuration variables
/Users/admin/builder/spi-builder-workspace/Sources/APIRequest/Request/APIRequest.swift:26:14: warning: non-final class 'APIRequest' cannot conform to 'Sendable'; use '@unchecked Sendable'; this is an error in the Swift 6 language mode
 24 | #endif
 25 |
 26 | public class APIRequest: NSObject, URLSessionDelegate, URLSessionTaskDelegate {
    |              `- warning: non-final class 'APIRequest' cannot conform to 'Sendable'; use '@unchecked Sendable'; this is an error in the Swift 6 language mode
 27 |
 28 |     /// Completion handler of an APIRequest
/Users/admin/builder/spi-builder-workspace/Sources/APIRequest/Request/APIRequest.swift:40:17: warning: stored property 'method' of 'Sendable'-conforming class 'APIRequest' is mutable; this is an error in the Swift 6 language mode
 38 |
 39 |     // Object properties
 40 |     private var method: String
    |                 `- warning: stored property 'method' of 'Sendable'-conforming class 'APIRequest' is mutable; this is an error in the Swift 6 language mode
 41 |     private var path: String
 42 |     private var configuration: APIConfiguration
[11/11] Compiling APIRequest APIResponseStatus.swift
Build complete! (5.31s)
Build complete.
{
  "dependencies" : [
  ],
  "manifest_display_name" : "APIRequest",
  "name" : "APIRequest",
  "path" : "/Users/admin/builder/spi-builder-workspace",
  "platforms" : [
  ],
  "products" : [
    {
      "name" : "APIRequest",
      "targets" : [
        "APIRequest"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "APIRequestTests",
      "module_type" : "SwiftTarget",
      "name" : "APIRequestTests",
      "path" : "Tests/APIRequestTests",
      "sources" : [
        "APIRequestTests.swift",
        "XCTestManifests.swift"
      ],
      "target_dependencies" : [
        "APIRequest"
      ],
      "type" : "test"
    },
    {
      "c99name" : "APIRequest",
      "module_type" : "SwiftTarget",
      "name" : "APIRequest",
      "path" : "Sources/APIRequest",
      "product_memberships" : [
        "APIRequest"
      ],
      "sources" : [
        "Decoder/APIDecoder.swift",
        "Decoder/JSONAPIDecoder.swift",
        "Encoder/APIEncoder.swift",
        "Encoder/EncodableExtension.swift",
        "Encoder/JSONAPIEncoder.swift",
        "Request/APIConfiguration.swift",
        "Request/APIRequest.swift",
        "Request/APIResponseStatus.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.2"
}
Done.