Build Information
Failed to build APIKit, reference 5.4.0 (b839e5
), with Swift 6.0 for Linux on 3 Nov 2024 13:14:19 UTC.
Build Command
bash -c docker run --pull=always --rm -v "checkouts-4609320-0":/host -w "$PWD" registry.gitlab.com/finestructure/spi-images:basic-6.0-latest swift build --triple x86_64-unknown-linux-gnu -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete 2>&1
Build Log
/host/spi-builder-workspace/Sources/APIKit/Request.swift:55:46: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
53 | /// if the HTTP status code is not in `200..<300`.
54 | /// - Throws: `Error`
55 | func intercept(object: Any, urlResponse: HTTPURLResponse) throws -> Any
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
56 |
57 | /// Build `Response` instance from raw response object. This method is called after
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/Request.swift:60:50: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
58 | /// `intercept(object:urlResponse:)` if it does not throw any error.
59 | /// - Throws: `Error`
60 | func response(from object: Any, urlResponse: HTTPURLResponse) throws -> Response
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
61 | }
62 |
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/Request.swift:92:54: error: cannot find type 'URLRequest' in scope
90 | }
91 |
92 | func intercept(urlRequest: URLRequest) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
93 | return urlRequest
94 | }
/host/spi-builder-workspace/Sources/APIKit/Request.swift:92:32: error: cannot find type 'URLRequest' in scope
90 | }
91 |
92 | func intercept(urlRequest: URLRequest) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
93 | return urlRequest
94 | }
/host/spi-builder-workspace/Sources/APIKit/Request.swift:96:46: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
94 | }
95 |
96 | func intercept(object: Any, urlResponse: HTTPURLResponse) throws -> Any {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
97 | guard 200..<300 ~= urlResponse.statusCode else {
98 | throw ResponseError.unacceptableStatusCode(urlResponse.statusCode)
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/Request.swift:105:38: error: cannot find type 'URLRequest' in scope
103 | /// Builds `URLRequest` from properties of `self`.
104 | /// - Throws: `RequestError`, `Error`
105 | func buildURLRequest() throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
106 | let url = path.isEmpty ? baseURL : baseURL.appendingPathComponent(path)
107 | guard var components = URLComponents(url: url, resolvingAgainstBaseURL: true) else {
/host/spi-builder-workspace/Sources/APIKit/Request.swift:142:41: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
140 | /// Builds `Response` from response `Data`.
141 | /// - Throws: `ResponseError`, `Error`
142 | func parse(data: Data, urlResponse: HTTPURLResponse) throws -> Response {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
143 | let parsedObject = try dataParser.parse(data: data)
144 | let passedObject = try intercept(object: parsedObject, urlResponse: urlResponse)
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/Request.swift:150:50: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
148 |
149 | public extension Request where Response == Void {
150 | func response(from object: Any, urlResponse: HTTPURLResponse) throws {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
151 | return
152 | }
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/Serializations/URLEncodedSerialization.swift:50:14: warning: associated value 'cannotCastObjectToDictionary' of 'Sendable'-conforming enum 'Error' has non-sendable type 'Any'; this is an error in the Swift 6 language mode
48 | case cannotGetStringFromData(Data, String.Encoding)
49 | case cannotGetDataFromString(String, String.Encoding)
50 | case cannotCastObjectToDictionary(Any)
| `- warning: associated value 'cannotCastObjectToDictionary' of 'Sendable'-conforming enum 'Error' has non-sendable type 'Any'; this is an error in the Swift 6 language mode
51 | case invalidFormatString(String)
52 | }
/host/spi-builder-workspace/Sources/APIKit/Session.swift:3:13: warning: var 'taskRequestKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
1 | import Foundation
2 |
3 | private var taskRequestKey = 0
| |- warning: var 'taskRequestKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'taskRequestKey' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: annotate 'taskRequestKey' 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
4 |
5 | /// `Session` manages tasks for HTTP/HTTPS requests.
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/SessionAdapter.swift:14:38: error: cannot find type 'URLRequest' in scope
12 | public protocol SessionAdapter {
13 | /// Returns instance that conforms to `SessionTask`. `handler` must be called after success or failure.
14 | func createTask(with URLRequest: URLRequest, handler: @escaping (Data?, URLResponse?, Error?) -> Void) -> SessionTask
| `- error: cannot find type 'URLRequest' in scope
15 |
16 | /// Collects tasks from backend networking stack. `handler` must be called after collecting.
/host/spi-builder-workspace/Sources/APIKit/Session.swift:22:24: warning: static property 'privateShared' is not concurrency-safe because non-'Sendable' type 'Session' may have shared mutable state; this is an error in the Swift 6 language mode
4 |
5 | /// `Session` manages tasks for HTTP/HTTPS requests.
6 | open class Session {
| `- note: class 'Session' does not conform to the 'Sendable' protocol
7 | /// The adapter that connects `Session` instance and lower level backend.
8 | public let adapter: SessionAdapter
:
20 |
21 | // Shared session for class methods
22 | private static let privateShared: Session = {
| |- warning: static property 'privateShared' is not concurrency-safe because non-'Sendable' type 'Session' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'privateShared' 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
23 | let configuration = URLSessionConfiguration.default
24 | let adapter = URLSessionAdapter(configuration: configuration)
/host/spi-builder-workspace/Sources/APIKit/Session.swift:23:53: error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
21 | // Shared session for class methods
22 | private static let privateShared: Session = {
23 | let configuration = URLSessionConfiguration.default
| `- error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
24 | let adapter = URLSessionAdapter(configuration: configuration)
25 | return Session(adapter: adapter)
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/SessionAdapter.swift:14:77: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
12 | public protocol SessionAdapter {
13 | /// Returns instance that conforms to `SessionTask`. `handler` must be called after success or failure.
14 | func createTask(with URLRequest: URLRequest, handler: @escaping (Data?, URLResponse?, Error?) -> Void) -> SessionTask
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
15 |
16 | /// Collects tasks from backend networking stack. `handler` must be called after collecting.
Foundation.URLResponse:2:18: note: 'URLResponse' 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 URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:3:1: error: non-nominal type 'URLSessionTask' (aka 'AnyObject') cannot be extended
1 | import Foundation
2 |
3 | extension URLSessionTask: SessionTask {
| `- error: non-nominal type 'URLSessionTask' (aka 'AnyObject') cannot be extended
4 |
5 | }
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:7:13: warning: var 'dataTaskResponseBufferKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
5 | }
6 |
7 | private var dataTaskResponseBufferKey = 0
| |- warning: var 'dataTaskResponseBufferKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'dataTaskResponseBufferKey' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: annotate 'dataTaskResponseBufferKey' 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
8 | private var taskAssociatedObjectCompletionHandlerKey = 0
9 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:8:13: warning: var 'taskAssociatedObjectCompletionHandlerKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
6 |
7 | private var dataTaskResponseBufferKey = 0
8 | private var taskAssociatedObjectCompletionHandlerKey = 0
| |- warning: var 'taskAssociatedObjectCompletionHandlerKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'taskAssociatedObjectCompletionHandlerKey' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: annotate 'taskAssociatedObjectCompletionHandlerKey' 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
9 |
10 | /// `URLSessionAdapter` connects `URLSession` with `Session`.
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:19:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 | open class URLSessionAdapter: NSObject, SessionAdapter, URLSessionDelegate, URLSessionTaskDelegate, URLSessionDataDelegate {
18 | /// The underlying `URLSession` instance.
19 | open var urlSession: URLSession!
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |
21 | /// Returns `URLSessionAdapter` initialized with `URLSessionConfiguration`.
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/APIKit/SessionAdapter/URLSessionAdapter.swift:22:32: error: 'URLSessionConfiguration' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |
21 | /// Returns `URLSessionAdapter` initialized with `URLSessionConfiguration`.
22 | public init(configuration: URLSessionConfiguration) {
| `- error: 'URLSessionConfiguration' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
23 | super.init()
24 | self.urlSession = URLSession(configuration: configuration, delegate: self, delegateQueue: nil)
Foundation.URLSessionConfiguration:2:18: note: 'URLSessionConfiguration' 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 URLSessionConfiguration = AnyObject
| `- note: 'URLSessionConfiguration' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:28:43: error: cannot find type 'URLRequest' in scope
26 |
27 | /// Creates `URLSessionDataTask` instance using `dataTaskWithRequest(_:completionHandler:)`.
28 | open func createTask(with URLRequest: URLRequest, handler: @escaping (Data?, URLResponse?, Error?) -> Void) -> SessionTask {
| `- error: cannot find type 'URLRequest' in scope
29 | let task = urlSession.dataTask(with: URLRequest)
30 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:28:82: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
26 |
27 | /// Creates `URLSessionDataTask` instance using `dataTaskWithRequest(_:completionHandler:)`.
28 | open func createTask(with URLRequest: URLRequest, handler: @escaping (Data?, URLResponse?, Error?) -> Void) -> SessionTask {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
29 | let task = urlSession.dataTask(with: URLRequest)
30 |
Foundation.URLResponse:2:18: note: 'URLResponse' 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 URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:45:67: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
43 | }
44 |
45 | private func setBuffer(_ buffer: NSMutableData, forTask task: URLSessionTask) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
46 | objc_setAssociatedObject(task, &dataTaskResponseBufferKey, buffer, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
47 | }
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
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:49:35: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
47 | }
48 |
49 | private func buffer(for task: URLSessionTask) -> NSMutableData? {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
50 | return objc_getAssociatedObject(task, &dataTaskResponseBufferKey) as? NSMutableData
51 | }
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
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:53:58: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
51 | }
52 |
53 | private func setHandler(_ handler: @escaping (Data?, URLResponse?, Error?) -> Void, forTask task: URLSessionTask) {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
54 | objc_setAssociatedObject(task, &taskAssociatedObjectCompletionHandlerKey, handler as Any, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
55 | }
Foundation.URLResponse:2:18: note: 'URLResponse' 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 URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:53:103: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
51 | }
52 |
53 | private func setHandler(_ handler: @escaping (Data?, URLResponse?, Error?) -> Void, forTask task: URLSessionTask) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
54 | objc_setAssociatedObject(task, &taskAssociatedObjectCompletionHandlerKey, handler as Any, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
55 | }
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
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:57:36: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
55 | }
56 |
57 | private func handler(for task: URLSessionTask) -> ((Data?, URLResponse?, Error?) -> Void)? {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
58 | return objc_getAssociatedObject(task, &taskAssociatedObjectCompletionHandlerKey) as? (Data?, URLResponse?, Error?) -> Void
59 | }
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
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:57:64: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
55 | }
56 |
57 | private func handler(for task: URLSessionTask) -> ((Data?, URLResponse?, Error?) -> Void)? {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
58 | return objc_getAssociatedObject(task, &taskAssociatedObjectCompletionHandlerKey) as? (Data?, URLResponse?, Error?) -> Void
59 | }
Foundation.URLResponse:2:18: note: 'URLResponse' 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 URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:62:37: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
60 |
61 | // MARK: URLSessionTaskDelegate
62 | open 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.
63 | handler(for: task)?(buffer(for: task) as Data?, task.response, error)
64 | }
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/APIKit/SessionAdapter/URLSessionAdapter.swift:62:55: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
60 |
61 | // MARK: URLSessionTaskDelegate
62 | open 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.
63 | handler(for: task)?(buffer(for: task) as Data?, task.response, error)
64 | }
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
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:67:37: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
65 |
66 | // MARK: URLSessionDataDelegate
67 | open 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.
68 | buffer(for: dataTask)?.append(data)
69 | }
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/APIKit/SessionAdapter/URLSessionAdapter.swift:67:59: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
65 |
66 | // MARK: URLSessionDataDelegate
67 | open 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.
68 | buffer(for: dataTask)?.append(data)
69 | }
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/APIKit/SessionAdapter/URLSessionAdapter.swift:17:57: error: cannot find type 'URLSessionDelegate' in scope
15 | /// `URLSession(_:task: didCompleteWithError:)` and `URLSession(_:dataTask:didReceiveData:)`, you have to call
16 | /// `super` in these methods if you implement them.
17 | open class URLSessionAdapter: NSObject, SessionAdapter, URLSessionDelegate, URLSessionTaskDelegate, URLSessionDataDelegate {
| `- error: cannot find type 'URLSessionDelegate' in scope
18 | /// The underlying `URLSession` instance.
19 | open var urlSession: URLSession!
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:17:77: error: cannot find type 'URLSessionTaskDelegate' in scope
15 | /// `URLSession(_:task: didCompleteWithError:)` and `URLSession(_:dataTask:didReceiveData:)`, you have to call
16 | /// `super` in these methods if you implement them.
17 | open class URLSessionAdapter: NSObject, SessionAdapter, URLSessionDelegate, URLSessionTaskDelegate, URLSessionDataDelegate {
| `- error: cannot find type 'URLSessionTaskDelegate' in scope
18 | /// The underlying `URLSession` instance.
19 | open var urlSession: URLSession!
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:17:101: error: cannot find type 'URLSessionDataDelegate' in scope
15 | /// `URLSession(_:task: didCompleteWithError:)` and `URLSession(_:dataTask:didReceiveData:)`, you have to call
16 | /// `super` in these methods if you implement them.
17 | open class URLSessionAdapter: NSObject, SessionAdapter, URLSessionDelegate, URLSessionTaskDelegate, URLSessionDataDelegate {
| `- error: cannot find type 'URLSessionDataDelegate' in scope
18 | /// The underlying `URLSession` instance.
19 | open var urlSession: URLSession!
[10/27] Compiling APIKit JSONBodyParameters.swift
/host/spi-builder-workspace/Sources/APIKit/BodyParameters/MultipartFormDataBodyParameters.swift:32:78: error: cannot find 'arc4random' in scope
30 | public let entityType: EntityType
31 |
32 | public init(parts: [Part], boundary: String = String(format: "%08x%08x", arc4random(), arc4random()), entityType: EntityType = .data) {
| `- error: cannot find 'arc4random' in scope
33 | self.parts = parts
34 | self.boundary = boundary
/host/spi-builder-workspace/Sources/APIKit/BodyParameters/MultipartFormDataBodyParameters.swift:32:92: error: cannot find 'arc4random' in scope
30 | public let entityType: EntityType
31 |
32 | public init(parts: [Part], boundary: String = String(format: "%08x%08x", arc4random(), arc4random()), entityType: EntityType = .data) {
| `- error: cannot find 'arc4random' in scope
33 | self.parts = parts
34 | self.boundary = boundary
/host/spi-builder-workspace/Sources/APIKit/BodyParameters/MultipartFormDataBodyParameters.swift:63:18: warning: associated value 'illegalValue' of 'Sendable'-conforming enum 'Error' has non-sendable type 'Any'; this is an error in the Swift 6 language mode
61 | struct Part {
62 | public enum Error: Swift.Error {
63 | case illegalValue(Any)
| `- warning: associated value 'illegalValue' of 'Sendable'-conforming enum 'Error' has non-sendable type 'Any'; this is an error in the Swift 6 language mode
64 | case illegalFileURL(URL)
65 | case cannotGetFileSize(URL)
/host/spi-builder-workspace/Sources/APIKit/BodyParameters/MultipartFormDataBodyParameters.swift:114:36: error: cannot find 'UTTypeCreatePreferredIdentifierForTag' in scope
112 | }
113 |
114 | let detectedMimeType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, fileURL.pathExtension as CFString, nil)
| `- error: cannot find 'UTTypeCreatePreferredIdentifierForTag' in scope
115 | .map { $0.takeRetainedValue() }
116 | .flatMap { UTTypeCopyPreferredTagWithClass($0, kUTTagClassMIMEType)?.takeRetainedValue() }
/host/spi-builder-workspace/Sources/APIKit/BodyParameters/MultipartFormDataBodyParameters.swift:114:74: error: cannot find 'kUTTagClassFilenameExtension' in scope
112 | }
113 |
114 | let detectedMimeType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, fileURL.pathExtension as CFString, nil)
| `- error: cannot find 'kUTTagClassFilenameExtension' in scope
115 | .map { $0.takeRetainedValue() }
116 | .flatMap { UTTypeCopyPreferredTagWithClass($0, kUTTagClassMIMEType)?.takeRetainedValue() }
/host/spi-builder-workspace/Sources/APIKit/BodyParameters/MultipartFormDataBodyParameters.swift:116:28: error: cannot find 'UTTypeCopyPreferredTagWithClass' in scope
114 | let detectedMimeType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, fileURL.pathExtension as CFString, nil)
115 | .map { $0.takeRetainedValue() }
116 | .flatMap { UTTypeCopyPreferredTagWithClass($0, kUTTagClassMIMEType)?.takeRetainedValue() }
| `- error: cannot find 'UTTypeCopyPreferredTagWithClass' in scope
117 | .map { $0 as String }
118 |
/host/spi-builder-workspace/Sources/APIKit/BodyParameters/MultipartFormDataBodyParameters.swift:116:64: error: cannot find 'kUTTagClassMIMEType' in scope
114 | let detectedMimeType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, fileURL.pathExtension as CFString, nil)
115 | .map { $0.takeRetainedValue() }
116 | .flatMap { UTTypeCopyPreferredTagWithClass($0, kUTTagClassMIMEType)?.takeRetainedValue() }
| `- error: cannot find 'kUTTagClassMIMEType' in scope
117 | .map { $0 as String }
118 |
/host/spi-builder-workspace/Sources/APIKit/BodyParameters/MultipartFormDataBodyParameters.swift:114:129: error: cannot find type 'CFString' in scope
112 | }
113 |
114 | let detectedMimeType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, fileURL.pathExtension as CFString, nil)
| `- error: cannot find type 'CFString' in scope
115 | .map { $0.takeRetainedValue() }
116 | .flatMap { UTTypeCopyPreferredTagWithClass($0, kUTTagClassMIMEType)?.takeRetainedValue() }
/host/spi-builder-workspace/Sources/APIKit/BodyParameters/MultipartFormDataBodyParameters.swift:114:139: error: 'nil' requires a contextual type
112 | }
113 |
114 | let detectedMimeType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, fileURL.pathExtension as CFString, nil)
| `- error: 'nil' requires a contextual type
115 | .map { $0.takeRetainedValue() }
116 | .flatMap { UTTypeCopyPreferredTagWithClass($0, kUTTagClassMIMEType)?.takeRetainedValue() }
[11/27] Compiling APIKit MultipartFormDataBodyParameters.swift
/host/spi-builder-workspace/Sources/APIKit/BodyParameters/MultipartFormDataBodyParameters.swift:32:78: error: cannot find 'arc4random' in scope
30 | public let entityType: EntityType
31 |
32 | public init(parts: [Part], boundary: String = String(format: "%08x%08x", arc4random(), arc4random()), entityType: EntityType = .data) {
| `- error: cannot find 'arc4random' in scope
33 | self.parts = parts
34 | self.boundary = boundary
/host/spi-builder-workspace/Sources/APIKit/BodyParameters/MultipartFormDataBodyParameters.swift:32:92: error: cannot find 'arc4random' in scope
30 | public let entityType: EntityType
31 |
32 | public init(parts: [Part], boundary: String = String(format: "%08x%08x", arc4random(), arc4random()), entityType: EntityType = .data) {
| `- error: cannot find 'arc4random' in scope
33 | self.parts = parts
34 | self.boundary = boundary
/host/spi-builder-workspace/Sources/APIKit/BodyParameters/MultipartFormDataBodyParameters.swift:63:18: warning: associated value 'illegalValue' of 'Sendable'-conforming enum 'Error' has non-sendable type 'Any'; this is an error in the Swift 6 language mode
61 | struct Part {
62 | public enum Error: Swift.Error {
63 | case illegalValue(Any)
| `- warning: associated value 'illegalValue' of 'Sendable'-conforming enum 'Error' has non-sendable type 'Any'; this is an error in the Swift 6 language mode
64 | case illegalFileURL(URL)
65 | case cannotGetFileSize(URL)
/host/spi-builder-workspace/Sources/APIKit/BodyParameters/MultipartFormDataBodyParameters.swift:114:36: error: cannot find 'UTTypeCreatePreferredIdentifierForTag' in scope
112 | }
113 |
114 | let detectedMimeType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, fileURL.pathExtension as CFString, nil)
| `- error: cannot find 'UTTypeCreatePreferredIdentifierForTag' in scope
115 | .map { $0.takeRetainedValue() }
116 | .flatMap { UTTypeCopyPreferredTagWithClass($0, kUTTagClassMIMEType)?.takeRetainedValue() }
/host/spi-builder-workspace/Sources/APIKit/BodyParameters/MultipartFormDataBodyParameters.swift:114:74: error: cannot find 'kUTTagClassFilenameExtension' in scope
112 | }
113 |
114 | let detectedMimeType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, fileURL.pathExtension as CFString, nil)
| `- error: cannot find 'kUTTagClassFilenameExtension' in scope
115 | .map { $0.takeRetainedValue() }
116 | .flatMap { UTTypeCopyPreferredTagWithClass($0, kUTTagClassMIMEType)?.takeRetainedValue() }
/host/spi-builder-workspace/Sources/APIKit/BodyParameters/MultipartFormDataBodyParameters.swift:116:28: error: cannot find 'UTTypeCopyPreferredTagWithClass' in scope
114 | let detectedMimeType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, fileURL.pathExtension as CFString, nil)
115 | .map { $0.takeRetainedValue() }
116 | .flatMap { UTTypeCopyPreferredTagWithClass($0, kUTTagClassMIMEType)?.takeRetainedValue() }
| `- error: cannot find 'UTTypeCopyPreferredTagWithClass' in scope
117 | .map { $0 as String }
118 |
/host/spi-builder-workspace/Sources/APIKit/BodyParameters/MultipartFormDataBodyParameters.swift:116:64: error: cannot find 'kUTTagClassMIMEType' in scope
114 | let detectedMimeType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, fileURL.pathExtension as CFString, nil)
115 | .map { $0.takeRetainedValue() }
116 | .flatMap { UTTypeCopyPreferredTagWithClass($0, kUTTagClassMIMEType)?.takeRetainedValue() }
| `- error: cannot find 'kUTTagClassMIMEType' in scope
117 | .map { $0 as String }
118 |
/host/spi-builder-workspace/Sources/APIKit/BodyParameters/MultipartFormDataBodyParameters.swift:114:129: error: cannot find type 'CFString' in scope
112 | }
113 |
114 | let detectedMimeType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, fileURL.pathExtension as CFString, nil)
| `- error: cannot find type 'CFString' in scope
115 | .map { $0.takeRetainedValue() }
116 | .flatMap { UTTypeCopyPreferredTagWithClass($0, kUTTagClassMIMEType)?.takeRetainedValue() }
/host/spi-builder-workspace/Sources/APIKit/BodyParameters/MultipartFormDataBodyParameters.swift:114:139: error: 'nil' requires a contextual type
112 | }
113 |
114 | let detectedMimeType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, fileURL.pathExtension as CFString, nil)
| `- error: 'nil' requires a contextual type
115 | .map { $0.takeRetainedValue() }
116 | .flatMap { UTTypeCopyPreferredTagWithClass($0, kUTTagClassMIMEType)?.takeRetainedValue() }
[12/27] Compiling APIKit ProtobufBodyParameters.swift
/host/spi-builder-workspace/Sources/APIKit/BodyParameters/MultipartFormDataBodyParameters.swift:32:78: error: cannot find 'arc4random' in scope
30 | public let entityType: EntityType
31 |
32 | public init(parts: [Part], boundary: String = String(format: "%08x%08x", arc4random(), arc4random()), entityType: EntityType = .data) {
| `- error: cannot find 'arc4random' in scope
33 | self.parts = parts
34 | self.boundary = boundary
/host/spi-builder-workspace/Sources/APIKit/BodyParameters/MultipartFormDataBodyParameters.swift:32:92: error: cannot find 'arc4random' in scope
30 | public let entityType: EntityType
31 |
32 | public init(parts: [Part], boundary: String = String(format: "%08x%08x", arc4random(), arc4random()), entityType: EntityType = .data) {
| `- error: cannot find 'arc4random' in scope
33 | self.parts = parts
34 | self.boundary = boundary
/host/spi-builder-workspace/Sources/APIKit/BodyParameters/MultipartFormDataBodyParameters.swift:63:18: warning: associated value 'illegalValue' of 'Sendable'-conforming enum 'Error' has non-sendable type 'Any'; this is an error in the Swift 6 language mode
61 | struct Part {
62 | public enum Error: Swift.Error {
63 | case illegalValue(Any)
| `- warning: associated value 'illegalValue' of 'Sendable'-conforming enum 'Error' has non-sendable type 'Any'; this is an error in the Swift 6 language mode
64 | case illegalFileURL(URL)
65 | case cannotGetFileSize(URL)
/host/spi-builder-workspace/Sources/APIKit/BodyParameters/MultipartFormDataBodyParameters.swift:114:36: error: cannot find 'UTTypeCreatePreferredIdentifierForTag' in scope
112 | }
113 |
114 | let detectedMimeType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, fileURL.pathExtension as CFString, nil)
| `- error: cannot find 'UTTypeCreatePreferredIdentifierForTag' in scope
115 | .map { $0.takeRetainedValue() }
116 | .flatMap { UTTypeCopyPreferredTagWithClass($0, kUTTagClassMIMEType)?.takeRetainedValue() }
/host/spi-builder-workspace/Sources/APIKit/BodyParameters/MultipartFormDataBodyParameters.swift:114:74: error: cannot find 'kUTTagClassFilenameExtension' in scope
112 | }
113 |
114 | let detectedMimeType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, fileURL.pathExtension as CFString, nil)
| `- error: cannot find 'kUTTagClassFilenameExtension' in scope
115 | .map { $0.takeRetainedValue() }
116 | .flatMap { UTTypeCopyPreferredTagWithClass($0, kUTTagClassMIMEType)?.takeRetainedValue() }
/host/spi-builder-workspace/Sources/APIKit/BodyParameters/MultipartFormDataBodyParameters.swift:116:28: error: cannot find 'UTTypeCopyPreferredTagWithClass' in scope
114 | let detectedMimeType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, fileURL.pathExtension as CFString, nil)
115 | .map { $0.takeRetainedValue() }
116 | .flatMap { UTTypeCopyPreferredTagWithClass($0, kUTTagClassMIMEType)?.takeRetainedValue() }
| `- error: cannot find 'UTTypeCopyPreferredTagWithClass' in scope
117 | .map { $0 as String }
118 |
/host/spi-builder-workspace/Sources/APIKit/BodyParameters/MultipartFormDataBodyParameters.swift:116:64: error: cannot find 'kUTTagClassMIMEType' in scope
114 | let detectedMimeType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, fileURL.pathExtension as CFString, nil)
115 | .map { $0.takeRetainedValue() }
116 | .flatMap { UTTypeCopyPreferredTagWithClass($0, kUTTagClassMIMEType)?.takeRetainedValue() }
| `- error: cannot find 'kUTTagClassMIMEType' in scope
117 | .map { $0 as String }
118 |
/host/spi-builder-workspace/Sources/APIKit/BodyParameters/MultipartFormDataBodyParameters.swift:114:129: error: cannot find type 'CFString' in scope
112 | }
113 |
114 | let detectedMimeType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, fileURL.pathExtension as CFString, nil)
| `- error: cannot find type 'CFString' in scope
115 | .map { $0.takeRetainedValue() }
116 | .flatMap { UTTypeCopyPreferredTagWithClass($0, kUTTagClassMIMEType)?.takeRetainedValue() }
/host/spi-builder-workspace/Sources/APIKit/BodyParameters/MultipartFormDataBodyParameters.swift:114:139: error: 'nil' requires a contextual type
112 | }
113 |
114 | let detectedMimeType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, fileURL.pathExtension as CFString, nil)
| `- error: 'nil' requires a contextual type
115 | .map { $0.takeRetainedValue() }
116 | .flatMap { UTTypeCopyPreferredTagWithClass($0, kUTTagClassMIMEType)?.takeRetainedValue() }
[13/27] Compiling APIKit Request.swift
/host/spi-builder-workspace/Sources/APIKit/Request.swift:48:54: error: cannot find type 'URLRequest' in scope
46 | /// thrown in this method, the result of `Session.send()` turns `.failure(.requestError(error))`.
47 | /// - Throws: `Error`
48 | func intercept(urlRequest: URLRequest) throws -> URLRequest
| `- error: cannot find type 'URLRequest' in scope
49 |
50 | /// Intercepts response `Any` and `HTTPURLResponse`. If an error is thrown in this method,
/host/spi-builder-workspace/Sources/APIKit/Request.swift:48:32: error: cannot find type 'URLRequest' in scope
46 | /// thrown in this method, the result of `Session.send()` turns `.failure(.requestError(error))`.
47 | /// - Throws: `Error`
48 | func intercept(urlRequest: URLRequest) throws -> URLRequest
| `- error: cannot find type 'URLRequest' in scope
49 |
50 | /// Intercepts response `Any` and `HTTPURLResponse`. If an error is thrown in this method,
/host/spi-builder-workspace/Sources/APIKit/Request.swift:55:46: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
53 | /// if the HTTP status code is not in `200..<300`.
54 | /// - Throws: `Error`
55 | func intercept(object: Any, urlResponse: HTTPURLResponse) throws -> Any
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
56 |
57 | /// Build `Response` instance from raw response object. This method is called after
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/Request.swift:60:50: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
58 | /// `intercept(object:urlResponse:)` if it does not throw any error.
59 | /// - Throws: `Error`
60 | func response(from object: Any, urlResponse: HTTPURLResponse) throws -> Response
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
61 | }
62 |
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/Request.swift:92:54: error: cannot find type 'URLRequest' in scope
90 | }
91 |
92 | func intercept(urlRequest: URLRequest) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
93 | return urlRequest
94 | }
/host/spi-builder-workspace/Sources/APIKit/Request.swift:92:32: error: cannot find type 'URLRequest' in scope
90 | }
91 |
92 | func intercept(urlRequest: URLRequest) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
93 | return urlRequest
94 | }
/host/spi-builder-workspace/Sources/APIKit/Request.swift:96:46: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
94 | }
95 |
96 | func intercept(object: Any, urlResponse: HTTPURLResponse) throws -> Any {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
97 | guard 200..<300 ~= urlResponse.statusCode else {
98 | throw ResponseError.unacceptableStatusCode(urlResponse.statusCode)
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/Request.swift:105:38: error: cannot find type 'URLRequest' in scope
103 | /// Builds `URLRequest` from properties of `self`.
104 | /// - Throws: `RequestError`, `Error`
105 | func buildURLRequest() throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
106 | let url = path.isEmpty ? baseURL : baseURL.appendingPathComponent(path)
107 | guard var components = URLComponents(url: url, resolvingAgainstBaseURL: true) else {
/host/spi-builder-workspace/Sources/APIKit/Request.swift:142:41: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
140 | /// Builds `Response` from response `Data`.
141 | /// - Throws: `ResponseError`, `Error`
142 | func parse(data: Data, urlResponse: HTTPURLResponse) throws -> Response {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
143 | let parsedObject = try dataParser.parse(data: data)
144 | let passedObject = try intercept(object: parsedObject, urlResponse: urlResponse)
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/Request.swift:150:50: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
148 |
149 | public extension Request where Response == Void {
150 | func response(from object: Any, urlResponse: HTTPURLResponse) throws {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
151 | return
152 | }
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/Request.swift:97:40: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
95 |
96 | func intercept(object: Any, urlResponse: HTTPURLResponse) throws -> Any {
97 | guard 200..<300 ~= urlResponse.statusCode else {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
98 | throw ResponseError.unacceptableStatusCode(urlResponse.statusCode)
99 | }
/host/spi-builder-workspace/Sources/APIKit/Request.swift:98:68: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
96 | func intercept(object: Any, urlResponse: HTTPURLResponse) throws -> Any {
97 | guard 200..<300 ~= urlResponse.statusCode else {
98 | throw ResponseError.unacceptableStatusCode(urlResponse.statusCode)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
99 | }
100 | return object
/host/spi-builder-workspace/Sources/APIKit/Request.swift:111:26: error: cannot find 'URLRequest' in scope
109 | }
110 |
111 | var urlRequest = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
112 |
113 | if let queryParameters = queryParameters, !queryParameters.isEmpty {
/host/spi-builder-workspace/Sources/APIKit/Serializations/URLEncodedSerialization.swift:50:14: warning: associated value 'cannotCastObjectToDictionary' of 'Sendable'-conforming enum 'Error' has non-sendable type 'Any'; this is an error in the Swift 6 language mode
48 | case cannotGetStringFromData(Data, String.Encoding)
49 | case cannotGetDataFromString(String, String.Encoding)
50 | case cannotCastObjectToDictionary(Any)
| `- warning: associated value 'cannotCastObjectToDictionary' of 'Sendable'-conforming enum 'Error' has non-sendable type 'Any'; this is an error in the Swift 6 language mode
51 | case invalidFormatString(String)
52 | }
/host/spi-builder-workspace/Sources/APIKit/Serializations/URLEncodedSerialization.swift:41:12: error: cannot find 'CFURLCreateStringByReplacingPercentEscapes' in scope
39 |
40 | private func unescape(_ string: String) -> String {
41 | return CFURLCreateStringByReplacingPercentEscapes(nil, string as CFString, nil) as String
| `- error: cannot find 'CFURLCreateStringByReplacingPercentEscapes' in scope
42 | }
43 |
/host/spi-builder-workspace/Sources/APIKit/Serializations/URLEncodedSerialization.swift:41:70: error: cannot find type 'CFString' in scope
39 |
40 | private func unescape(_ string: String) -> String {
41 | return CFURLCreateStringByReplacingPercentEscapes(nil, string as CFString, nil) as String
| `- error: cannot find type 'CFString' in scope
42 | }
43 |
/host/spi-builder-workspace/Sources/APIKit/Serializations/URLEncodedSerialization.swift:41:55: error: 'nil' requires a contextual type
39 |
40 | private func unescape(_ string: String) -> String {
41 | return CFURLCreateStringByReplacingPercentEscapes(nil, string as CFString, nil) as String
| `- error: 'nil' requires a contextual type
42 | }
43 |
/host/spi-builder-workspace/Sources/APIKit/Serializations/URLEncodedSerialization.swift:41:80: error: 'nil' requires a contextual type
39 |
40 | private func unescape(_ string: String) -> String {
41 | return CFURLCreateStringByReplacingPercentEscapes(nil, string as CFString, nil) as String
| `- error: 'nil' requires a contextual type
42 | }
43 |
/host/spi-builder-workspace/Sources/APIKit/Session.swift:3:13: warning: var 'taskRequestKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
1 | import Foundation
2 |
3 | private var taskRequestKey = 0
| |- warning: var 'taskRequestKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'taskRequestKey' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: annotate 'taskRequestKey' 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
4 |
5 | /// `Session` manages tasks for HTTP/HTTPS requests.
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/SessionAdapter.swift:14:38: error: cannot find type 'URLRequest' in scope
12 | public protocol SessionAdapter {
13 | /// Returns instance that conforms to `SessionTask`. `handler` must be called after success or failure.
14 | func createTask(with URLRequest: URLRequest, handler: @escaping (Data?, URLResponse?, Error?) -> Void) -> SessionTask
| `- error: cannot find type 'URLRequest' in scope
15 |
16 | /// Collects tasks from backend networking stack. `handler` must be called after collecting.
/host/spi-builder-workspace/Sources/APIKit/Session.swift:22:24: warning: static property 'privateShared' is not concurrency-safe because non-'Sendable' type 'Session' may have shared mutable state; this is an error in the Swift 6 language mode
4 |
5 | /// `Session` manages tasks for HTTP/HTTPS requests.
6 | open class Session {
| `- note: class 'Session' does not conform to the 'Sendable' protocol
7 | /// The adapter that connects `Session` instance and lower level backend.
8 | public let adapter: SessionAdapter
:
20 |
21 | // Shared session for class methods
22 | private static let privateShared: Session = {
| |- warning: static property 'privateShared' is not concurrency-safe because non-'Sendable' type 'Session' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'privateShared' 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
23 | let configuration = URLSessionConfiguration.default
24 | let adapter = URLSessionAdapter(configuration: configuration)
/host/spi-builder-workspace/Sources/APIKit/Session.swift:23:53: error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
21 | // Shared session for class methods
22 | private static let privateShared: Session = {
23 | let configuration = URLSessionConfiguration.default
| `- error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
24 | let adapter = URLSessionAdapter(configuration: configuration)
25 | return Session(adapter: adapter)
/host/spi-builder-workspace/Sources/APIKit/Session.swift:82:25: error: cannot find type 'URLRequest' in scope
80 | internal func createSessionTask<Request: APIKit.Request>(_ request: Request, callbackQueue: CallbackQueue?, handler: @escaping (Result<Request.Response, SessionTaskError>) -> Void) -> SessionTask? {
81 | let callbackQueue = callbackQueue ?? self.callbackQueue
82 | let urlRequest: URLRequest
| `- error: cannot find type 'URLRequest' in scope
83 | do {
84 | urlRequest = try request.buildURLRequest()
/host/spi-builder-workspace/Sources/APIKit/Session.swift:121:9: error: cannot find 'objc_setAssociatedObject' in scope
119 |
120 | private func setRequest<Request: APIKit.Request>(_ request: Request, forTask task: SessionTask) {
121 | objc_setAssociatedObject(task, &taskRequestKey, request, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
| `- error: cannot find 'objc_setAssociatedObject' in scope
122 | }
123 |
/host/spi-builder-workspace/Sources/APIKit/Session.swift:121:67: error: cannot infer contextual base in reference to member 'OBJC_ASSOCIATION_RETAIN_NONATOMIC'
119 |
120 | private func setRequest<Request: APIKit.Request>(_ request: Request, forTask task: SessionTask) {
121 | objc_setAssociatedObject(task, &taskRequestKey, request, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
| `- error: cannot infer contextual base in reference to member 'OBJC_ASSOCIATION_RETAIN_NONATOMIC'
122 | }
123 |
/host/spi-builder-workspace/Sources/APIKit/Session.swift:125:16: error: cannot find 'objc_getAssociatedObject' in scope
123 |
124 | private func requestForTask<Request: APIKit.Request>(_ task: SessionTask) -> Request? {
125 | return objc_getAssociatedObject(task, &taskRequestKey) as? Request
| `- error: cannot find 'objc_getAssociatedObject' in scope
126 | }
127 | }
[14/27] Compiling APIKit URLEncodedSerialization.swift
/host/spi-builder-workspace/Sources/APIKit/Request.swift:48:54: error: cannot find type 'URLRequest' in scope
46 | /// thrown in this method, the result of `Session.send()` turns `.failure(.requestError(error))`.
47 | /// - Throws: `Error`
48 | func intercept(urlRequest: URLRequest) throws -> URLRequest
| `- error: cannot find type 'URLRequest' in scope
49 |
50 | /// Intercepts response `Any` and `HTTPURLResponse`. If an error is thrown in this method,
/host/spi-builder-workspace/Sources/APIKit/Request.swift:48:32: error: cannot find type 'URLRequest' in scope
46 | /// thrown in this method, the result of `Session.send()` turns `.failure(.requestError(error))`.
47 | /// - Throws: `Error`
48 | func intercept(urlRequest: URLRequest) throws -> URLRequest
| `- error: cannot find type 'URLRequest' in scope
49 |
50 | /// Intercepts response `Any` and `HTTPURLResponse`. If an error is thrown in this method,
/host/spi-builder-workspace/Sources/APIKit/Request.swift:55:46: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
53 | /// if the HTTP status code is not in `200..<300`.
54 | /// - Throws: `Error`
55 | func intercept(object: Any, urlResponse: HTTPURLResponse) throws -> Any
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
56 |
57 | /// Build `Response` instance from raw response object. This method is called after
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/Request.swift:60:50: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
58 | /// `intercept(object:urlResponse:)` if it does not throw any error.
59 | /// - Throws: `Error`
60 | func response(from object: Any, urlResponse: HTTPURLResponse) throws -> Response
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
61 | }
62 |
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/Request.swift:92:54: error: cannot find type 'URLRequest' in scope
90 | }
91 |
92 | func intercept(urlRequest: URLRequest) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
93 | return urlRequest
94 | }
/host/spi-builder-workspace/Sources/APIKit/Request.swift:92:32: error: cannot find type 'URLRequest' in scope
90 | }
91 |
92 | func intercept(urlRequest: URLRequest) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
93 | return urlRequest
94 | }
/host/spi-builder-workspace/Sources/APIKit/Request.swift:96:46: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
94 | }
95 |
96 | func intercept(object: Any, urlResponse: HTTPURLResponse) throws -> Any {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
97 | guard 200..<300 ~= urlResponse.statusCode else {
98 | throw ResponseError.unacceptableStatusCode(urlResponse.statusCode)
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/Request.swift:105:38: error: cannot find type 'URLRequest' in scope
103 | /// Builds `URLRequest` from properties of `self`.
104 | /// - Throws: `RequestError`, `Error`
105 | func buildURLRequest() throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
106 | let url = path.isEmpty ? baseURL : baseURL.appendingPathComponent(path)
107 | guard var components = URLComponents(url: url, resolvingAgainstBaseURL: true) else {
/host/spi-builder-workspace/Sources/APIKit/Request.swift:142:41: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
140 | /// Builds `Response` from response `Data`.
141 | /// - Throws: `ResponseError`, `Error`
142 | func parse(data: Data, urlResponse: HTTPURLResponse) throws -> Response {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
143 | let parsedObject = try dataParser.parse(data: data)
144 | let passedObject = try intercept(object: parsedObject, urlResponse: urlResponse)
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/Request.swift:150:50: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
148 |
149 | public extension Request where Response == Void {
150 | func response(from object: Any, urlResponse: HTTPURLResponse) throws {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
151 | return
152 | }
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/Request.swift:97:40: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
95 |
96 | func intercept(object: Any, urlResponse: HTTPURLResponse) throws -> Any {
97 | guard 200..<300 ~= urlResponse.statusCode else {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
98 | throw ResponseError.unacceptableStatusCode(urlResponse.statusCode)
99 | }
/host/spi-builder-workspace/Sources/APIKit/Request.swift:98:68: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
96 | func intercept(object: Any, urlResponse: HTTPURLResponse) throws -> Any {
97 | guard 200..<300 ~= urlResponse.statusCode else {
98 | throw ResponseError.unacceptableStatusCode(urlResponse.statusCode)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
99 | }
100 | return object
/host/spi-builder-workspace/Sources/APIKit/Request.swift:111:26: error: cannot find 'URLRequest' in scope
109 | }
110 |
111 | var urlRequest = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
112 |
113 | if let queryParameters = queryParameters, !queryParameters.isEmpty {
/host/spi-builder-workspace/Sources/APIKit/Serializations/URLEncodedSerialization.swift:50:14: warning: associated value 'cannotCastObjectToDictionary' of 'Sendable'-conforming enum 'Error' has non-sendable type 'Any'; this is an error in the Swift 6 language mode
48 | case cannotGetStringFromData(Data, String.Encoding)
49 | case cannotGetDataFromString(String, String.Encoding)
50 | case cannotCastObjectToDictionary(Any)
| `- warning: associated value 'cannotCastObjectToDictionary' of 'Sendable'-conforming enum 'Error' has non-sendable type 'Any'; this is an error in the Swift 6 language mode
51 | case invalidFormatString(String)
52 | }
/host/spi-builder-workspace/Sources/APIKit/Serializations/URLEncodedSerialization.swift:41:12: error: cannot find 'CFURLCreateStringByReplacingPercentEscapes' in scope
39 |
40 | private func unescape(_ string: String) -> String {
41 | return CFURLCreateStringByReplacingPercentEscapes(nil, string as CFString, nil) as String
| `- error: cannot find 'CFURLCreateStringByReplacingPercentEscapes' in scope
42 | }
43 |
/host/spi-builder-workspace/Sources/APIKit/Serializations/URLEncodedSerialization.swift:41:70: error: cannot find type 'CFString' in scope
39 |
40 | private func unescape(_ string: String) -> String {
41 | return CFURLCreateStringByReplacingPercentEscapes(nil, string as CFString, nil) as String
| `- error: cannot find type 'CFString' in scope
42 | }
43 |
/host/spi-builder-workspace/Sources/APIKit/Serializations/URLEncodedSerialization.swift:41:55: error: 'nil' requires a contextual type
39 |
40 | private func unescape(_ string: String) -> String {
41 | return CFURLCreateStringByReplacingPercentEscapes(nil, string as CFString, nil) as String
| `- error: 'nil' requires a contextual type
42 | }
43 |
/host/spi-builder-workspace/Sources/APIKit/Serializations/URLEncodedSerialization.swift:41:80: error: 'nil' requires a contextual type
39 |
40 | private func unescape(_ string: String) -> String {
41 | return CFURLCreateStringByReplacingPercentEscapes(nil, string as CFString, nil) as String
| `- error: 'nil' requires a contextual type
42 | }
43 |
/host/spi-builder-workspace/Sources/APIKit/Session.swift:3:13: warning: var 'taskRequestKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
1 | import Foundation
2 |
3 | private var taskRequestKey = 0
| |- warning: var 'taskRequestKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'taskRequestKey' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: annotate 'taskRequestKey' 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
4 |
5 | /// `Session` manages tasks for HTTP/HTTPS requests.
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/SessionAdapter.swift:14:38: error: cannot find type 'URLRequest' in scope
12 | public protocol SessionAdapter {
13 | /// Returns instance that conforms to `SessionTask`. `handler` must be called after success or failure.
14 | func createTask(with URLRequest: URLRequest, handler: @escaping (Data?, URLResponse?, Error?) -> Void) -> SessionTask
| `- error: cannot find type 'URLRequest' in scope
15 |
16 | /// Collects tasks from backend networking stack. `handler` must be called after collecting.
/host/spi-builder-workspace/Sources/APIKit/Session.swift:22:24: warning: static property 'privateShared' is not concurrency-safe because non-'Sendable' type 'Session' may have shared mutable state; this is an error in the Swift 6 language mode
4 |
5 | /// `Session` manages tasks for HTTP/HTTPS requests.
6 | open class Session {
| `- note: class 'Session' does not conform to the 'Sendable' protocol
7 | /// The adapter that connects `Session` instance and lower level backend.
8 | public let adapter: SessionAdapter
:
20 |
21 | // Shared session for class methods
22 | private static let privateShared: Session = {
| |- warning: static property 'privateShared' is not concurrency-safe because non-'Sendable' type 'Session' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'privateShared' 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
23 | let configuration = URLSessionConfiguration.default
24 | let adapter = URLSessionAdapter(configuration: configuration)
/host/spi-builder-workspace/Sources/APIKit/Session.swift:23:53: error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
21 | // Shared session for class methods
22 | private static let privateShared: Session = {
23 | let configuration = URLSessionConfiguration.default
| `- error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
24 | let adapter = URLSessionAdapter(configuration: configuration)
25 | return Session(adapter: adapter)
/host/spi-builder-workspace/Sources/APIKit/Session.swift:82:25: error: cannot find type 'URLRequest' in scope
80 | internal func createSessionTask<Request: APIKit.Request>(_ request: Request, callbackQueue: CallbackQueue?, handler: @escaping (Result<Request.Response, SessionTaskError>) -> Void) -> SessionTask? {
81 | let callbackQueue = callbackQueue ?? self.callbackQueue
82 | let urlRequest: URLRequest
| `- error: cannot find type 'URLRequest' in scope
83 | do {
84 | urlRequest = try request.buildURLRequest()
/host/spi-builder-workspace/Sources/APIKit/Session.swift:121:9: error: cannot find 'objc_setAssociatedObject' in scope
119 |
120 | private func setRequest<Request: APIKit.Request>(_ request: Request, forTask task: SessionTask) {
121 | objc_setAssociatedObject(task, &taskRequestKey, request, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
| `- error: cannot find 'objc_setAssociatedObject' in scope
122 | }
123 |
/host/spi-builder-workspace/Sources/APIKit/Session.swift:121:67: error: cannot infer contextual base in reference to member 'OBJC_ASSOCIATION_RETAIN_NONATOMIC'
119 |
120 | private func setRequest<Request: APIKit.Request>(_ request: Request, forTask task: SessionTask) {
121 | objc_setAssociatedObject(task, &taskRequestKey, request, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
| `- error: cannot infer contextual base in reference to member 'OBJC_ASSOCIATION_RETAIN_NONATOMIC'
122 | }
123 |
/host/spi-builder-workspace/Sources/APIKit/Session.swift:125:16: error: cannot find 'objc_getAssociatedObject' in scope
123 |
124 | private func requestForTask<Request: APIKit.Request>(_ task: SessionTask) -> Request? {
125 | return objc_getAssociatedObject(task, &taskRequestKey) as? Request
| `- error: cannot find 'objc_getAssociatedObject' in scope
126 | }
127 | }
[15/27] Compiling APIKit Session.swift
/host/spi-builder-workspace/Sources/APIKit/Request.swift:48:54: error: cannot find type 'URLRequest' in scope
46 | /// thrown in this method, the result of `Session.send()` turns `.failure(.requestError(error))`.
47 | /// - Throws: `Error`
48 | func intercept(urlRequest: URLRequest) throws -> URLRequest
| `- error: cannot find type 'URLRequest' in scope
49 |
50 | /// Intercepts response `Any` and `HTTPURLResponse`. If an error is thrown in this method,
/host/spi-builder-workspace/Sources/APIKit/Request.swift:48:32: error: cannot find type 'URLRequest' in scope
46 | /// thrown in this method, the result of `Session.send()` turns `.failure(.requestError(error))`.
47 | /// - Throws: `Error`
48 | func intercept(urlRequest: URLRequest) throws -> URLRequest
| `- error: cannot find type 'URLRequest' in scope
49 |
50 | /// Intercepts response `Any` and `HTTPURLResponse`. If an error is thrown in this method,
/host/spi-builder-workspace/Sources/APIKit/Request.swift:55:46: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
53 | /// if the HTTP status code is not in `200..<300`.
54 | /// - Throws: `Error`
55 | func intercept(object: Any, urlResponse: HTTPURLResponse) throws -> Any
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
56 |
57 | /// Build `Response` instance from raw response object. This method is called after
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/Request.swift:60:50: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
58 | /// `intercept(object:urlResponse:)` if it does not throw any error.
59 | /// - Throws: `Error`
60 | func response(from object: Any, urlResponse: HTTPURLResponse) throws -> Response
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
61 | }
62 |
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/Request.swift:92:54: error: cannot find type 'URLRequest' in scope
90 | }
91 |
92 | func intercept(urlRequest: URLRequest) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
93 | return urlRequest
94 | }
/host/spi-builder-workspace/Sources/APIKit/Request.swift:92:32: error: cannot find type 'URLRequest' in scope
90 | }
91 |
92 | func intercept(urlRequest: URLRequest) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
93 | return urlRequest
94 | }
/host/spi-builder-workspace/Sources/APIKit/Request.swift:96:46: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
94 | }
95 |
96 | func intercept(object: Any, urlResponse: HTTPURLResponse) throws -> Any {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
97 | guard 200..<300 ~= urlResponse.statusCode else {
98 | throw ResponseError.unacceptableStatusCode(urlResponse.statusCode)
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/Request.swift:105:38: error: cannot find type 'URLRequest' in scope
103 | /// Builds `URLRequest` from properties of `self`.
104 | /// - Throws: `RequestError`, `Error`
105 | func buildURLRequest() throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
106 | let url = path.isEmpty ? baseURL : baseURL.appendingPathComponent(path)
107 | guard var components = URLComponents(url: url, resolvingAgainstBaseURL: true) else {
/host/spi-builder-workspace/Sources/APIKit/Request.swift:142:41: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
140 | /// Builds `Response` from response `Data`.
141 | /// - Throws: `ResponseError`, `Error`
142 | func parse(data: Data, urlResponse: HTTPURLResponse) throws -> Response {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
143 | let parsedObject = try dataParser.parse(data: data)
144 | let passedObject = try intercept(object: parsedObject, urlResponse: urlResponse)
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/Request.swift:150:50: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
148 |
149 | public extension Request where Response == Void {
150 | func response(from object: Any, urlResponse: HTTPURLResponse) throws {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
151 | return
152 | }
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/Request.swift:97:40: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
95 |
96 | func intercept(object: Any, urlResponse: HTTPURLResponse) throws -> Any {
97 | guard 200..<300 ~= urlResponse.statusCode else {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
98 | throw ResponseError.unacceptableStatusCode(urlResponse.statusCode)
99 | }
/host/spi-builder-workspace/Sources/APIKit/Request.swift:98:68: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
96 | func intercept(object: Any, urlResponse: HTTPURLResponse) throws -> Any {
97 | guard 200..<300 ~= urlResponse.statusCode else {
98 | throw ResponseError.unacceptableStatusCode(urlResponse.statusCode)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
99 | }
100 | return object
/host/spi-builder-workspace/Sources/APIKit/Request.swift:111:26: error: cannot find 'URLRequest' in scope
109 | }
110 |
111 | var urlRequest = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
112 |
113 | if let queryParameters = queryParameters, !queryParameters.isEmpty {
/host/spi-builder-workspace/Sources/APIKit/Serializations/URLEncodedSerialization.swift:50:14: warning: associated value 'cannotCastObjectToDictionary' of 'Sendable'-conforming enum 'Error' has non-sendable type 'Any'; this is an error in the Swift 6 language mode
48 | case cannotGetStringFromData(Data, String.Encoding)
49 | case cannotGetDataFromString(String, String.Encoding)
50 | case cannotCastObjectToDictionary(Any)
| `- warning: associated value 'cannotCastObjectToDictionary' of 'Sendable'-conforming enum 'Error' has non-sendable type 'Any'; this is an error in the Swift 6 language mode
51 | case invalidFormatString(String)
52 | }
/host/spi-builder-workspace/Sources/APIKit/Serializations/URLEncodedSerialization.swift:41:12: error: cannot find 'CFURLCreateStringByReplacingPercentEscapes' in scope
39 |
40 | private func unescape(_ string: String) -> String {
41 | return CFURLCreateStringByReplacingPercentEscapes(nil, string as CFString, nil) as String
| `- error: cannot find 'CFURLCreateStringByReplacingPercentEscapes' in scope
42 | }
43 |
/host/spi-builder-workspace/Sources/APIKit/Serializations/URLEncodedSerialization.swift:41:70: error: cannot find type 'CFString' in scope
39 |
40 | private func unescape(_ string: String) -> String {
41 | return CFURLCreateStringByReplacingPercentEscapes(nil, string as CFString, nil) as String
| `- error: cannot find type 'CFString' in scope
42 | }
43 |
/host/spi-builder-workspace/Sources/APIKit/Serializations/URLEncodedSerialization.swift:41:55: error: 'nil' requires a contextual type
39 |
40 | private func unescape(_ string: String) -> String {
41 | return CFURLCreateStringByReplacingPercentEscapes(nil, string as CFString, nil) as String
| `- error: 'nil' requires a contextual type
42 | }
43 |
/host/spi-builder-workspace/Sources/APIKit/Serializations/URLEncodedSerialization.swift:41:80: error: 'nil' requires a contextual type
39 |
40 | private func unescape(_ string: String) -> String {
41 | return CFURLCreateStringByReplacingPercentEscapes(nil, string as CFString, nil) as String
| `- error: 'nil' requires a contextual type
42 | }
43 |
/host/spi-builder-workspace/Sources/APIKit/Session.swift:3:13: warning: var 'taskRequestKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
1 | import Foundation
2 |
3 | private var taskRequestKey = 0
| |- warning: var 'taskRequestKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'taskRequestKey' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: annotate 'taskRequestKey' 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
4 |
5 | /// `Session` manages tasks for HTTP/HTTPS requests.
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/SessionAdapter.swift:14:38: error: cannot find type 'URLRequest' in scope
12 | public protocol SessionAdapter {
13 | /// Returns instance that conforms to `SessionTask`. `handler` must be called after success or failure.
14 | func createTask(with URLRequest: URLRequest, handler: @escaping (Data?, URLResponse?, Error?) -> Void) -> SessionTask
| `- error: cannot find type 'URLRequest' in scope
15 |
16 | /// Collects tasks from backend networking stack. `handler` must be called after collecting.
/host/spi-builder-workspace/Sources/APIKit/Session.swift:22:24: warning: static property 'privateShared' is not concurrency-safe because non-'Sendable' type 'Session' may have shared mutable state; this is an error in the Swift 6 language mode
4 |
5 | /// `Session` manages tasks for HTTP/HTTPS requests.
6 | open class Session {
| `- note: class 'Session' does not conform to the 'Sendable' protocol
7 | /// The adapter that connects `Session` instance and lower level backend.
8 | public let adapter: SessionAdapter
:
20 |
21 | // Shared session for class methods
22 | private static let privateShared: Session = {
| |- warning: static property 'privateShared' is not concurrency-safe because non-'Sendable' type 'Session' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'privateShared' 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
23 | let configuration = URLSessionConfiguration.default
24 | let adapter = URLSessionAdapter(configuration: configuration)
/host/spi-builder-workspace/Sources/APIKit/Session.swift:23:53: error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
21 | // Shared session for class methods
22 | private static let privateShared: Session = {
23 | let configuration = URLSessionConfiguration.default
| `- error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
24 | let adapter = URLSessionAdapter(configuration: configuration)
25 | return Session(adapter: adapter)
/host/spi-builder-workspace/Sources/APIKit/Session.swift:82:25: error: cannot find type 'URLRequest' in scope
80 | internal func createSessionTask<Request: APIKit.Request>(_ request: Request, callbackQueue: CallbackQueue?, handler: @escaping (Result<Request.Response, SessionTaskError>) -> Void) -> SessionTask? {
81 | let callbackQueue = callbackQueue ?? self.callbackQueue
82 | let urlRequest: URLRequest
| `- error: cannot find type 'URLRequest' in scope
83 | do {
84 | urlRequest = try request.buildURLRequest()
/host/spi-builder-workspace/Sources/APIKit/Session.swift:121:9: error: cannot find 'objc_setAssociatedObject' in scope
119 |
120 | private func setRequest<Request: APIKit.Request>(_ request: Request, forTask task: SessionTask) {
121 | objc_setAssociatedObject(task, &taskRequestKey, request, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
| `- error: cannot find 'objc_setAssociatedObject' in scope
122 | }
123 |
/host/spi-builder-workspace/Sources/APIKit/Session.swift:121:67: error: cannot infer contextual base in reference to member 'OBJC_ASSOCIATION_RETAIN_NONATOMIC'
119 |
120 | private func setRequest<Request: APIKit.Request>(_ request: Request, forTask task: SessionTask) {
121 | objc_setAssociatedObject(task, &taskRequestKey, request, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
| `- error: cannot infer contextual base in reference to member 'OBJC_ASSOCIATION_RETAIN_NONATOMIC'
122 | }
123 |
/host/spi-builder-workspace/Sources/APIKit/Session.swift:125:16: error: cannot find 'objc_getAssociatedObject' in scope
123 |
124 | private func requestForTask<Request: APIKit.Request>(_ task: SessionTask) -> Request? {
125 | return objc_getAssociatedObject(task, &taskRequestKey) as? Request
| `- error: cannot find 'objc_getAssociatedObject' in scope
126 | }
127 | }
[16/27] Compiling APIKit ResponseError.swift
/host/spi-builder-workspace/Sources/APIKit/Error/ResponseError.swift:7:29: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
5 | public enum ResponseError: Error {
6 | /// Indicates the session adapter returned `URLResponse` that fails to down-cast to `HTTPURLResponse`.
7 | case nonHTTPURLResponse(URLResponse?)
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
8 |
9 | /// Indicates `HTTPURLResponse.statusCode` is not acceptable.
Foundation.URLResponse:2:18: note: 'URLResponse' 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 URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/Error/ResponseError.swift:7:10: warning: associated value 'nonHTTPURLResponse' of 'Sendable'-conforming enum 'ResponseError' has non-sendable type 'URLResponse' (aka 'AnyObject'); this is an error in the Swift 6 language mode
5 | public enum ResponseError: Error {
6 | /// Indicates the session adapter returned `URLResponse` that fails to down-cast to `HTTPURLResponse`.
7 | case nonHTTPURLResponse(URLResponse?)
| `- warning: associated value 'nonHTTPURLResponse' of 'Sendable'-conforming enum 'ResponseError' has non-sendable type 'URLResponse' (aka 'AnyObject'); this is an error in the Swift 6 language mode
8 |
9 | /// Indicates `HTTPURLResponse.statusCode` is not acceptable.
/host/spi-builder-workspace/Sources/APIKit/Error/ResponseError.swift:14:10: warning: associated value 'unexpectedObject' of 'Sendable'-conforming enum 'ResponseError' has non-sendable type 'Any'; this is an error in the Swift 6 language mode
12 |
13 | /// Indicates `Any` that represents the response is unexpected.
14 | case unexpectedObject(Any)
| `- warning: associated value 'unexpectedObject' of 'Sendable'-conforming enum 'ResponseError' has non-sendable type 'Any'; this is an error in the Swift 6 language mode
15 | }
16 |
[17/27] Compiling APIKit SessionTaskError.swift
/host/spi-builder-workspace/Sources/APIKit/Error/ResponseError.swift:7:29: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
5 | public enum ResponseError: Error {
6 | /// Indicates the session adapter returned `URLResponse` that fails to down-cast to `HTTPURLResponse`.
7 | case nonHTTPURLResponse(URLResponse?)
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
8 |
9 | /// Indicates `HTTPURLResponse.statusCode` is not acceptable.
Foundation.URLResponse:2:18: note: 'URLResponse' 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 URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/Error/ResponseError.swift:7:10: warning: associated value 'nonHTTPURLResponse' of 'Sendable'-conforming enum 'ResponseError' has non-sendable type 'URLResponse' (aka 'AnyObject'); this is an error in the Swift 6 language mode
5 | public enum ResponseError: Error {
6 | /// Indicates the session adapter returned `URLResponse` that fails to down-cast to `HTTPURLResponse`.
7 | case nonHTTPURLResponse(URLResponse?)
| `- warning: associated value 'nonHTTPURLResponse' of 'Sendable'-conforming enum 'ResponseError' has non-sendable type 'URLResponse' (aka 'AnyObject'); this is an error in the Swift 6 language mode
8 |
9 | /// Indicates `HTTPURLResponse.statusCode` is not acceptable.
/host/spi-builder-workspace/Sources/APIKit/Error/ResponseError.swift:14:10: warning: associated value 'unexpectedObject' of 'Sendable'-conforming enum 'ResponseError' has non-sendable type 'Any'; this is an error in the Swift 6 language mode
12 |
13 | /// Indicates `Any` that represents the response is unexpected.
14 | case unexpectedObject(Any)
| `- warning: associated value 'unexpectedObject' of 'Sendable'-conforming enum 'ResponseError' has non-sendable type 'Any'; this is an error in the Swift 6 language mode
15 | }
16 |
[18/27] Compiling APIKit HTTPMethod.swift
/host/spi-builder-workspace/Sources/APIKit/Error/ResponseError.swift:7:29: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
5 | public enum ResponseError: Error {
6 | /// Indicates the session adapter returned `URLResponse` that fails to down-cast to `HTTPURLResponse`.
7 | case nonHTTPURLResponse(URLResponse?)
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
8 |
9 | /// Indicates `HTTPURLResponse.statusCode` is not acceptable.
Foundation.URLResponse:2:18: note: 'URLResponse' 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 URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/Error/ResponseError.swift:7:10: warning: associated value 'nonHTTPURLResponse' of 'Sendable'-conforming enum 'ResponseError' has non-sendable type 'URLResponse' (aka 'AnyObject'); this is an error in the Swift 6 language mode
5 | public enum ResponseError: Error {
6 | /// Indicates the session adapter returned `URLResponse` that fails to down-cast to `HTTPURLResponse`.
7 | case nonHTTPURLResponse(URLResponse?)
| `- warning: associated value 'nonHTTPURLResponse' of 'Sendable'-conforming enum 'ResponseError' has non-sendable type 'URLResponse' (aka 'AnyObject'); this is an error in the Swift 6 language mode
8 |
9 | /// Indicates `HTTPURLResponse.statusCode` is not acceptable.
/host/spi-builder-workspace/Sources/APIKit/Error/ResponseError.swift:14:10: warning: associated value 'unexpectedObject' of 'Sendable'-conforming enum 'ResponseError' has non-sendable type 'Any'; this is an error in the Swift 6 language mode
12 |
13 | /// Indicates `Any` that represents the response is unexpected.
14 | case unexpectedObject(Any)
| `- warning: associated value 'unexpectedObject' of 'Sendable'-conforming enum 'ResponseError' has non-sendable type 'Any'; this is an error in the Swift 6 language mode
15 | }
16 |
[19/27] Compiling APIKit CallbackQueue.swift
/host/spi-builder-workspace/Sources/APIKit/CallbackQueue.swift:21:17: warning: capture of 'closure' with non-sendable type '() -> Void' in a `@Sendable` closure; this is an error in the Swift 6 language mode
19 | case .main:
20 | DispatchQueue.main.async {
21 | closure()
| |- warning: capture of 'closure' with non-sendable type '() -> 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'
22 | }
23 |
/host/spi-builder-workspace/Sources/APIKit/CallbackQueue.swift:29:17: warning: capture of 'closure' with non-sendable type '() -> Void' in a `@Sendable` closure; this is an error in the Swift 6 language mode
27 | case .operationQueue(let operationQueue):
28 | operationQueue.addOperation {
29 | closure()
| |- warning: capture of 'closure' with non-sendable type '() -> 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'
30 | }
31 |
/host/spi-builder-workspace/Sources/APIKit/CallbackQueue.swift:34:17: warning: capture of 'closure' with non-sendable type '() -> Void' in a `@Sendable` closure; this is an error in the Swift 6 language mode
32 | case .dispatchQueue(let dispatchQueue):
33 | dispatchQueue.async {
34 | closure()
| |- warning: capture of 'closure' with non-sendable type '() -> 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'
35 | }
36 | }
/host/spi-builder-workspace/Sources/APIKit/CallbackQueue.swift:21:17: warning: sending 'closure' risks causing data races; this is an error in the Swift 6 language mode
19 | case .main:
20 | DispatchQueue.main.async {
21 | closure()
| |- warning: sending 'closure' risks causing data races; this is an error in the Swift 6 language mode
| `- note: task-isolated 'closure' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
22 | }
23 |
/host/spi-builder-workspace/Sources/APIKit/Concurrency/Concurrency.swift:25:22: 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
23 | return try await withTaskCancellationHandler(operation: {
24 | return try await withCheckedThrowingContinuation { continuation in
25 | Task {
| `- 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
26 | let sessionTask = createSessionTask(request, callbackQueue: callbackQueue) { result in
| `- note: closure captures 'callbackQueue' which is accessible to code in the current task
27 | continuation.resume(with: result)
28 | }
/host/spi-builder-workspace/Sources/APIKit/Concurrency/Concurrency.swift:29:47: warning: sending 'sessionTask' risks causing data races; this is an error in the Swift 6 language mode
27 | continuation.resume(with: result)
28 | }
29 | await cancellationHandler.register(with: sessionTask)
| |- warning: sending 'sessionTask' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated 'sessionTask' to actor-isolated instance method 'register(with:)' risks causing data races between actor-isolated and task-isolated uses
30 | if await cancellationHandler.isTaskCancelled {
31 | sessionTask?.cancel()
/host/spi-builder-workspace/Sources/APIKit/Concurrency/Concurrency.swift:27:38: warning: sending 'result' risks causing data races; this is an error in the Swift 6 language mode
25 | Task {
26 | let sessionTask = createSessionTask(request, callbackQueue: callbackQueue) { result in
27 | 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
28 | }
29 | await cancellationHandler.register(with: sessionTask)
[20/27] Compiling APIKit Combine.swift
/host/spi-builder-workspace/Sources/APIKit/CallbackQueue.swift:21:17: warning: capture of 'closure' with non-sendable type '() -> Void' in a `@Sendable` closure; this is an error in the Swift 6 language mode
19 | case .main:
20 | DispatchQueue.main.async {
21 | closure()
| |- warning: capture of 'closure' with non-sendable type '() -> 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'
22 | }
23 |
/host/spi-builder-workspace/Sources/APIKit/CallbackQueue.swift:29:17: warning: capture of 'closure' with non-sendable type '() -> Void' in a `@Sendable` closure; this is an error in the Swift 6 language mode
27 | case .operationQueue(let operationQueue):
28 | operationQueue.addOperation {
29 | closure()
| |- warning: capture of 'closure' with non-sendable type '() -> 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'
30 | }
31 |
/host/spi-builder-workspace/Sources/APIKit/CallbackQueue.swift:34:17: warning: capture of 'closure' with non-sendable type '() -> Void' in a `@Sendable` closure; this is an error in the Swift 6 language mode
32 | case .dispatchQueue(let dispatchQueue):
33 | dispatchQueue.async {
34 | closure()
| |- warning: capture of 'closure' with non-sendable type '() -> 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'
35 | }
36 | }
/host/spi-builder-workspace/Sources/APIKit/CallbackQueue.swift:21:17: warning: sending 'closure' risks causing data races; this is an error in the Swift 6 language mode
19 | case .main:
20 | DispatchQueue.main.async {
21 | closure()
| |- warning: sending 'closure' risks causing data races; this is an error in the Swift 6 language mode
| `- note: task-isolated 'closure' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
22 | }
23 |
/host/spi-builder-workspace/Sources/APIKit/Concurrency/Concurrency.swift:25:22: 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
23 | return try await withTaskCancellationHandler(operation: {
24 | return try await withCheckedThrowingContinuation { continuation in
25 | Task {
| `- 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
26 | let sessionTask = createSessionTask(request, callbackQueue: callbackQueue) { result in
| `- note: closure captures 'callbackQueue' which is accessible to code in the current task
27 | continuation.resume(with: result)
28 | }
/host/spi-builder-workspace/Sources/APIKit/Concurrency/Concurrency.swift:29:47: warning: sending 'sessionTask' risks causing data races; this is an error in the Swift 6 language mode
27 | continuation.resume(with: result)
28 | }
29 | await cancellationHandler.register(with: sessionTask)
| |- warning: sending 'sessionTask' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated 'sessionTask' to actor-isolated instance method 'register(with:)' risks causing data races between actor-isolated and task-isolated uses
30 | if await cancellationHandler.isTaskCancelled {
31 | sessionTask?.cancel()
/host/spi-builder-workspace/Sources/APIKit/Concurrency/Concurrency.swift:27:38: warning: sending 'result' risks causing data races; this is an error in the Swift 6 language mode
25 | Task {
26 | let sessionTask = createSessionTask(request, callbackQueue: callbackQueue) { result in
27 | 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
28 | }
29 | await cancellationHandler.register(with: sessionTask)
[21/27] Compiling APIKit Concurrency.swift
/host/spi-builder-workspace/Sources/APIKit/CallbackQueue.swift:21:17: warning: capture of 'closure' with non-sendable type '() -> Void' in a `@Sendable` closure; this is an error in the Swift 6 language mode
19 | case .main:
20 | DispatchQueue.main.async {
21 | closure()
| |- warning: capture of 'closure' with non-sendable type '() -> 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'
22 | }
23 |
/host/spi-builder-workspace/Sources/APIKit/CallbackQueue.swift:29:17: warning: capture of 'closure' with non-sendable type '() -> Void' in a `@Sendable` closure; this is an error in the Swift 6 language mode
27 | case .operationQueue(let operationQueue):
28 | operationQueue.addOperation {
29 | closure()
| |- warning: capture of 'closure' with non-sendable type '() -> 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'
30 | }
31 |
/host/spi-builder-workspace/Sources/APIKit/CallbackQueue.swift:34:17: warning: capture of 'closure' with non-sendable type '() -> Void' in a `@Sendable` closure; this is an error in the Swift 6 language mode
32 | case .dispatchQueue(let dispatchQueue):
33 | dispatchQueue.async {
34 | closure()
| |- warning: capture of 'closure' with non-sendable type '() -> 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'
35 | }
36 | }
/host/spi-builder-workspace/Sources/APIKit/CallbackQueue.swift:21:17: warning: sending 'closure' risks causing data races; this is an error in the Swift 6 language mode
19 | case .main:
20 | DispatchQueue.main.async {
21 | closure()
| |- warning: sending 'closure' risks causing data races; this is an error in the Swift 6 language mode
| `- note: task-isolated 'closure' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
22 | }
23 |
/host/spi-builder-workspace/Sources/APIKit/Concurrency/Concurrency.swift:25:22: 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
23 | return try await withTaskCancellationHandler(operation: {
24 | return try await withCheckedThrowingContinuation { continuation in
25 | Task {
| `- 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
26 | let sessionTask = createSessionTask(request, callbackQueue: callbackQueue) { result in
| `- note: closure captures 'callbackQueue' which is accessible to code in the current task
27 | continuation.resume(with: result)
28 | }
/host/spi-builder-workspace/Sources/APIKit/Concurrency/Concurrency.swift:29:47: warning: sending 'sessionTask' risks causing data races; this is an error in the Swift 6 language mode
27 | continuation.resume(with: result)
28 | }
29 | await cancellationHandler.register(with: sessionTask)
| |- warning: sending 'sessionTask' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated 'sessionTask' to actor-isolated instance method 'register(with:)' risks causing data races between actor-isolated and task-isolated uses
30 | if await cancellationHandler.isTaskCancelled {
31 | sessionTask?.cancel()
/host/spi-builder-workspace/Sources/APIKit/Concurrency/Concurrency.swift:27:38: warning: sending 'result' risks causing data races; this is an error in the Swift 6 language mode
25 | Task {
26 | let sessionTask = createSessionTask(request, callbackQueue: callbackQueue) { result in
27 | 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
28 | }
29 | await cancellationHandler.register(with: sessionTask)
[22/27] Compiling APIKit DataParser.swift
[23/27] Compiling APIKit FormURLEncodedDataParser.swift
[24/27] Compiling APIKit JSONDataParser.swift
[25/27] Compiling APIKit SessionAdapter.swift
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/SessionAdapter.swift:14:38: error: cannot find type 'URLRequest' in scope
12 | public protocol SessionAdapter {
13 | /// Returns instance that conforms to `SessionTask`. `handler` must be called after success or failure.
14 | func createTask(with URLRequest: URLRequest, handler: @escaping (Data?, URLResponse?, Error?) -> Void) -> SessionTask
| `- error: cannot find type 'URLRequest' in scope
15 |
16 | /// Collects tasks from backend networking stack. `handler` must be called after collecting.
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/SessionAdapter.swift:14:77: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
12 | public protocol SessionAdapter {
13 | /// Returns instance that conforms to `SessionTask`. `handler` must be called after success or failure.
14 | func createTask(with URLRequest: URLRequest, handler: @escaping (Data?, URLResponse?, Error?) -> Void) -> SessionTask
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
15 |
16 | /// Collects tasks from backend networking stack. `handler` must be called after collecting.
Foundation.URLResponse:2:18: note: 'URLResponse' 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 URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:3:1: error: non-nominal type 'URLSessionTask' (aka 'AnyObject') cannot be extended
1 | import Foundation
2 |
3 | extension URLSessionTask: SessionTask {
| `- error: non-nominal type 'URLSessionTask' (aka 'AnyObject') cannot be extended
4 |
5 | }
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:7:13: warning: var 'dataTaskResponseBufferKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
5 | }
6 |
7 | private var dataTaskResponseBufferKey = 0
| |- warning: var 'dataTaskResponseBufferKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'dataTaskResponseBufferKey' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: annotate 'dataTaskResponseBufferKey' 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
8 | private var taskAssociatedObjectCompletionHandlerKey = 0
9 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:8:13: warning: var 'taskAssociatedObjectCompletionHandlerKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
6 |
7 | private var dataTaskResponseBufferKey = 0
8 | private var taskAssociatedObjectCompletionHandlerKey = 0
| |- warning: var 'taskAssociatedObjectCompletionHandlerKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'taskAssociatedObjectCompletionHandlerKey' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: annotate 'taskAssociatedObjectCompletionHandlerKey' 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
9 |
10 | /// `URLSessionAdapter` connects `URLSession` with `Session`.
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:19:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 | open class URLSessionAdapter: NSObject, SessionAdapter, URLSessionDelegate, URLSessionTaskDelegate, URLSessionDataDelegate {
18 | /// The underlying `URLSession` instance.
19 | open var urlSession: URLSession!
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |
21 | /// Returns `URLSessionAdapter` initialized with `URLSessionConfiguration`.
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/APIKit/SessionAdapter/URLSessionAdapter.swift:22:32: error: 'URLSessionConfiguration' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |
21 | /// Returns `URLSessionAdapter` initialized with `URLSessionConfiguration`.
22 | public init(configuration: URLSessionConfiguration) {
| `- error: 'URLSessionConfiguration' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
23 | super.init()
24 | self.urlSession = URLSession(configuration: configuration, delegate: self, delegateQueue: nil)
Foundation.URLSessionConfiguration:2:18: note: 'URLSessionConfiguration' 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 URLSessionConfiguration = AnyObject
| `- note: 'URLSessionConfiguration' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:28:43: error: cannot find type 'URLRequest' in scope
26 |
27 | /// Creates `URLSessionDataTask` instance using `dataTaskWithRequest(_:completionHandler:)`.
28 | open func createTask(with URLRequest: URLRequest, handler: @escaping (Data?, URLResponse?, Error?) -> Void) -> SessionTask {
| `- error: cannot find type 'URLRequest' in scope
29 | let task = urlSession.dataTask(with: URLRequest)
30 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:28:82: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
26 |
27 | /// Creates `URLSessionDataTask` instance using `dataTaskWithRequest(_:completionHandler:)`.
28 | open func createTask(with URLRequest: URLRequest, handler: @escaping (Data?, URLResponse?, Error?) -> Void) -> SessionTask {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
29 | let task = urlSession.dataTask(with: URLRequest)
30 |
Foundation.URLResponse:2:18: note: 'URLResponse' 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 URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:45:67: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
43 | }
44 |
45 | private func setBuffer(_ buffer: NSMutableData, forTask task: URLSessionTask) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
46 | objc_setAssociatedObject(task, &dataTaskResponseBufferKey, buffer, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
47 | }
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
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:49:35: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
47 | }
48 |
49 | private func buffer(for task: URLSessionTask) -> NSMutableData? {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
50 | return objc_getAssociatedObject(task, &dataTaskResponseBufferKey) as? NSMutableData
51 | }
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
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:53:58: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
51 | }
52 |
53 | private func setHandler(_ handler: @escaping (Data?, URLResponse?, Error?) -> Void, forTask task: URLSessionTask) {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
54 | objc_setAssociatedObject(task, &taskAssociatedObjectCompletionHandlerKey, handler as Any, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
55 | }
Foundation.URLResponse:2:18: note: 'URLResponse' 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 URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:53:103: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
51 | }
52 |
53 | private func setHandler(_ handler: @escaping (Data?, URLResponse?, Error?) -> Void, forTask task: URLSessionTask) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
54 | objc_setAssociatedObject(task, &taskAssociatedObjectCompletionHandlerKey, handler as Any, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
55 | }
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
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:57:36: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
55 | }
56 |
57 | private func handler(for task: URLSessionTask) -> ((Data?, URLResponse?, Error?) -> Void)? {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
58 | return objc_getAssociatedObject(task, &taskAssociatedObjectCompletionHandlerKey) as? (Data?, URLResponse?, Error?) -> Void
59 | }
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
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:57:64: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
55 | }
56 |
57 | private func handler(for task: URLSessionTask) -> ((Data?, URLResponse?, Error?) -> Void)? {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
58 | return objc_getAssociatedObject(task, &taskAssociatedObjectCompletionHandlerKey) as? (Data?, URLResponse?, Error?) -> Void
59 | }
Foundation.URLResponse:2:18: note: 'URLResponse' 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 URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:62:37: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
60 |
61 | // MARK: URLSessionTaskDelegate
62 | open 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.
63 | handler(for: task)?(buffer(for: task) as Data?, task.response, error)
64 | }
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/APIKit/SessionAdapter/URLSessionAdapter.swift:62:55: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
60 |
61 | // MARK: URLSessionTaskDelegate
62 | open 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.
63 | handler(for: task)?(buffer(for: task) as Data?, task.response, error)
64 | }
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
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:67:37: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
65 |
66 | // MARK: URLSessionDataDelegate
67 | open 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.
68 | buffer(for: dataTask)?.append(data)
69 | }
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/APIKit/SessionAdapter/URLSessionAdapter.swift:67:59: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
65 |
66 | // MARK: URLSessionDataDelegate
67 | open 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.
68 | buffer(for: dataTask)?.append(data)
69 | }
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/APIKit/SessionAdapter/URLSessionAdapter.swift:17:57: error: cannot find type 'URLSessionDelegate' in scope
15 | /// `URLSession(_:task: didCompleteWithError:)` and `URLSession(_:dataTask:didReceiveData:)`, you have to call
16 | /// `super` in these methods if you implement them.
17 | open class URLSessionAdapter: NSObject, SessionAdapter, URLSessionDelegate, URLSessionTaskDelegate, URLSessionDataDelegate {
| `- error: cannot find type 'URLSessionDelegate' in scope
18 | /// The underlying `URLSession` instance.
19 | open var urlSession: URLSession!
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:17:77: error: cannot find type 'URLSessionTaskDelegate' in scope
15 | /// `URLSession(_:task: didCompleteWithError:)` and `URLSession(_:dataTask:didReceiveData:)`, you have to call
16 | /// `super` in these methods if you implement them.
17 | open class URLSessionAdapter: NSObject, SessionAdapter, URLSessionDelegate, URLSessionTaskDelegate, URLSessionDataDelegate {
| `- error: cannot find type 'URLSessionTaskDelegate' in scope
18 | /// The underlying `URLSession` instance.
19 | open var urlSession: URLSession!
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:17:101: error: cannot find type 'URLSessionDataDelegate' in scope
15 | /// `URLSession(_:task: didCompleteWithError:)` and `URLSession(_:dataTask:didReceiveData:)`, you have to call
16 | /// `super` in these methods if you implement them.
17 | open class URLSessionAdapter: NSObject, SessionAdapter, URLSessionDelegate, URLSessionTaskDelegate, URLSessionDataDelegate {
| `- error: cannot find type 'URLSessionDataDelegate' in scope
18 | /// The underlying `URLSession` instance.
19 | open var urlSession: URLSession!
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:24:27: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
22 | public init(configuration: URLSessionConfiguration) {
23 | super.init()
24 | self.urlSession = URLSession(configuration: configuration, delegate: self, delegateQueue: nil)
| `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
25 | }
26 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:24:99: error: 'nil' requires a contextual type
22 | public init(configuration: URLSessionConfiguration) {
23 | super.init()
24 | self.urlSession = URLSession(configuration: configuration, delegate: self, delegateQueue: nil)
| `- error: 'nil' requires a contextual type
25 | }
26 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:29:31: error: value of type 'URLSession' (aka 'AnyObject') has no member 'dataTask'
27 | /// Creates `URLSessionDataTask` instance using `dataTaskWithRequest(_:completionHandler:)`.
28 | open func createTask(with URLRequest: URLRequest, handler: @escaping (Data?, URLResponse?, Error?) -> Void) -> SessionTask {
29 | let task = urlSession.dataTask(with: URLRequest)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'dataTask'
30 |
31 | setBuffer(NSMutableData(), forTask: task)
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:39:20: error: value of type 'URLSession' (aka 'AnyObject') has no member 'getTasksWithCompletionHandler'
37 | /// Aggregates `URLSessionTask` instances in `URLSession` using `getTasksWithCompletionHandler(_:)`.
38 | open func getTasks(with handler: @escaping ([SessionTask]) -> Void) {
39 | urlSession.getTasksWithCompletionHandler { dataTasks, uploadTasks, downloadTasks in
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'getTasksWithCompletionHandler'
40 | let allTasks: [URLSessionTask] = dataTasks + uploadTasks + downloadTasks
41 | handler(allTasks)
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:41:21: error: cannot convert value of type '[URLSessionTask]' (aka 'Array<AnyObject>') to expected argument type '[any SessionTask]'
39 | urlSession.getTasksWithCompletionHandler { dataTasks, uploadTasks, downloadTasks in
40 | let allTasks: [URLSessionTask] = dataTasks + uploadTasks + downloadTasks
41 | handler(allTasks)
| |- error: cannot convert value of type '[URLSessionTask]' (aka 'Array<AnyObject>') to expected argument type '[any SessionTask]'
| `- note: arguments to generic parameter 'Element' ('URLSessionTask' (aka 'AnyObject') and 'any SessionTask') are expected to be equal
42 | }
43 | }
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:46:9: error: cannot find 'objc_setAssociatedObject' in scope
44 |
45 | private func setBuffer(_ buffer: NSMutableData, forTask task: URLSessionTask) {
46 | objc_setAssociatedObject(task, &dataTaskResponseBufferKey, buffer, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
| `- error: cannot find 'objc_setAssociatedObject' in scope
47 | }
48 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:46:77: error: cannot infer contextual base in reference to member 'OBJC_ASSOCIATION_RETAIN_NONATOMIC'
44 |
45 | private func setBuffer(_ buffer: NSMutableData, forTask task: URLSessionTask) {
46 | objc_setAssociatedObject(task, &dataTaskResponseBufferKey, buffer, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
| `- error: cannot infer contextual base in reference to member 'OBJC_ASSOCIATION_RETAIN_NONATOMIC'
47 | }
48 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:50:16: error: cannot find 'objc_getAssociatedObject' in scope
48 |
49 | private func buffer(for task: URLSessionTask) -> NSMutableData? {
50 | return objc_getAssociatedObject(task, &dataTaskResponseBufferKey) as? NSMutableData
| `- error: cannot find 'objc_getAssociatedObject' in scope
51 | }
52 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:54:9: error: cannot find 'objc_setAssociatedObject' in scope
52 |
53 | private func setHandler(_ handler: @escaping (Data?, URLResponse?, Error?) -> Void, forTask task: URLSessionTask) {
54 | objc_setAssociatedObject(task, &taskAssociatedObjectCompletionHandlerKey, handler as Any, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
| `- error: cannot find 'objc_setAssociatedObject' in scope
55 | }
56 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:54:100: error: cannot infer contextual base in reference to member 'OBJC_ASSOCIATION_RETAIN_NONATOMIC'
52 |
53 | private func setHandler(_ handler: @escaping (Data?, URLResponse?, Error?) -> Void, forTask task: URLSessionTask) {
54 | objc_setAssociatedObject(task, &taskAssociatedObjectCompletionHandlerKey, handler as Any, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
| `- error: cannot infer contextual base in reference to member 'OBJC_ASSOCIATION_RETAIN_NONATOMIC'
55 | }
56 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:58:16: error: cannot find 'objc_getAssociatedObject' in scope
56 |
57 | private func handler(for task: URLSessionTask) -> ((Data?, URLResponse?, Error?) -> Void)? {
58 | return objc_getAssociatedObject(task, &taskAssociatedObjectCompletionHandlerKey) as? (Data?, URLResponse?, Error?) -> Void
| `- error: cannot find 'objc_getAssociatedObject' in scope
59 | }
60 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:63:62: error: value of type 'URLSessionTask' (aka 'AnyObject') has no member 'response'
61 | // MARK: URLSessionTaskDelegate
62 | open func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) {
63 | handler(for: task)?(buffer(for: task) as Data?, task.response, error)
| `- error: value of type 'URLSessionTask' (aka 'AnyObject') has no member 'response'
64 | }
65 |
[26/27] Compiling APIKit URLSessionAdapter.swift
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/SessionAdapter.swift:14:38: error: cannot find type 'URLRequest' in scope
12 | public protocol SessionAdapter {
13 | /// Returns instance that conforms to `SessionTask`. `handler` must be called after success or failure.
14 | func createTask(with URLRequest: URLRequest, handler: @escaping (Data?, URLResponse?, Error?) -> Void) -> SessionTask
| `- error: cannot find type 'URLRequest' in scope
15 |
16 | /// Collects tasks from backend networking stack. `handler` must be called after collecting.
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/SessionAdapter.swift:14:77: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
12 | public protocol SessionAdapter {
13 | /// Returns instance that conforms to `SessionTask`. `handler` must be called after success or failure.
14 | func createTask(with URLRequest: URLRequest, handler: @escaping (Data?, URLResponse?, Error?) -> Void) -> SessionTask
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
15 |
16 | /// Collects tasks from backend networking stack. `handler` must be called after collecting.
Foundation.URLResponse:2:18: note: 'URLResponse' 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 URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:3:1: error: non-nominal type 'URLSessionTask' (aka 'AnyObject') cannot be extended
1 | import Foundation
2 |
3 | extension URLSessionTask: SessionTask {
| `- error: non-nominal type 'URLSessionTask' (aka 'AnyObject') cannot be extended
4 |
5 | }
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:7:13: warning: var 'dataTaskResponseBufferKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
5 | }
6 |
7 | private var dataTaskResponseBufferKey = 0
| |- warning: var 'dataTaskResponseBufferKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'dataTaskResponseBufferKey' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: annotate 'dataTaskResponseBufferKey' 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
8 | private var taskAssociatedObjectCompletionHandlerKey = 0
9 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:8:13: warning: var 'taskAssociatedObjectCompletionHandlerKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
6 |
7 | private var dataTaskResponseBufferKey = 0
8 | private var taskAssociatedObjectCompletionHandlerKey = 0
| |- warning: var 'taskAssociatedObjectCompletionHandlerKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'taskAssociatedObjectCompletionHandlerKey' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: annotate 'taskAssociatedObjectCompletionHandlerKey' 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
9 |
10 | /// `URLSessionAdapter` connects `URLSession` with `Session`.
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:19:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 | open class URLSessionAdapter: NSObject, SessionAdapter, URLSessionDelegate, URLSessionTaskDelegate, URLSessionDataDelegate {
18 | /// The underlying `URLSession` instance.
19 | open var urlSession: URLSession!
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |
21 | /// Returns `URLSessionAdapter` initialized with `URLSessionConfiguration`.
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/APIKit/SessionAdapter/URLSessionAdapter.swift:22:32: error: 'URLSessionConfiguration' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |
21 | /// Returns `URLSessionAdapter` initialized with `URLSessionConfiguration`.
22 | public init(configuration: URLSessionConfiguration) {
| `- error: 'URLSessionConfiguration' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
23 | super.init()
24 | self.urlSession = URLSession(configuration: configuration, delegate: self, delegateQueue: nil)
Foundation.URLSessionConfiguration:2:18: note: 'URLSessionConfiguration' 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 URLSessionConfiguration = AnyObject
| `- note: 'URLSessionConfiguration' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:28:43: error: cannot find type 'URLRequest' in scope
26 |
27 | /// Creates `URLSessionDataTask` instance using `dataTaskWithRequest(_:completionHandler:)`.
28 | open func createTask(with URLRequest: URLRequest, handler: @escaping (Data?, URLResponse?, Error?) -> Void) -> SessionTask {
| `- error: cannot find type 'URLRequest' in scope
29 | let task = urlSession.dataTask(with: URLRequest)
30 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:28:82: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
26 |
27 | /// Creates `URLSessionDataTask` instance using `dataTaskWithRequest(_:completionHandler:)`.
28 | open func createTask(with URLRequest: URLRequest, handler: @escaping (Data?, URLResponse?, Error?) -> Void) -> SessionTask {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
29 | let task = urlSession.dataTask(with: URLRequest)
30 |
Foundation.URLResponse:2:18: note: 'URLResponse' 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 URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:45:67: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
43 | }
44 |
45 | private func setBuffer(_ buffer: NSMutableData, forTask task: URLSessionTask) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
46 | objc_setAssociatedObject(task, &dataTaskResponseBufferKey, buffer, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
47 | }
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
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:49:35: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
47 | }
48 |
49 | private func buffer(for task: URLSessionTask) -> NSMutableData? {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
50 | return objc_getAssociatedObject(task, &dataTaskResponseBufferKey) as? NSMutableData
51 | }
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
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:53:58: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
51 | }
52 |
53 | private func setHandler(_ handler: @escaping (Data?, URLResponse?, Error?) -> Void, forTask task: URLSessionTask) {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
54 | objc_setAssociatedObject(task, &taskAssociatedObjectCompletionHandlerKey, handler as Any, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
55 | }
Foundation.URLResponse:2:18: note: 'URLResponse' 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 URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:53:103: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
51 | }
52 |
53 | private func setHandler(_ handler: @escaping (Data?, URLResponse?, Error?) -> Void, forTask task: URLSessionTask) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
54 | objc_setAssociatedObject(task, &taskAssociatedObjectCompletionHandlerKey, handler as Any, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
55 | }
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
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:57:36: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
55 | }
56 |
57 | private func handler(for task: URLSessionTask) -> ((Data?, URLResponse?, Error?) -> Void)? {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
58 | return objc_getAssociatedObject(task, &taskAssociatedObjectCompletionHandlerKey) as? (Data?, URLResponse?, Error?) -> Void
59 | }
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
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:57:64: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
55 | }
56 |
57 | private func handler(for task: URLSessionTask) -> ((Data?, URLResponse?, Error?) -> Void)? {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
58 | return objc_getAssociatedObject(task, &taskAssociatedObjectCompletionHandlerKey) as? (Data?, URLResponse?, Error?) -> Void
59 | }
Foundation.URLResponse:2:18: note: 'URLResponse' 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 URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:62:37: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
60 |
61 | // MARK: URLSessionTaskDelegate
62 | open 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.
63 | handler(for: task)?(buffer(for: task) as Data?, task.response, error)
64 | }
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/APIKit/SessionAdapter/URLSessionAdapter.swift:62:55: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
60 |
61 | // MARK: URLSessionTaskDelegate
62 | open 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.
63 | handler(for: task)?(buffer(for: task) as Data?, task.response, error)
64 | }
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
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:67:37: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
65 |
66 | // MARK: URLSessionDataDelegate
67 | open 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.
68 | buffer(for: dataTask)?.append(data)
69 | }
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/APIKit/SessionAdapter/URLSessionAdapter.swift:67:59: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
65 |
66 | // MARK: URLSessionDataDelegate
67 | open 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.
68 | buffer(for: dataTask)?.append(data)
69 | }
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/APIKit/SessionAdapter/URLSessionAdapter.swift:17:57: error: cannot find type 'URLSessionDelegate' in scope
15 | /// `URLSession(_:task: didCompleteWithError:)` and `URLSession(_:dataTask:didReceiveData:)`, you have to call
16 | /// `super` in these methods if you implement them.
17 | open class URLSessionAdapter: NSObject, SessionAdapter, URLSessionDelegate, URLSessionTaskDelegate, URLSessionDataDelegate {
| `- error: cannot find type 'URLSessionDelegate' in scope
18 | /// The underlying `URLSession` instance.
19 | open var urlSession: URLSession!
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:17:77: error: cannot find type 'URLSessionTaskDelegate' in scope
15 | /// `URLSession(_:task: didCompleteWithError:)` and `URLSession(_:dataTask:didReceiveData:)`, you have to call
16 | /// `super` in these methods if you implement them.
17 | open class URLSessionAdapter: NSObject, SessionAdapter, URLSessionDelegate, URLSessionTaskDelegate, URLSessionDataDelegate {
| `- error: cannot find type 'URLSessionTaskDelegate' in scope
18 | /// The underlying `URLSession` instance.
19 | open var urlSession: URLSession!
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:17:101: error: cannot find type 'URLSessionDataDelegate' in scope
15 | /// `URLSession(_:task: didCompleteWithError:)` and `URLSession(_:dataTask:didReceiveData:)`, you have to call
16 | /// `super` in these methods if you implement them.
17 | open class URLSessionAdapter: NSObject, SessionAdapter, URLSessionDelegate, URLSessionTaskDelegate, URLSessionDataDelegate {
| `- error: cannot find type 'URLSessionDataDelegate' in scope
18 | /// The underlying `URLSession` instance.
19 | open var urlSession: URLSession!
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:24:27: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
22 | public init(configuration: URLSessionConfiguration) {
23 | super.init()
24 | self.urlSession = URLSession(configuration: configuration, delegate: self, delegateQueue: nil)
| `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
25 | }
26 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:24:99: error: 'nil' requires a contextual type
22 | public init(configuration: URLSessionConfiguration) {
23 | super.init()
24 | self.urlSession = URLSession(configuration: configuration, delegate: self, delegateQueue: nil)
| `- error: 'nil' requires a contextual type
25 | }
26 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:29:31: error: value of type 'URLSession' (aka 'AnyObject') has no member 'dataTask'
27 | /// Creates `URLSessionDataTask` instance using `dataTaskWithRequest(_:completionHandler:)`.
28 | open func createTask(with URLRequest: URLRequest, handler: @escaping (Data?, URLResponse?, Error?) -> Void) -> SessionTask {
29 | let task = urlSession.dataTask(with: URLRequest)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'dataTask'
30 |
31 | setBuffer(NSMutableData(), forTask: task)
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:39:20: error: value of type 'URLSession' (aka 'AnyObject') has no member 'getTasksWithCompletionHandler'
37 | /// Aggregates `URLSessionTask` instances in `URLSession` using `getTasksWithCompletionHandler(_:)`.
38 | open func getTasks(with handler: @escaping ([SessionTask]) -> Void) {
39 | urlSession.getTasksWithCompletionHandler { dataTasks, uploadTasks, downloadTasks in
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'getTasksWithCompletionHandler'
40 | let allTasks: [URLSessionTask] = dataTasks + uploadTasks + downloadTasks
41 | handler(allTasks)
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:41:21: error: cannot convert value of type '[URLSessionTask]' (aka 'Array<AnyObject>') to expected argument type '[any SessionTask]'
39 | urlSession.getTasksWithCompletionHandler { dataTasks, uploadTasks, downloadTasks in
40 | let allTasks: [URLSessionTask] = dataTasks + uploadTasks + downloadTasks
41 | handler(allTasks)
| |- error: cannot convert value of type '[URLSessionTask]' (aka 'Array<AnyObject>') to expected argument type '[any SessionTask]'
| `- note: arguments to generic parameter 'Element' ('URLSessionTask' (aka 'AnyObject') and 'any SessionTask') are expected to be equal
42 | }
43 | }
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:46:9: error: cannot find 'objc_setAssociatedObject' in scope
44 |
45 | private func setBuffer(_ buffer: NSMutableData, forTask task: URLSessionTask) {
46 | objc_setAssociatedObject(task, &dataTaskResponseBufferKey, buffer, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
| `- error: cannot find 'objc_setAssociatedObject' in scope
47 | }
48 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:46:77: error: cannot infer contextual base in reference to member 'OBJC_ASSOCIATION_RETAIN_NONATOMIC'
44 |
45 | private func setBuffer(_ buffer: NSMutableData, forTask task: URLSessionTask) {
46 | objc_setAssociatedObject(task, &dataTaskResponseBufferKey, buffer, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
| `- error: cannot infer contextual base in reference to member 'OBJC_ASSOCIATION_RETAIN_NONATOMIC'
47 | }
48 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:50:16: error: cannot find 'objc_getAssociatedObject' in scope
48 |
49 | private func buffer(for task: URLSessionTask) -> NSMutableData? {
50 | return objc_getAssociatedObject(task, &dataTaskResponseBufferKey) as? NSMutableData
| `- error: cannot find 'objc_getAssociatedObject' in scope
51 | }
52 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:54:9: error: cannot find 'objc_setAssociatedObject' in scope
52 |
53 | private func setHandler(_ handler: @escaping (Data?, URLResponse?, Error?) -> Void, forTask task: URLSessionTask) {
54 | objc_setAssociatedObject(task, &taskAssociatedObjectCompletionHandlerKey, handler as Any, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
| `- error: cannot find 'objc_setAssociatedObject' in scope
55 | }
56 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:54:100: error: cannot infer contextual base in reference to member 'OBJC_ASSOCIATION_RETAIN_NONATOMIC'
52 |
53 | private func setHandler(_ handler: @escaping (Data?, URLResponse?, Error?) -> Void, forTask task: URLSessionTask) {
54 | objc_setAssociatedObject(task, &taskAssociatedObjectCompletionHandlerKey, handler as Any, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
| `- error: cannot infer contextual base in reference to member 'OBJC_ASSOCIATION_RETAIN_NONATOMIC'
55 | }
56 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:58:16: error: cannot find 'objc_getAssociatedObject' in scope
56 |
57 | private func handler(for task: URLSessionTask) -> ((Data?, URLResponse?, Error?) -> Void)? {
58 | return objc_getAssociatedObject(task, &taskAssociatedObjectCompletionHandlerKey) as? (Data?, URLResponse?, Error?) -> Void
| `- error: cannot find 'objc_getAssociatedObject' in scope
59 | }
60 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:63:62: error: value of type 'URLSessionTask' (aka 'AnyObject') has no member 'response'
61 | // MARK: URLSessionTaskDelegate
62 | open func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) {
63 | handler(for: task)?(buffer(for: task) as Data?, task.response, error)
| `- error: value of type 'URLSessionTask' (aka 'AnyObject') has no member 'response'
64 | }
65 |
[27/27] Compiling APIKit Unavailable.swift
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/SessionAdapter.swift:14:38: error: cannot find type 'URLRequest' in scope
12 | public protocol SessionAdapter {
13 | /// Returns instance that conforms to `SessionTask`. `handler` must be called after success or failure.
14 | func createTask(with URLRequest: URLRequest, handler: @escaping (Data?, URLResponse?, Error?) -> Void) -> SessionTask
| `- error: cannot find type 'URLRequest' in scope
15 |
16 | /// Collects tasks from backend networking stack. `handler` must be called after collecting.
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/SessionAdapter.swift:14:77: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
12 | public protocol SessionAdapter {
13 | /// Returns instance that conforms to `SessionTask`. `handler` must be called after success or failure.
14 | func createTask(with URLRequest: URLRequest, handler: @escaping (Data?, URLResponse?, Error?) -> Void) -> SessionTask
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
15 |
16 | /// Collects tasks from backend networking stack. `handler` must be called after collecting.
Foundation.URLResponse:2:18: note: 'URLResponse' 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 URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:3:1: error: non-nominal type 'URLSessionTask' (aka 'AnyObject') cannot be extended
1 | import Foundation
2 |
3 | extension URLSessionTask: SessionTask {
| `- error: non-nominal type 'URLSessionTask' (aka 'AnyObject') cannot be extended
4 |
5 | }
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:7:13: warning: var 'dataTaskResponseBufferKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
5 | }
6 |
7 | private var dataTaskResponseBufferKey = 0
| |- warning: var 'dataTaskResponseBufferKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'dataTaskResponseBufferKey' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: annotate 'dataTaskResponseBufferKey' 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
8 | private var taskAssociatedObjectCompletionHandlerKey = 0
9 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:8:13: warning: var 'taskAssociatedObjectCompletionHandlerKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
6 |
7 | private var dataTaskResponseBufferKey = 0
8 | private var taskAssociatedObjectCompletionHandlerKey = 0
| |- warning: var 'taskAssociatedObjectCompletionHandlerKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'taskAssociatedObjectCompletionHandlerKey' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: annotate 'taskAssociatedObjectCompletionHandlerKey' 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
9 |
10 | /// `URLSessionAdapter` connects `URLSession` with `Session`.
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:19:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 | open class URLSessionAdapter: NSObject, SessionAdapter, URLSessionDelegate, URLSessionTaskDelegate, URLSessionDataDelegate {
18 | /// The underlying `URLSession` instance.
19 | open var urlSession: URLSession!
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |
21 | /// Returns `URLSessionAdapter` initialized with `URLSessionConfiguration`.
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/APIKit/SessionAdapter/URLSessionAdapter.swift:22:32: error: 'URLSessionConfiguration' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |
21 | /// Returns `URLSessionAdapter` initialized with `URLSessionConfiguration`.
22 | public init(configuration: URLSessionConfiguration) {
| `- error: 'URLSessionConfiguration' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
23 | super.init()
24 | self.urlSession = URLSession(configuration: configuration, delegate: self, delegateQueue: nil)
Foundation.URLSessionConfiguration:2:18: note: 'URLSessionConfiguration' 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 URLSessionConfiguration = AnyObject
| `- note: 'URLSessionConfiguration' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:28:43: error: cannot find type 'URLRequest' in scope
26 |
27 | /// Creates `URLSessionDataTask` instance using `dataTaskWithRequest(_:completionHandler:)`.
28 | open func createTask(with URLRequest: URLRequest, handler: @escaping (Data?, URLResponse?, Error?) -> Void) -> SessionTask {
| `- error: cannot find type 'URLRequest' in scope
29 | let task = urlSession.dataTask(with: URLRequest)
30 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:28:82: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
26 |
27 | /// Creates `URLSessionDataTask` instance using `dataTaskWithRequest(_:completionHandler:)`.
28 | open func createTask(with URLRequest: URLRequest, handler: @escaping (Data?, URLResponse?, Error?) -> Void) -> SessionTask {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
29 | let task = urlSession.dataTask(with: URLRequest)
30 |
Foundation.URLResponse:2:18: note: 'URLResponse' 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 URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:45:67: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
43 | }
44 |
45 | private func setBuffer(_ buffer: NSMutableData, forTask task: URLSessionTask) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
46 | objc_setAssociatedObject(task, &dataTaskResponseBufferKey, buffer, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
47 | }
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
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:49:35: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
47 | }
48 |
49 | private func buffer(for task: URLSessionTask) -> NSMutableData? {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
50 | return objc_getAssociatedObject(task, &dataTaskResponseBufferKey) as? NSMutableData
51 | }
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
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:53:58: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
51 | }
52 |
53 | private func setHandler(_ handler: @escaping (Data?, URLResponse?, Error?) -> Void, forTask task: URLSessionTask) {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
54 | objc_setAssociatedObject(task, &taskAssociatedObjectCompletionHandlerKey, handler as Any, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
55 | }
Foundation.URLResponse:2:18: note: 'URLResponse' 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 URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:53:103: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
51 | }
52 |
53 | private func setHandler(_ handler: @escaping (Data?, URLResponse?, Error?) -> Void, forTask task: URLSessionTask) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
54 | objc_setAssociatedObject(task, &taskAssociatedObjectCompletionHandlerKey, handler as Any, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
55 | }
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
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:57:36: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
55 | }
56 |
57 | private func handler(for task: URLSessionTask) -> ((Data?, URLResponse?, Error?) -> Void)? {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
58 | return objc_getAssociatedObject(task, &taskAssociatedObjectCompletionHandlerKey) as? (Data?, URLResponse?, Error?) -> Void
59 | }
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
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:57:64: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
55 | }
56 |
57 | private func handler(for task: URLSessionTask) -> ((Data?, URLResponse?, Error?) -> Void)? {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
58 | return objc_getAssociatedObject(task, &taskAssociatedObjectCompletionHandlerKey) as? (Data?, URLResponse?, Error?) -> Void
59 | }
Foundation.URLResponse:2:18: note: 'URLResponse' 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 URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:62:37: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
60 |
61 | // MARK: URLSessionTaskDelegate
62 | open 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.
63 | handler(for: task)?(buffer(for: task) as Data?, task.response, error)
64 | }
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/APIKit/SessionAdapter/URLSessionAdapter.swift:62:55: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
60 |
61 | // MARK: URLSessionTaskDelegate
62 | open 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.
63 | handler(for: task)?(buffer(for: task) as Data?, task.response, error)
64 | }
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
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:67:37: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
65 |
66 | // MARK: URLSessionDataDelegate
67 | open 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.
68 | buffer(for: dataTask)?.append(data)
69 | }
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/APIKit/SessionAdapter/URLSessionAdapter.swift:67:59: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
65 |
66 | // MARK: URLSessionDataDelegate
67 | open 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.
68 | buffer(for: dataTask)?.append(data)
69 | }
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/APIKit/SessionAdapter/URLSessionAdapter.swift:17:57: error: cannot find type 'URLSessionDelegate' in scope
15 | /// `URLSession(_:task: didCompleteWithError:)` and `URLSession(_:dataTask:didReceiveData:)`, you have to call
16 | /// `super` in these methods if you implement them.
17 | open class URLSessionAdapter: NSObject, SessionAdapter, URLSessionDelegate, URLSessionTaskDelegate, URLSessionDataDelegate {
| `- error: cannot find type 'URLSessionDelegate' in scope
18 | /// The underlying `URLSession` instance.
19 | open var urlSession: URLSession!
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:17:77: error: cannot find type 'URLSessionTaskDelegate' in scope
15 | /// `URLSession(_:task: didCompleteWithError:)` and `URLSession(_:dataTask:didReceiveData:)`, you have to call
16 | /// `super` in these methods if you implement them.
17 | open class URLSessionAdapter: NSObject, SessionAdapter, URLSessionDelegate, URLSessionTaskDelegate, URLSessionDataDelegate {
| `- error: cannot find type 'URLSessionTaskDelegate' in scope
18 | /// The underlying `URLSession` instance.
19 | open var urlSession: URLSession!
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:17:101: error: cannot find type 'URLSessionDataDelegate' in scope
15 | /// `URLSession(_:task: didCompleteWithError:)` and `URLSession(_:dataTask:didReceiveData:)`, you have to call
16 | /// `super` in these methods if you implement them.
17 | open class URLSessionAdapter: NSObject, SessionAdapter, URLSessionDelegate, URLSessionTaskDelegate, URLSessionDataDelegate {
| `- error: cannot find type 'URLSessionDataDelegate' in scope
18 | /// The underlying `URLSession` instance.
19 | open var urlSession: URLSession!
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:24:27: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
22 | public init(configuration: URLSessionConfiguration) {
23 | super.init()
24 | self.urlSession = URLSession(configuration: configuration, delegate: self, delegateQueue: nil)
| `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
25 | }
26 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:24:99: error: 'nil' requires a contextual type
22 | public init(configuration: URLSessionConfiguration) {
23 | super.init()
24 | self.urlSession = URLSession(configuration: configuration, delegate: self, delegateQueue: nil)
| `- error: 'nil' requires a contextual type
25 | }
26 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:29:31: error: value of type 'URLSession' (aka 'AnyObject') has no member 'dataTask'
27 | /// Creates `URLSessionDataTask` instance using `dataTaskWithRequest(_:completionHandler:)`.
28 | open func createTask(with URLRequest: URLRequest, handler: @escaping (Data?, URLResponse?, Error?) -> Void) -> SessionTask {
29 | let task = urlSession.dataTask(with: URLRequest)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'dataTask'
30 |
31 | setBuffer(NSMutableData(), forTask: task)
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:39:20: error: value of type 'URLSession' (aka 'AnyObject') has no member 'getTasksWithCompletionHandler'
37 | /// Aggregates `URLSessionTask` instances in `URLSession` using `getTasksWithCompletionHandler(_:)`.
38 | open func getTasks(with handler: @escaping ([SessionTask]) -> Void) {
39 | urlSession.getTasksWithCompletionHandler { dataTasks, uploadTasks, downloadTasks in
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'getTasksWithCompletionHandler'
40 | let allTasks: [URLSessionTask] = dataTasks + uploadTasks + downloadTasks
41 | handler(allTasks)
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:41:21: error: cannot convert value of type '[URLSessionTask]' (aka 'Array<AnyObject>') to expected argument type '[any SessionTask]'
39 | urlSession.getTasksWithCompletionHandler { dataTasks, uploadTasks, downloadTasks in
40 | let allTasks: [URLSessionTask] = dataTasks + uploadTasks + downloadTasks
41 | handler(allTasks)
| |- error: cannot convert value of type '[URLSessionTask]' (aka 'Array<AnyObject>') to expected argument type '[any SessionTask]'
| `- note: arguments to generic parameter 'Element' ('URLSessionTask' (aka 'AnyObject') and 'any SessionTask') are expected to be equal
42 | }
43 | }
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:46:9: error: cannot find 'objc_setAssociatedObject' in scope
44 |
45 | private func setBuffer(_ buffer: NSMutableData, forTask task: URLSessionTask) {
46 | objc_setAssociatedObject(task, &dataTaskResponseBufferKey, buffer, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
| `- error: cannot find 'objc_setAssociatedObject' in scope
47 | }
48 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:46:77: error: cannot infer contextual base in reference to member 'OBJC_ASSOCIATION_RETAIN_NONATOMIC'
44 |
45 | private func setBuffer(_ buffer: NSMutableData, forTask task: URLSessionTask) {
46 | objc_setAssociatedObject(task, &dataTaskResponseBufferKey, buffer, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
| `- error: cannot infer contextual base in reference to member 'OBJC_ASSOCIATION_RETAIN_NONATOMIC'
47 | }
48 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:50:16: error: cannot find 'objc_getAssociatedObject' in scope
48 |
49 | private func buffer(for task: URLSessionTask) -> NSMutableData? {
50 | return objc_getAssociatedObject(task, &dataTaskResponseBufferKey) as? NSMutableData
| `- error: cannot find 'objc_getAssociatedObject' in scope
51 | }
52 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:54:9: error: cannot find 'objc_setAssociatedObject' in scope
52 |
53 | private func setHandler(_ handler: @escaping (Data?, URLResponse?, Error?) -> Void, forTask task: URLSessionTask) {
54 | objc_setAssociatedObject(task, &taskAssociatedObjectCompletionHandlerKey, handler as Any, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
| `- error: cannot find 'objc_setAssociatedObject' in scope
55 | }
56 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:54:100: error: cannot infer contextual base in reference to member 'OBJC_ASSOCIATION_RETAIN_NONATOMIC'
52 |
53 | private func setHandler(_ handler: @escaping (Data?, URLResponse?, Error?) -> Void, forTask task: URLSessionTask) {
54 | objc_setAssociatedObject(task, &taskAssociatedObjectCompletionHandlerKey, handler as Any, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
| `- error: cannot infer contextual base in reference to member 'OBJC_ASSOCIATION_RETAIN_NONATOMIC'
55 | }
56 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:58:16: error: cannot find 'objc_getAssociatedObject' in scope
56 |
57 | private func handler(for task: URLSessionTask) -> ((Data?, URLResponse?, Error?) -> Void)? {
58 | return objc_getAssociatedObject(task, &taskAssociatedObjectCompletionHandlerKey) as? (Data?, URLResponse?, Error?) -> Void
| `- error: cannot find 'objc_getAssociatedObject' in scope
59 | }
60 |
/host/spi-builder-workspace/Sources/APIKit/SessionAdapter/URLSessionAdapter.swift:63:62: error: value of type 'URLSessionTask' (aka 'AnyObject') has no member 'response'
61 | // MARK: URLSessionTaskDelegate
62 | open func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) {
63 | handler(for: task)?(buffer(for: task) as Data?, task.response, error)
| `- error: value of type 'URLSessionTask' (aka 'AnyObject') has no member 'response'
64 | }
65 |
BUILD FAILURE 6.0 linux