The Swift Package Index logo.Swift Package Index

Has it really been five years since Swift Package Index launched? Read our anniversary blog post!

Build Information

Failed to build TestURLProtocol, reference 0.1.0 (979863), with Swift 6.2 (beta) for Linux on 19 Jun 2025 23:33:50 UTC.

Build Command

bash -c docker run --pull=always --rm -v "checkouts-4606859-2":/host -w "$PWD" registry.gitlab.com/finestructure/spi-images:basic-6.2-latest swift build --triple x86_64-unknown-linux-gnu 2>&1

Build Log

========================================
RunAll
========================================
Builder version: 4.64.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/mgopsill/TestURLProtocol.git
Reference: 0.1.0
Initialized empty Git repository in /host/spi-builder-workspace/.git/
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: 	git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: 	git branch -m <name>
From https://github.com/mgopsill/TestURLProtocol
 * tag               0.1.0      -> FETCH_HEAD
HEAD is now at 9798638 🕸 TestURLProtocol
Cloned https://github.com/mgopsill/TestURLProtocol.git
Revision (git rev-parse @):
97986386f569b706e81e86713edaeafb0caadc2e
SUCCESS checkout https://github.com/mgopsill/TestURLProtocol.git at 0.1.0
========================================
Build
========================================
Selected platform:         linux
Swift version:             6.2
Building package at path:  $PWD
https://github.com/mgopsill/TestURLProtocol.git
Running build ...
bash -c docker run --pull=always --rm -v "checkouts-4606859-2":/host -w "$PWD" registry.gitlab.com/finestructure/spi-images:basic-6.2-latest swift build --triple x86_64-unknown-linux-gnu 2>&1
basic-6.2-latest: Pulling from finestructure/spi-images
Digest: sha256:f81a7bd7aa87a0f81848d48c5bcc03f5f78deebd37fa5f9be9913077205d3687
Status: Image is up to date for registry.gitlab.com/finestructure/spi-images:basic-6.2-latest
Building for debugging...
[0/2] Write sources
[1/2] Write swift-version-24593BA9C3E375BF.txt
[3/4] Compiling TestURLProtocol TestURLProtocol.swift
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:7:35: error: cannot find type 'URLRequest' in scope
 5 | public final class TestURLProtocol: URLProtocol {
 6 | 	/// A type alias for a closure that takes in a `URLRequest` and returns a tuple containing a `Result` of `Data` or `Error`, and an optional `statusCode`.
 7 | 	public typealias MockResponse = (URLRequest) -> (
   |                                   `- error: cannot find type 'URLRequest' in scope
 8 | 		result: Result<Data, Error>, statusCode: Int?
 9 | 	)
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:13:51: error: cannot find type 'URLRequest' in scope
11 | 	public static var mockResponses: [URL: MockResponse] = [:]
12 |
13 | 	public override class func canInit(with request: URLRequest) -> Bool {
   |                                                   `- error: cannot find type 'URLRequest' in scope
14 | 		guard let url = request.url else { return false }
15 | 		return mockResponses.keys.contains(url.removingQueries)
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:18:74: error: cannot find type 'URLRequest' in scope
16 | 	}
17 |
18 | 	public override class func canonicalRequest(for request: URLRequest) -> URLRequest {
   |                                                                          `- error: cannot find type 'URLRequest' in scope
19 | 		request
20 | 	}
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:18:59: error: cannot find type 'URLRequest' in scope
16 | 	}
17 |
18 | 	public override class func canonicalRequest(for request: URLRequest) -> URLRequest {
   |                                                           `- error: cannot find type 'URLRequest' in scope
19 | 		request
20 | 	}
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:22:23: error: method does not override any method from its superclass
20 | 	}
21 |
22 | 	public override func startLoading() {
   |                       `- error: method does not override any method from its superclass
23 | 		guard
24 | 			let responseBlock = TestURLProtocol.mockResponses[
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:54:23: error: method does not override any method from its superclass
52 | 	}
53 |
54 | 	public override func stopLoading() {}
   |                       `- error: method does not override any method from its superclass
55 | }
56 |
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:5:37: error: 'URLProtocol' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 3 | /// A `URLProtocol` subclass for testing purposes.
 4 | /// Allows for setting mock responses for specific URLs, which are returned instead of making a real network request.
 5 | public final class TestURLProtocol: URLProtocol {
   |                                     `- error: 'URLProtocol' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 6 | 	/// A type alias for a closure that takes in a `URLRequest` and returns a tuple containing a `Result` of `Data` or `Error`, and an optional `statusCode`.
 7 | 	public typealias MockResponse = (URLRequest) -> (
Foundation.URLProtocol:2:18: note: 'URLProtocol' 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 URLProtocol = AnyObject
  |                  `- note: 'URLProtocol' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:25:5: error: cannot find 'request' in scope
23 | 		guard
24 | 			let responseBlock = TestURLProtocol.mockResponses[
25 | 				request.url!.removingQueries
   |     `- error: cannot find 'request' in scope
26 | 			]
27 | 		else { fatalError("No mock response") }
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:28:32: error: cannot find 'request' in scope
26 | 			]
27 | 		else { fatalError("No mock response") }
28 | 		let response = responseBlock(request)
   |                                `- error: cannot find 'request' in scope
29 |
30 | 		if let statusCode = response.statusCode {
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:32:10: error: cannot find 'request' in scope
30 | 		if let statusCode = response.statusCode {
31 | 			let httpURLResponse = HTTPURLResponse(
32 | 				url: request.url!,
   |          `- error: cannot find 'request' in scope
33 | 				statusCode: statusCode,
34 | 				httpVersion: nil,
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:31:26: error: 'HTTPURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
29 |
30 | 		if let statusCode = response.statusCode {
31 | 			let httpURLResponse = HTTPURLResponse(
   |                          `- error: 'HTTPURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
32 | 				url: request.url!,
33 | 				statusCode: statusCode,
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:34:18: error: 'nil' requires a contextual type
32 | 				url: request.url!,
33 | 				statusCode: statusCode,
34 | 				httpVersion: nil,
   |                  `- error: 'nil' requires a contextual type
35 | 				headerFields: nil
36 | 			)!
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:35:19: error: 'nil' requires a contextual type
33 | 				statusCode: statusCode,
34 | 				httpVersion: nil,
35 | 				headerFields: nil
   |                   `- error: 'nil' requires a contextual type
36 | 			)!
37 | 			self.client?.urlProtocol(
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:37:9: error: value of type 'TestURLProtocol' has no member 'client'
35 | 				headerFields: nil
36 | 			)!
37 | 			self.client?.urlProtocol(
   |         `- error: value of type 'TestURLProtocol' has no member 'client'
38 | 				self,
39 | 				didReceive: httpURLResponse,
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:40:26: error: cannot infer contextual base in reference to member 'notAllowed'
38 | 				self,
39 | 				didReceive: httpURLResponse,
40 | 				cacheStoragePolicy: .notAllowed
   |                          `- error: cannot infer contextual base in reference to member 'notAllowed'
41 | 			)
42 | 		}
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:46:4: error: cannot find 'client' in scope
44 | 		switch response.result {
45 | 		case let .success(data):
46 | 			client?.urlProtocol(self, didLoad: data)
   |    `- error: cannot find 'client' in scope
47 | 			client?.urlProtocolDidFinishLoading(self)
48 |
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:47:4: error: cannot find 'client' in scope
45 | 		case let .success(data):
46 | 			client?.urlProtocol(self, didLoad: data)
47 | 			client?.urlProtocolDidFinishLoading(self)
   |    `- error: cannot find 'client' in scope
48 |
49 | 		case let .failure(error):
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:50:4: error: cannot find 'client' in scope
48 |
49 | 		case let .failure(error):
50 | 			client?.urlProtocol(self, didFailWithError: error)
   |    `- error: cannot find 'client' in scope
51 | 		}
52 | 	}
error: emit-module command failed with exit code 1 (use -v to see invocation)
[4/4] Emitting module TestURLProtocol
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:7:35: error: cannot find type 'URLRequest' in scope
 5 | public final class TestURLProtocol: URLProtocol {
 6 | 	/// A type alias for a closure that takes in a `URLRequest` and returns a tuple containing a `Result` of `Data` or `Error`, and an optional `statusCode`.
 7 | 	public typealias MockResponse = (URLRequest) -> (
   |                                   `- error: cannot find type 'URLRequest' in scope
 8 | 		result: Result<Data, Error>, statusCode: Int?
 9 | 	)
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:13:51: error: cannot find type 'URLRequest' in scope
11 | 	public static var mockResponses: [URL: MockResponse] = [:]
12 |
13 | 	public override class func canInit(with request: URLRequest) -> Bool {
   |                                                   `- error: cannot find type 'URLRequest' in scope
14 | 		guard let url = request.url else { return false }
15 | 		return mockResponses.keys.contains(url.removingQueries)
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:18:74: error: cannot find type 'URLRequest' in scope
16 | 	}
17 |
18 | 	public override class func canonicalRequest(for request: URLRequest) -> URLRequest {
   |                                                                          `- error: cannot find type 'URLRequest' in scope
19 | 		request
20 | 	}
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:18:59: error: cannot find type 'URLRequest' in scope
16 | 	}
17 |
18 | 	public override class func canonicalRequest(for request: URLRequest) -> URLRequest {
   |                                                           `- error: cannot find type 'URLRequest' in scope
19 | 		request
20 | 	}
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:22:23: error: method does not override any method from its superclass
20 | 	}
21 |
22 | 	public override func startLoading() {
   |                       `- error: method does not override any method from its superclass
23 | 		guard
24 | 			let responseBlock = TestURLProtocol.mockResponses[
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:54:23: error: method does not override any method from its superclass
52 | 	}
53 |
54 | 	public override func stopLoading() {}
   |                       `- error: method does not override any method from its superclass
55 | }
56 |
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:5:37: error: 'URLProtocol' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 3 | /// A `URLProtocol` subclass for testing purposes.
 4 | /// Allows for setting mock responses for specific URLs, which are returned instead of making a real network request.
 5 | public final class TestURLProtocol: URLProtocol {
   |                                     `- error: 'URLProtocol' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 6 | 	/// A type alias for a closure that takes in a `URLRequest` and returns a tuple containing a `Result` of `Data` or `Error`, and an optional `statusCode`.
 7 | 	public typealias MockResponse = (URLRequest) -> (
Foundation.URLProtocol:2:18: note: 'URLProtocol' 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 URLProtocol = AnyObject
  |                  `- note: 'URLProtocol' has been explicitly marked unavailable here
BUILD FAILURE 6.2 linux