Build Information
Successful build of OpenAIKit, reference main (0d326a
), with Swift 6.0 for macOS (SPM) on 4 Nov 2024 07:16:07 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
Build Log
========================================
RunAll
========================================
Builder version: 4.56.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/FuturraGroup/OpenAI.git
Reference: main
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/.git/
From https://github.com/FuturraGroup/OpenAI
* branch main -> FETCH_HEAD
* [new branch] main -> origin/main
HEAD is now at 0d326a0 Update README.md
Cloned https://github.com/FuturraGroup/OpenAI.git
Revision (git rev-parse @):
0d326a052c278beb11842918fdbd2e864f2bbc05
SUCCESS checkout https://github.com/FuturraGroup/OpenAI.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": "openai",
"name": "OpenAIKit",
"url": "https://github.com/FuturraGroup/OpenAI.git",
"version": "unspecified",
"path": "/Users/admin/builder/spi-builder-workspace/.resolve-product-dependencies/.build/checkouts/OpenAI",
"dependencies": [
]
}
]
}
Fetching https://github.com/FuturraGroup/OpenAI.git
[1/417] Fetching openai
Fetched https://github.com/FuturraGroup/OpenAI.git from cache (1.41s)
Creating working copy for https://github.com/FuturraGroup/OpenAI.git
Working copy of https://github.com/FuturraGroup/OpenAI.git resolved at main (0d326a0)
warning: '.resolve-product-dependencies': dependency 'openai' 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/FuturraGroup/OpenAI.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/17] Compiling OpenAIKit OpenAIKit.swift
[4/17] Compiling OpenAIKit Edits.swift
/Users/admin/builder/spi-builder-workspace/Sources/OpenAIKit/OpenAIKitRequests/Edits.swift:52:18: warning: sending 'result' risks causing data races; this is an error in the Swift 6 language mode
50 | return await withCheckedContinuation { continuation in
51 | sendEdits(instruction: instruction, model: model, input: input, n: n, temperature: temperature, topP: topP) { result in
52 | continuation.resume(returning: 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
53 | }
54 | }
[5/18] Compiling OpenAIKit Completions.swift
/Users/admin/builder/spi-builder-workspace/Sources/OpenAIKit/OpenAIKitRequests/Completions.swift:67:18: warning: sending 'result' risks causing data races; this is an error in the Swift 6 language mode
65 | return await withCheckedContinuation { continuation in
66 | sendCompletion(prompt: prompt, model: model, maxTokens: maxTokens, temperature: temperature, n: n, topP: topP, frequencyPenalty: frequencyPenalty, presencePenalty: presencePenalty, logprobs: logprobs, stop: stop, user: user) { result in
67 | continuation.resume(returning: 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
68 | }
69 | }
[6/18] Compiling OpenAIKit OpenAISSLDelegate.swift
[7/18] Compiling OpenAIKit AIModel.swift
[8/18] Compiling OpenAIKit ChatCompletionsRequest.swift
/Users/admin/builder/spi-builder-workspace/Sources/OpenAIKit/Models/ChatCompletionsRequest.swift:50:21: warning: static property 'json' is not concurrency-safe because non-'Sendable' type 'ChatCompletionsRequest.ResponseFormat' may have shared mutable state; this is an error in the Swift 6 language mode
42 | /// Whether to stream back partial progress. If set, tokens will be sent as data-only server-sent events as they become available
43 | public var stream: Bool = false
44 | public struct ResponseFormat: Codable {
| `- note: consider making struct 'ResponseFormat' conform to the 'Sendable' protocol
45 | internal var type: FormatType?
46 | internal enum FormatType: String, Codable {
:
48 | }
49 |
50 | public static let json = ResponseFormat(type: .jsonObject)
| |- warning: static property 'json' is not concurrency-safe because non-'Sendable' type 'ChatCompletionsRequest.ResponseFormat' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'json' 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 | public static let text = ResponseFormat(type: .text)
52 | }
/Users/admin/builder/spi-builder-workspace/Sources/OpenAIKit/Models/ChatCompletionsRequest.swift:51:21: warning: static property 'text' is not concurrency-safe because non-'Sendable' type 'ChatCompletionsRequest.ResponseFormat' may have shared mutable state; this is an error in the Swift 6 language mode
42 | /// Whether to stream back partial progress. If set, tokens will be sent as data-only server-sent events as they become available
43 | public var stream: Bool = false
44 | public struct ResponseFormat: Codable {
| `- note: consider making struct 'ResponseFormat' conform to the 'Sendable' protocol
45 | internal var type: FormatType?
46 | internal enum FormatType: String, Codable {
:
49 |
50 | public static let json = ResponseFormat(type: .jsonObject)
51 | public static let text = ResponseFormat(type: .text)
| |- warning: static property 'text' is not concurrency-safe because non-'Sendable' type 'ChatCompletionsRequest.ResponseFormat' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'text' 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
52 | }
53 | }
[9/18] Compiling OpenAIKit CompletionsModels.swift
/Users/admin/builder/spi-builder-workspace/Sources/OpenAIKit/Models/ChatCompletionsRequest.swift:50:21: warning: static property 'json' is not concurrency-safe because non-'Sendable' type 'ChatCompletionsRequest.ResponseFormat' may have shared mutable state; this is an error in the Swift 6 language mode
42 | /// Whether to stream back partial progress. If set, tokens will be sent as data-only server-sent events as they become available
43 | public var stream: Bool = false
44 | public struct ResponseFormat: Codable {
| `- note: consider making struct 'ResponseFormat' conform to the 'Sendable' protocol
45 | internal var type: FormatType?
46 | internal enum FormatType: String, Codable {
:
48 | }
49 |
50 | public static let json = ResponseFormat(type: .jsonObject)
| |- warning: static property 'json' is not concurrency-safe because non-'Sendable' type 'ChatCompletionsRequest.ResponseFormat' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'json' 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 | public static let text = ResponseFormat(type: .text)
52 | }
/Users/admin/builder/spi-builder-workspace/Sources/OpenAIKit/Models/ChatCompletionsRequest.swift:51:21: warning: static property 'text' is not concurrency-safe because non-'Sendable' type 'ChatCompletionsRequest.ResponseFormat' may have shared mutable state; this is an error in the Swift 6 language mode
42 | /// Whether to stream back partial progress. If set, tokens will be sent as data-only server-sent events as they become available
43 | public var stream: Bool = false
44 | public struct ResponseFormat: Codable {
| `- note: consider making struct 'ResponseFormat' conform to the 'Sendable' protocol
45 | internal var type: FormatType?
46 | internal enum FormatType: String, Codable {
:
49 |
50 | public static let json = ResponseFormat(type: .jsonObject)
51 | public static let text = ResponseFormat(type: .text)
| |- warning: static property 'text' is not concurrency-safe because non-'Sendable' type 'ChatCompletionsRequest.ResponseFormat' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'text' 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
52 | }
53 | }
[10/18] Compiling OpenAIKit Extensions.swift
/Users/admin/builder/spi-builder-workspace/Sources/OpenAIKit/Helpers/AIEventStream.swift:29:14: warning: stored property 'session' of 'Sendable'-conforming generic class 'AIEventStream' is mutable; this is an error in the Swift 6 language mode
27 | public final class AIEventStream<ResponseType: Decodable>: NSObject, URLSessionDataDelegate {
28 | private let request: URLRequest
29 | private var session: URLSession?
| `- warning: stored property 'session' of 'Sendable'-conforming generic class 'AIEventStream' is mutable; this is an error in the Swift 6 language mode
30 | private var operationQueue: OperationQueue
31 |
[11/18] Compiling OpenAIKit AIEventStream.swift
/Users/admin/builder/spi-builder-workspace/Sources/OpenAIKit/Helpers/AIEventStream.swift:29:14: warning: stored property 'session' of 'Sendable'-conforming generic class 'AIEventStream' is mutable; this is an error in the Swift 6 language mode
27 | public final class AIEventStream<ResponseType: Decodable>: NSObject, URLSessionDataDelegate {
28 | private let request: URLRequest
29 | private var session: URLSession?
| `- warning: stored property 'session' of 'Sendable'-conforming generic class 'AIEventStream' is mutable; this is an error in the Swift 6 language mode
30 | private var operationQueue: OperationQueue
31 |
[12/18] Emitting module OpenAIKit
/Users/admin/builder/spi-builder-workspace/Sources/OpenAIKit/Helpers/AIEventStream.swift:29:14: warning: stored property 'session' of 'Sendable'-conforming generic class 'AIEventStream' is mutable; this is an error in the Swift 6 language mode
27 | public final class AIEventStream<ResponseType: Decodable>: NSObject, URLSessionDataDelegate {
28 | private let request: URLRequest
29 | private var session: URLSession?
| `- warning: stored property 'session' of 'Sendable'-conforming generic class 'AIEventStream' is mutable; this is an error in the Swift 6 language mode
30 | private var operationQueue: OperationQueue
31 |
/Users/admin/builder/spi-builder-workspace/Sources/OpenAIKit/Models/ChatCompletionsRequest.swift:50:21: warning: static property 'json' is not concurrency-safe because non-'Sendable' type 'ChatCompletionsRequest.ResponseFormat' may have shared mutable state; this is an error in the Swift 6 language mode
42 | /// Whether to stream back partial progress. If set, tokens will be sent as data-only server-sent events as they become available
43 | public var stream: Bool = false
44 | public struct ResponseFormat: Codable {
| `- note: consider making struct 'ResponseFormat' conform to the 'Sendable' protocol
45 | internal var type: FormatType?
46 | internal enum FormatType: String, Codable {
:
48 | }
49 |
50 | public static let json = ResponseFormat(type: .jsonObject)
| |- warning: static property 'json' is not concurrency-safe because non-'Sendable' type 'ChatCompletionsRequest.ResponseFormat' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'json' 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 | public static let text = ResponseFormat(type: .text)
52 | }
/Users/admin/builder/spi-builder-workspace/Sources/OpenAIKit/Models/ChatCompletionsRequest.swift:51:21: warning: static property 'text' is not concurrency-safe because non-'Sendable' type 'ChatCompletionsRequest.ResponseFormat' may have shared mutable state; this is an error in the Swift 6 language mode
42 | /// Whether to stream back partial progress. If set, tokens will be sent as data-only server-sent events as they become available
43 | public var stream: Bool = false
44 | public struct ResponseFormat: Codable {
| `- note: consider making struct 'ResponseFormat' conform to the 'Sendable' protocol
45 | internal var type: FormatType?
46 | internal enum FormatType: String, Codable {
:
49 |
50 | public static let json = ResponseFormat(type: .jsonObject)
51 | public static let text = ResponseFormat(type: .text)
| |- warning: static property 'text' is not concurrency-safe because non-'Sendable' type 'ChatCompletionsRequest.ResponseFormat' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'text' 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
52 | }
53 | }
[13/18] Compiling OpenAIKit NetworkRoutes.swift
/Users/admin/builder/spi-builder-workspace/Sources/OpenAIKit/Helpers/OpenAIKitNetwork.swift:50:5: warning: capture of 'completion' with non-sendable type '(Result<ResponseType, any Error>) -> Void' in a `@Sendable` closure; this is an error in the Swift 6 language mode
48 | let task = session.dataTask(with: request) { data, response, error in
49 | if let error = error {
50 | completion(.failure(error))
| |- warning: capture of 'completion' with non-sendable type '(Result<ResponseType, any Error>) -> 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'
51 | return
52 | }
/Users/admin/builder/spi-builder-workspace/Sources/OpenAIKit/Helpers/OpenAIKitNetwork.swift:170:6: warning: capture of 'self' with non-sendable type 'OpenAIKitNetwork?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
22 | @available(swift 5.5)
23 | @available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, *)
24 | public final class OpenAIKitNetwork {
| `- note: class 'OpenAIKitNetwork' does not conform to the 'Sendable' protocol
25 | private let session: URLSession
26 | private weak var sslDelegate: OpenAISSLDelegate?
:
168 |
169 | continuation.onTermination = { @Sendable [weak self] _ in
170 | self?.terminateStream(stream)
| `- warning: capture of 'self' with non-sendable type 'OpenAIKitNetwork?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
171 | }
172 | }
/Users/admin/builder/spi-builder-workspace/Sources/OpenAIKit/Helpers/OpenAIKitNetwork.swift:146:35: warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
144 |
145 | return AsyncThrowingStream<AIStreamResponse<ResponseType>, Error> { continuation in
146 | Task(priority: .userInitiated) {
| `- warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
147 | var streamState = StreamTaskState()
148 |
:
167 | stream.startStream()
168 |
169 | continuation.onTermination = { @Sendable [weak self] _ in
| `- note: closure captures 'self' which is accessible to code in the current task
170 | self?.terminateStream(stream)
171 | }
/Users/admin/builder/spi-builder-workspace/Sources/OpenAIKit/Helpers/OpenAIKitNetwork.swift:150:19: warning: task-isolated value of type 'AIStreamResponse<ResponseType>' passed as a strongly transferred parameter; later accesses could race; this is an error in the Swift 6 language mode
148 |
149 | stream.onMessage { data, message in
150 | continuation.yield(AIStreamResponse(stream: stream, message: message, data: data))
| `- warning: task-isolated value of type 'AIStreamResponse<ResponseType>' passed as a strongly transferred parameter; later accesses could race; this is an error in the Swift 6 language mode
151 | }
152 |
[14/18] Compiling OpenAIKit OpenAIKitNetwork.swift
/Users/admin/builder/spi-builder-workspace/Sources/OpenAIKit/Helpers/OpenAIKitNetwork.swift:50:5: warning: capture of 'completion' with non-sendable type '(Result<ResponseType, any Error>) -> Void' in a `@Sendable` closure; this is an error in the Swift 6 language mode
48 | let task = session.dataTask(with: request) { data, response, error in
49 | if let error = error {
50 | completion(.failure(error))
| |- warning: capture of 'completion' with non-sendable type '(Result<ResponseType, any Error>) -> 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'
51 | return
52 | }
/Users/admin/builder/spi-builder-workspace/Sources/OpenAIKit/Helpers/OpenAIKitNetwork.swift:170:6: warning: capture of 'self' with non-sendable type 'OpenAIKitNetwork?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
22 | @available(swift 5.5)
23 | @available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, *)
24 | public final class OpenAIKitNetwork {
| `- note: class 'OpenAIKitNetwork' does not conform to the 'Sendable' protocol
25 | private let session: URLSession
26 | private weak var sslDelegate: OpenAISSLDelegate?
:
168 |
169 | continuation.onTermination = { @Sendable [weak self] _ in
170 | self?.terminateStream(stream)
| `- warning: capture of 'self' with non-sendable type 'OpenAIKitNetwork?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
171 | }
172 | }
/Users/admin/builder/spi-builder-workspace/Sources/OpenAIKit/Helpers/OpenAIKitNetwork.swift:146:35: warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
144 |
145 | return AsyncThrowingStream<AIStreamResponse<ResponseType>, Error> { continuation in
146 | Task(priority: .userInitiated) {
| `- warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
147 | var streamState = StreamTaskState()
148 |
:
167 | stream.startStream()
168 |
169 | continuation.onTermination = { @Sendable [weak self] _ in
| `- note: closure captures 'self' which is accessible to code in the current task
170 | self?.terminateStream(stream)
171 | }
/Users/admin/builder/spi-builder-workspace/Sources/OpenAIKit/Helpers/OpenAIKitNetwork.swift:150:19: warning: task-isolated value of type 'AIStreamResponse<ResponseType>' passed as a strongly transferred parameter; later accesses could race; this is an error in the Swift 6 language mode
148 |
149 | stream.onMessage { data, message in
150 | continuation.yield(AIStreamResponse(stream: stream, message: message, data: data))
| `- warning: task-isolated value of type 'AIStreamResponse<ResponseType>' passed as a strongly transferred parameter; later accesses could race; this is an error in the Swift 6 language mode
151 | }
152 |
[15/18] Compiling OpenAIKit Chat.swift
/Users/admin/builder/spi-builder-workspace/Sources/OpenAIKit/OpenAIKitRequests/Chat.swift:92:18: warning: sending 'result' risks causing data races; this is an error in the Swift 6 language mode
90 | user: user
91 | ) { result in
92 | continuation.resume(returning: 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
93 | }
94 | }
[16/18] Compiling OpenAIKit EditsModels.swift
[17/18] Compiling OpenAIKit ImagesModels.swift
[18/18] Compiling OpenAIKit Images.swift
/Users/admin/builder/spi-builder-workspace/Sources/OpenAIKit/OpenAIKitRequests/Images.swift:47:18: warning: sending 'result' risks causing data races; this is an error in the Swift 6 language mode
45 | return await withCheckedContinuation { continuation in
46 | sendImagesRequest(prompt: prompt, size: size, user: user, n: n) { result in
47 | continuation.resume(returning: 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
48 | }
49 | }
/Users/admin/builder/spi-builder-workspace/Sources/OpenAIKit/OpenAIKitRequests/Images.swift:96:30: warning: sending 'result' risks causing data races; this is an error in the Swift 6 language mode
94 | sendImageEditRequest(image: image, prompt: prompt, size: size, responseFormat: responseFormat, mask: mask, user: user, n: n) {
95 | result in
96 | continuation.resume(returning: 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
97 | }
98 | }
Build complete! (13.25s)
Build complete.
{
"dependencies" : [
],
"manifest_display_name" : "OpenAIKit",
"name" : "OpenAIKit",
"path" : "/Users/admin/builder/spi-builder-workspace",
"platforms" : [
],
"products" : [
{
"name" : "OpenAIKit",
"targets" : [
"OpenAIKit"
],
"type" : {
"library" : [
"automatic"
]
}
}
],
"targets" : [
{
"c99name" : "OpenAIKitTests",
"module_type" : "SwiftTarget",
"name" : "OpenAIKitTests",
"path" : "Tests/OpenAIKitTests",
"sources" : [
"OpenAIKitTests.swift"
],
"target_dependencies" : [
"OpenAIKit"
],
"type" : "test"
},
{
"c99name" : "OpenAIKit",
"module_type" : "SwiftTarget",
"name" : "OpenAIKit",
"path" : "Sources",
"product_memberships" : [
"OpenAIKit"
],
"sources" : [
"OpenAIKit/Extensions/Extensions.swift",
"OpenAIKit/Helpers/AIEventStream.swift",
"OpenAIKit/Helpers/NetworkRoutes.swift",
"OpenAIKit/Helpers/OpenAIKitNetwork.swift",
"OpenAIKit/Helpers/OpenAISSLDelegate.swift",
"OpenAIKit/Models/AIModel.swift",
"OpenAIKit/Models/ChatCompletionsRequest.swift",
"OpenAIKit/Models/CompletionsModels.swift",
"OpenAIKit/Models/EditsModels.swift",
"OpenAIKit/Models/ImagesModels.swift",
"OpenAIKit/OpenAIKit.swift",
"OpenAIKit/OpenAIKitRequests/Chat.swift",
"OpenAIKit/OpenAIKitRequests/Completions.swift",
"OpenAIKit/OpenAIKitRequests/Edits.swift",
"OpenAIKit/OpenAIKitRequests/Images.swift"
],
"type" : "library"
}
],
"tools_version" : "5.7"
}
Done.