The Swift Package Index logo.Swift Package Index

Build Information

Failed to build OpenAISwift, reference 1.4.1 (ca66fb), with Swift 6.4 for Wasm on 19 Sep 2026 09:04:25 UTC.

Build Command

bash -c docker run --pull=always --rm -v "checkouts-53886769-2":/host -w "$PWD" -e JAVA_HOME="/root/.sdkman/candidates/java/current" -e SPI_BUILD="1" -e SPI_PROCESSING="1" registry.gitlab.com/saguaro1/spi-images:wasm-6.4-latest swift build --swift-sdk swift-6.4.x-DEVELOPMENT-SNAPSHOT-2026-09-04-a_wasm 2>&1

Build Log

========================================
RunAll
========================================
Builder version: 5.1.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/adamrushy/OpenAISwift.git
Reference: 1.4.1
Initialized empty Git repository in /host/spi-builder-workspace/.git/
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: 	git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: 	git branch -m <name>
From https://github.com/adamrushy/OpenAISwift
 * tag               1.4.1      -> FETCH_HEAD
HEAD is now at ca66fb7 Merge pull request #97 from adamrushy/feature/renaming-implementation
Cloned https://github.com/adamrushy/OpenAISwift.git
Revision (git rev-parse @):
ca66fb720d6ebb657601db5a0852b830ae310a4c
SUCCESS checkout https://github.com/adamrushy/OpenAISwift.git at 1.4.1
========================================
Build
========================================
Selected platform:         wasm
Swift version:             6.4
Building package at path:  $PWD
https://github.com/adamrushy/OpenAISwift.git
Running build ...
bash -c docker run --pull=always --rm -v "checkouts-53886769-2":/host -w "$PWD" -e JAVA_HOME="/root/.sdkman/candidates/java/current" -e SPI_BUILD="1" -e SPI_PROCESSING="1" registry.gitlab.com/saguaro1/spi-images:wasm-6.4-latest swift build --swift-sdk swift-6.4.x-DEVELOPMENT-SNAPSHOT-2026-09-04-a_wasm 2>&1
wasm-6.4-latest: Pulling from saguaro1/spi-images
Digest: sha256:4328fdb43c680d205c1d6761b1e3267aa38277eefdda9ddfb17b6a0f1a77857a
Status: Image is up to date for registry.gitlab.com/saguaro1/spi-images:wasm-6.4-latest
Building for debugging...
[Planning deferred tasks]
error: SwiftCompile normal wasm32 failed with a nonzero exit code. Command line:     cd /host

/host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:22:136: error: cannot find type 'URLRequest' in scope
 20 |         /// Initialiser
 21 |         /// - Parameter session: the session to use for network requests.
 22 |         public init(baseURL: String, endpointPrivider: OpenAIEndpointProvider, session: URLSession, authorizeRequest: @escaping (inout URLRequest) -> Void) {
    |                                                                                                                                        `- error: cannot find type 'URLRequest' in scope
 23 |             self.baseURL = baseURL
 24 |             self.endpointProvider = endpointPrivider
/host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:22:89: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 20 |         /// Initialiser
 21 |         /// - Parameter session: the session to use for network requests.
 22 |         public init(baseURL: String, endpointPrivider: OpenAIEndpointProvider, session: URLSession, authorizeRequest: @escaping (inout URLRequest) -> Void) {
    |                                                                                         `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 23 |             self.baseURL = baseURL
 24 |             self.endpointProvider = endpointPrivider
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:30:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 28 |         let baseURL: String
 29 |         let endpointProvider: OpenAIEndpointProvider
 30 |         let session:URLSession
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 31 |         let authorizeRequest: (inout URLRequest) -> Void
 32 |
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:31:38: error: cannot find type 'URLRequest' in scope
 29 |         let endpointProvider: OpenAIEndpointProvider
 30 |         let session:URLSession
 31 |         let authorizeRequest: (inout URLRequest) -> Void
    |                                      `- error: cannot find type 'URLRequest' in scope
 32 |
 33 |         public static func makeDefaultOpenAI(apiKey: String) -> Self {
/host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:292:39: error: cannot find type 'URLRequest' in scope
290 |     }
291 |
292 |     private func makeRequest(request: URLRequest, completionHandler: @escaping (Result<Data, Error>) -> Void) {
    |                                       `- error: cannot find type 'URLRequest' in scope
293 |         let session = config.session
294 |         let task = session.dataTask(with: request) { (data, response, error) in
/host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:305:113: error: cannot find type 'URLRequest' in scope
303 |     }
304 |
305 |     private func prepareRequest<BodyType: Encodable>(_ endpoint: OpenAIEndpointProvider.API, body: BodyType) -> URLRequest {
    |                                                                                                                 `- error: cannot find type 'URLRequest' in scope
306 |         var urlComponents = URLComponents(url: URL(string: config.baseURL)!, resolvingAgainstBaseURL: true)
307 |         urlComponents?.path = config.endpointProvider.getPath(api: endpoint)
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:15:31: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
13 |     var onComplete: (() -> Void)?
14 |
15 |     private lazy var session: URLSession = URLSession(configuration: .default, delegate: self, delegateQueue: nil)
   |                               `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
16 |     private var task: URLSessionDataTask?
17 |
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:15:44: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
13 |     var onComplete: (() -> Void)?
14 |
15 |     private lazy var session: URLSession = URLSession(configuration: .default, delegate: self, delegateQueue: nil)
   |                                            `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
16 |     private var task: URLSessionDataTask?
17 |
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:15:44: error: value of type '_' expected to be instance of class or class-constrained type
13 |     var onComplete: (() -> Void)?
14 |
15 |     private lazy var session: URLSession = URLSession(configuration: .default, delegate: self, delegateQueue: nil)
   |                                            `- error: value of type '_' expected to be instance of class or class-constrained type
16 |     private var task: URLSessionDataTask?
17 |
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:16:23: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
14 |
15 |     private lazy var session: URLSession = URLSession(configuration: .default, delegate: self, delegateQueue: nil)
16 |     private var task: URLSessionDataTask?
   |                       `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 |
18 |     func connect(with request: URLRequest) {
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionDataTask = AnyObject
  |                  `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:18:32: error: cannot find type 'URLRequest' in scope
16 |     private var task: URLSessionDataTask?
17 |
18 |     func connect(with request: URLRequest) {
   |                                `- error: cannot find type 'URLRequest' in scope
19 |         task = session.dataTask(with: request)
20 |         task?.resume()
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:37:36: error: cannot find type 'URLSessionDataDelegate' in scope
35 | }
36 |
37 | extension ServerSentEventsHandler: URLSessionDataDelegate {
   |                                    `- error: cannot find type 'URLSessionDataDelegate' in scope
38 |
39 |     /// It will be called several times, each time could return one chunk of data or multiple chunk of data
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:43:32: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
41 |     /// `data: {"id":"chatcmpl-6yVTvD6UAXsE9uG2SmW4Tc2iuFnnT","object":"chat.completion.chunk","created":1679878715,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"role":"assistant"},"index":0,"finish_reason":null}]}`
42 |     /// `data: {"id":"chatcmpl-6yVTvD6UAXsE9uG2SmW4Tc2iuFnnT","object":"chat.completion.chunk","created":1679878715,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"Once"},"index":0,"finish_reason":null}]}`
43 |     func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
   |                                `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
44 |         if let eventString = String(data: data, encoding: .utf8) {
45 |             let lines = eventString.split(separator: "\n")
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:43:54: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
41 |     /// `data: {"id":"chatcmpl-6yVTvD6UAXsE9uG2SmW4Tc2iuFnnT","object":"chat.completion.chunk","created":1679878715,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"role":"assistant"},"index":0,"finish_reason":null}]}`
42 |     /// `data: {"id":"chatcmpl-6yVTvD6UAXsE9uG2SmW4Tc2iuFnnT","object":"chat.completion.chunk","created":1679878715,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"Once"},"index":0,"finish_reason":null}]}`
43 |     func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
   |                                                      `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
44 |         if let eventString = String(data: data, encoding: .utf8) {
45 |             let lines = eventString.split(separator: "\n")
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionDataTask = AnyObject
  |                  `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:58:32: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
56 |     }
57 |
58 |     func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) {
   |                                `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
59 |         if let error = error {
60 |             onEventReceived?(.failure(.genericError(error: error)))
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:58:50: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
56 |     }
57 |
58 |     func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) {
   |                                                  `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
59 |         if let error = error {
60 |             onEventReceived?(.failure(.genericError(error: error)))
Foundation.URLSessionTask:2:18: note: 'URLSessionTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionTask = AnyObject
  |                  `- note: 'URLSessionTask' has been explicitly marked unavailable here
Failed frontend command:
/usr/bin/swift-frontend -frontend -emit-module -experimental-skip-non-inlinable-function-bodies-without-types /host/spi-builder-workspace/Sources/OpenAISwift/Models/ChatMessage.swift /host/spi-builder-workspace/Sources/OpenAISwift/Models/Command.swift /host/spi-builder-workspace/Sources/OpenAISwift/Models/EmbeddingsInput.swift /host/spi-builder-workspace/Sources/OpenAISwift/Models/ImageGeneration.swift /host/spi-builder-workspace/Sources/OpenAISwift/Models/Instruction.swift /host/spi-builder-workspace/Sources/OpenAISwift/Models/Moderation.swift /host/spi-builder-workspace/Sources/OpenAISwift/Models/OpenAI.swift /host/spi-builder-workspace/Sources/OpenAISwift/Models/OpenAIModelType.swift /host/spi-builder-workspace/Sources/OpenAISwift/OpenAIEndpoint.swift /host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift /host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift -target wasm32-unknown-wasip1 -disable-objc-interop -sdk /root/.swiftpm/swift-sdks/swift-6.4.x-DEVELOPMENT-SNAPSHOT-2026-09-04-a_wasm.artifactbundle/swift-6.4.x-DEVELOPMENT-SNAPSHOT-2026-09-04-a_wasm/wasm32-unknown-wasip1/WASI.sdk -sysroot /root/.swiftpm/swift-sdks/swift-6.4.x-DEVELOPMENT-SNAPSHOT-2026-09-04-a_wasm.artifactbundle/swift-6.4.x-DEVELOPMENT-SNAPSHOT-2026-09-04-a_wasm/wasm32-unknown-wasip1/WASI.sdk -I /host/spi-builder-workspace/.build/out/Products/Debug-webassembly-wasm32 -module-cache-path /host/spi-builder-workspace/.build/out/ModuleCache.noindex -color-diagnostics -Xcc -fcolor-diagnostics -enable-testing -g -debug-info-format\=dwarf -dwarf-version\=4 -swift-version 5 -Onone -D SWIFT_PACKAGE -D DEBUG -D SWIFT_MODULE_RESOURCE_BUNDLE_UNAVAILABLE -D Xcode -serialize-debugging-options -enable-experimental-feature DebugDescriptionMacro -empty-abi-descriptor -external-plugin-path /usr/lib/swift/host/plugins/testing\#/usr/bin/swift-plugin-server -validate-clang-modules-once -clang-build-session-file /host/spi-builder-workspace/.build/out/ModuleCache.noindex/Session.modulevalidation -Xcc -working-directory -Xcc /host -resource-dir /root/.swiftpm/swift-sdks/swift-6.4.x-DEVELOPMENT-SNAPSHOT-2026-09-04-a_wasm.artifactbundle/swift-6.4.x-DEVELOPMENT-SNAPSHOT-2026-09-04-a_wasm/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static -use-static-resource-dir -enable-anonymous-context-mangled-names -file-compilation-dir /host -Xcc -resource-dir -Xcc /root/.swiftpm/swift-sdks/swift-6.4.x-DEVELOPMENT-SNAPSHOT-2026-09-04-a_wasm.artifactbundle/swift-6.4.x-DEVELOPMENT-SNAPSHOT-2026-09-04-a_wasm/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang -Xcc -D_LIBCPP_HARDENING_MODE\=_LIBCPP_HARDENING_MODE_DEBUG -Xcc -fmodules-prune-interval\=86400 -Xcc -fmodules-prune-after\=345600 -Xcc -I/host/spi-builder-workspace/.build/out/Products/Debug-webassembly-wasm32/include -Xcc -I/host/spi-builder-workspace/.build/out/Intermediates.noindex/OpenAISwift.build/Debug-webassembly-wasm32/OpenAISwift-t.build/DerivedSources-normal/wasm32 -Xcc -I/host/spi-builder-workspace/.build/out/Intermediates.noindex/OpenAISwift.build/Debug-webassembly-wasm32/OpenAISwift-t.build/DerivedSources/wasm32 -Xcc -I/host/spi-builder-workspace/.build/out/Intermediates.noindex/OpenAISwift.build/Debug-webassembly-wasm32/OpenAISwift-t.build/DerivedSources -Xcc -DSWIFT_PACKAGE -Xcc -DDEBUG\=1 -no-auto-bridging-header-chaining -module-name OpenAISwift -const-gather-protocols-file /host/spi-builder-workspace/.build/out/Intermediates.noindex/OpenAISwift.build/Debug-webassembly-wasm32/OpenAISwift-t.build/Objects-normal/wasm32/OpenAISwift_const_extract_protocols.json -in-process-plugin-server-path /usr/lib/swift/host/libSwiftInProcPluginServer.so -plugin-path /usr/lib/swift/host/plugins -plugin-path /usr/local/lib/swift/host/plugins -emit-module-doc-path /host/spi-builder-workspace/.build/out/Intermediates.noindex/OpenAISwift.build/Debug-webassembly-wasm32/OpenAISwift-t.build/Objects-normal/wasm32/Modules/OpenAISwift.swiftdoc -emit-module-source-info-path /host/spi-builder-workspace/.build/out/Intermediates.noindex/OpenAISwift.build/Debug-webassembly-wasm32/OpenAISwift-t.build/Objects-normal/wasm32/Modules/OpenAISwift.swiftsourceinfo -emit-objc-header-path /host/spi-builder-workspace/.build/out/Intermediates.noindex/OpenAISwift.build/Debug-webassembly-wasm32/OpenAISwift-t.build/Objects-normal/wasm32/OpenAISwift-Swift.h -serialize-diagnostics-path /host/spi-builder-workspace/.build/out/Intermediates.noindex/OpenAISwift.build/Debug-webassembly-wasm32/OpenAISwift-t.build/Objects-normal/wasm32/OpenAISwift-primary-emit-module.dia -emit-dependencies-path /host/spi-builder-workspace/.build/out/Intermediates.noindex/OpenAISwift.build/Debug-webassembly-wasm32/OpenAISwift-t.build/Objects-normal/wasm32/OpenAISwift-primary-emit-module.d -parse-as-library -o /host/spi-builder-workspace/.build/out/Intermediates.noindex/OpenAISwift.build/Debug-webassembly-wasm32/OpenAISwift-t.build/Objects-normal/wasm32/Modules/OpenAISwift.swiftmodule
[27 / 35] OpenAISwift
error: Build failed
BUILD FAILURE 6.4 wasm