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 OpenAISwift, reference main (dba18d), with Swift 6.0 for macOS (SPM) on 12 Feb 2025 17:57:31 UTC.

Swift 6 data race errors: 3

Build Command

env DEVELOPER_DIR=/Applications/Xcode-16.2.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.60.1
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/adamrushy/OpenAISwift.git
Reference: main
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/.git/
From https://github.com/adamrushy/OpenAISwift
 * branch            main       -> FETCH_HEAD
 * [new branch]      main       -> origin/main
HEAD is now at dba18d7 Merge pull request #113 from underthestars-zhy/main
Cloned https://github.com/adamrushy/OpenAISwift.git
Revision (git rev-parse @):
dba18d7a0cf1dbeb61baaa2a87c2e42b44d71236
SUCCESS checkout https://github.com/adamrushy/OpenAISwift.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": "openaiswift",
      "name": "OpenAISwift",
      "url": "https://github.com/adamrushy/OpenAISwift.git",
      "version": "unspecified",
      "path": "/Users/admin/builder/spi-builder-workspace/.resolve-product-dependencies/.build/checkouts/OpenAISwift",
      "dependencies": [
      ]
    }
  ]
}
Fetching https://github.com/adamrushy/OpenAISwift.git
[1/1397] Fetching openaiswift
Fetched https://github.com/adamrushy/OpenAISwift.git from cache (0.90s)
Creating working copy for https://github.com/adamrushy/OpenAISwift.git
Working copy of https://github.com/adamrushy/OpenAISwift.git resolved at main (dba18d7)
warning: '.resolve-product-dependencies': dependency 'openaiswift' 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/adamrushy/OpenAISwift.git
https://github.com/adamrushy/OpenAISwift.git
{
  "dependencies" : [
  ],
  "manifest_display_name" : "OpenAISwift",
  "name" : "OpenAISwift",
  "path" : "/Users/admin/builder/spi-builder-workspace",
  "platforms" : [
    {
      "name" : "ios",
      "version" : "15.0"
    },
    {
      "name" : "macos",
      "version" : "10.15"
    }
  ],
  "products" : [
    {
      "name" : "OpenAISwift",
      "targets" : [
        "OpenAISwift"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "OpenAISwiftTests",
      "module_type" : "SwiftTarget",
      "name" : "OpenAISwiftTests",
      "path" : "Tests/OpenAISwiftTests",
      "sources" : [
        "OpenAISwiftTests.swift"
      ],
      "target_dependencies" : [
        "OpenAISwift"
      ],
      "type" : "test"
    },
    {
      "c99name" : "OpenAISwift",
      "module_type" : "SwiftTarget",
      "name" : "OpenAISwift",
      "path" : "Sources/OpenAISwift",
      "product_memberships" : [
        "OpenAISwift"
      ],
      "sources" : [
        "Models/ChatMessage.swift",
        "Models/Command.swift",
        "Models/EmbeddingsInput.swift",
        "Models/ImageGeneration.swift",
        "Models/Instruction.swift",
        "Models/Moderation.swift",
        "Models/OpenAI.swift",
        "Models/OpenAIModelType.swift",
        "OpenAIEndpoint.swift",
        "OpenAISwift.swift",
        "ServerSentEventsHandler.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.5"
}
Running build ...
env DEVELOPER_DIR=/Applications/Xcode-16.2.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-5BDAB9E9C0126B9D.txt
[3/13] Compiling OpenAISwift OpenAISwift.swift
/Users/admin/builder/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:10:10: warning: associated value 'chatError(error:)' of 'Sendable'-conforming enum 'OpenAIError' has non-sendable type 'ChatError.Payload'; this is an error in the Swift 6 language mode
  8 |     case genericError(error: Error)
  9 |     case decodingError(error: Error)
 10 |     case chatError(error: ChatError.Payload)
    |          `- warning: associated value 'chatError(error:)' of 'Sendable'-conforming enum 'OpenAIError' has non-sendable type 'ChatError.Payload'; this is an error in the Swift 6 language mode
 11 | }
 12 |
/Users/admin/builder/spi-builder-workspace/Sources/OpenAISwift/Models/ChatMessage.swift:117:19: note: consider making struct 'Payload' conform to the 'Sendable' protocol
115 |
116 | public struct ChatError: Codable {
117 |     public struct Payload: Codable {
    |                   `- note: consider making struct 'Payload' conform to the 'Sendable' protocol
118 |         public let message, type: String
119 |         public let param, code: String?
/Users/admin/builder/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:296:17: warning: capture of 'completionHandler' with non-sendable type '(Result<Data, any Error>) -> Void' in a `@Sendable` closure
294 |         let task = session.dataTask(with: request) { (data, response, error) in
295 |             if let error = error {
296 |                 completionHandler(.failure(error))
    |                 |- warning: capture of 'completionHandler' with non-sendable type '(Result<Data, any Error>) -> Void' in a `@Sendable` closure
    |                 `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
297 |             } else if let data = data {
298 |                 completionHandler(.success(data))
/Users/admin/builder/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:337:30: warning: sending 'result' risks causing data races; this is an error in the Swift 6 language mode
335 |         return try await withCheckedThrowingContinuation { continuation in
336 |             sendCompletion(with: prompt, model: model, maxTokens: maxTokens, temperature: temperature) { result in
337 |                 continuation.resume(with: result)
    |                              |- warning: sending 'result' risks causing data races; this is an error in the Swift 6 language mode
    |                              `- note: task-isolated 'result' is passed as a 'sending' parameter; Uses in callee may race with later task-isolated uses
338 |             }
339 |         }
/Users/admin/builder/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:353:30: warning: sending 'result' risks causing data races; this is an error in the Swift 6 language mode
351 |         return try await withCheckedThrowingContinuation { continuation in
352 |             sendEdits(with: instruction, model: model, input: input) { result in
353 |                 continuation.resume(with: result)
    |                              |- warning: sending 'result' risks causing data races; this is an error in the Swift 6 language mode
    |                              `- note: task-isolated 'result' is passed as a 'sending' parameter; Uses in callee may race with later task-isolated uses
354 |             }
355 |         }
/Users/admin/builder/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:398:49: warning: sending 'result' risks causing data races; this is an error in the Swift 6 language mode
396 |                      logitBias: logitBias) { result in
397 |                 switch result {
398 |                     case .success: continuation.resume(with: result)
    |                                                 |- warning: sending 'result' risks causing data races; this is an error in the Swift 6 language mode
    |                                                 `- note: task-isolated 'result' is passed as a 'sending' parameter; Uses in callee may race with later task-isolated uses
399 |                     case .failure(let failure): continuation.resume(throwing: failure)
400 |                 }
/Users/admin/builder/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:447:34: warning: sending 'result' risks causing data races; this is an error in the Swift 6 language mode
445 |                 logitBias: logitBias,
446 |                 onEventReceived: { result in
447 |                     continuation.yield(result)
    |                                  |- warning: sending 'result' risks causing data races; this is an error in the Swift 6 language mode
    |                                  `- note: task-isolated 'result' is passed as a 'sending' parameter; Uses in callee may race with later task-isolated uses
448 |                 }) {
449 |                     continuation.finish()
/Users/admin/builder/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:465:30: warning: sending 'result' risks causing data races; this is an error in the Swift 6 language mode
463 |         return try await withCheckedThrowingContinuation { continuation in
464 |             sendEmbeddings(with: input) { result in
465 |                 continuation.resume(with: result)
    |                              |- warning: sending 'result' risks causing data races; this is an error in the Swift 6 language mode
    |                              `- note: task-isolated 'result' is passed as a 'sending' parameter; Uses in callee may race with later task-isolated uses
466 |             }
467 |         }
/Users/admin/builder/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:480:30: warning: sending 'result' risks causing data races; this is an error in the Swift 6 language mode
478 |         return try await withCheckedThrowingContinuation { continuation in
479 |             sendModerations(with: input, model: model) { result in
480 |                 continuation.resume(with: result)
    |                              |- warning: sending 'result' risks causing data races; this is an error in the Swift 6 language mode
    |                              `- note: task-isolated 'result' is passed as a 'sending' parameter; Uses in callee may race with later task-isolated uses
481 |             }
482 |         }
/Users/admin/builder/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:497:30: warning: sending 'result' risks causing data races; this is an error in the Swift 6 language mode
495 |         return try await withCheckedThrowingContinuation { continuation in
496 |             sendImages(with: prompt, numImages: numImages, size: size, user: user) { result in
497 |                 continuation.resume(with: result)
    |                              |- warning: sending 'result' risks causing data races; this is an error in the Swift 6 language mode
    |                              `- note: task-isolated 'result' is passed as a 'sending' parameter; Uses in callee may race with later task-isolated uses
498 |             }
499 |         }
[4/13] Compiling OpenAISwift OpenAIEndpoint.swift
[5/13] Compiling OpenAISwift OpenAI.swift
[6/14] Compiling OpenAISwift Moderation.swift
[7/14] Compiling OpenAISwift Instruction.swift
[8/14] Compiling OpenAISwift ImageGeneration.swift
[9/14] Compiling OpenAISwift EmbeddingsInput.swift
[10/14] Compiling OpenAISwift ChatMessage.swift
[11/14] Compiling OpenAISwift Command.swift
[12/14] Compiling OpenAISwift OpenAIModelType.swift
[13/14] Emitting module OpenAISwift
/Users/admin/builder/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:10:10: warning: associated value 'chatError(error:)' of 'Sendable'-conforming enum 'OpenAIError' has non-sendable type 'ChatError.Payload'; this is an error in the Swift 6 language mode
  8 |     case genericError(error: Error)
  9 |     case decodingError(error: Error)
 10 |     case chatError(error: ChatError.Payload)
    |          `- warning: associated value 'chatError(error:)' of 'Sendable'-conforming enum 'OpenAIError' has non-sendable type 'ChatError.Payload'; this is an error in the Swift 6 language mode
 11 | }
 12 |
/Users/admin/builder/spi-builder-workspace/Sources/OpenAISwift/Models/ChatMessage.swift:117:19: note: consider making struct 'Payload' conform to the 'Sendable' protocol
115 |
116 | public struct ChatError: Codable {
117 |     public struct Payload: Codable {
    |                   `- note: consider making struct 'Payload' conform to the 'Sendable' protocol
118 |         public let message, type: String
119 |         public let param, code: String?
/Users/admin/builder/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:14:7: warning: non-final class 'ServerSentEventsHandler' cannot conform to 'Sendable'; use '@unchecked Sendable'; this is an error in the Swift 6 language mode
12 | #endif
13 |
14 | class ServerSentEventsHandler: NSObject {
   |       `- warning: non-final class 'ServerSentEventsHandler' cannot conform to 'Sendable'; use '@unchecked Sendable'; this is an error in the Swift 6 language mode
15 |
16 |     var onEventReceived: ((Result<OpenAI<StreamMessageResult>, OpenAIError>) -> Void)?
/Users/admin/builder/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:16:9: warning: stored property 'onEventReceived' of 'Sendable'-conforming class 'ServerSentEventsHandler' is mutable; this is an error in the Swift 6 language mode
14 | class ServerSentEventsHandler: NSObject {
15 |
16 |     var onEventReceived: ((Result<OpenAI<StreamMessageResult>, OpenAIError>) -> Void)?
   |         `- warning: stored property 'onEventReceived' of 'Sendable'-conforming class 'ServerSentEventsHandler' is mutable; this is an error in the Swift 6 language mode
17 |     var onComplete: (() -> Void)?
18 |
[14/14] Compiling OpenAISwift ServerSentEventsHandler.swift
/Users/admin/builder/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:14:7: warning: non-final class 'ServerSentEventsHandler' cannot conform to 'Sendable'; use '@unchecked Sendable'; this is an error in the Swift 6 language mode
12 | #endif
13 |
14 | class ServerSentEventsHandler: NSObject {
   |       `- warning: non-final class 'ServerSentEventsHandler' cannot conform to 'Sendable'; use '@unchecked Sendable'; this is an error in the Swift 6 language mode
15 |
16 |     var onEventReceived: ((Result<OpenAI<StreamMessageResult>, OpenAIError>) -> Void)?
/Users/admin/builder/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:16:9: warning: stored property 'onEventReceived' of 'Sendable'-conforming class 'ServerSentEventsHandler' is mutable; this is an error in the Swift 6 language mode
14 | class ServerSentEventsHandler: NSObject {
15 |
16 |     var onEventReceived: ((Result<OpenAI<StreamMessageResult>, OpenAIError>) -> Void)?
   |         `- warning: stored property 'onEventReceived' of 'Sendable'-conforming class 'ServerSentEventsHandler' is mutable; this is an error in the Swift 6 language mode
17 |     var onComplete: (() -> Void)?
18 |
Build complete! (15.11s)
Build complete.
{
  "dependencies" : [
  ],
  "manifest_display_name" : "OpenAISwift",
  "name" : "OpenAISwift",
  "path" : "/Users/admin/builder/spi-builder-workspace",
  "platforms" : [
    {
      "name" : "ios",
      "version" : "15.0"
    },
    {
      "name" : "macos",
      "version" : "10.15"
    }
  ],
  "products" : [
    {
      "name" : "OpenAISwift",
      "targets" : [
        "OpenAISwift"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "OpenAISwiftTests",
      "module_type" : "SwiftTarget",
      "name" : "OpenAISwiftTests",
      "path" : "Tests/OpenAISwiftTests",
      "sources" : [
        "OpenAISwiftTests.swift"
      ],
      "target_dependencies" : [
        "OpenAISwift"
      ],
      "type" : "test"
    },
    {
      "c99name" : "OpenAISwift",
      "module_type" : "SwiftTarget",
      "name" : "OpenAISwift",
      "path" : "Sources/OpenAISwift",
      "product_memberships" : [
        "OpenAISwift"
      ],
      "sources" : [
        "Models/ChatMessage.swift",
        "Models/Command.swift",
        "Models/EmbeddingsInput.swift",
        "Models/ImageGeneration.swift",
        "Models/Instruction.swift",
        "Models/Moderation.swift",
        "Models/OpenAI.swift",
        "Models/OpenAIModelType.swift",
        "OpenAIEndpoint.swift",
        "OpenAISwift.swift",
        "ServerSentEventsHandler.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.5"
}
Done.