The Swift Package Index logo.Swift Package Index

Build Information

Failed to build TestURLProtocol with Swift 5.9 for Linux.

Build Command

docker run --rm -v "checkouts-4609320-1":/host -w "/host/spi-builder-workspace" registry.gitlab.com/finestructure/spi-images:basic-5.9-latest swift build 2>&1

Build Log

========================================
RunAll
========================================
Builder version: 4.19.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/mgopsill/TestURLProtocol.git
Reference: 0.1.0
Cloned https://github.com/mgopsill/TestURLProtocol.git into spi-builder-workspace
SUCCESS checkout https://github.com/mgopsill/TestURLProtocol.git at 0.1.0
========================================
Build
========================================
Selected platform:         linux
Swift version:             5.9
Building package at path:  spi-builder-workspace
Running build ...
docker run --rm -v "checkouts-4609320-1":/host -w "/host/spi-builder-workspace" registry.gitlab.com/finestructure/spi-images:basic-5.9-latest swift build 2>&1
Building for debugging...
error: emit-module command failed with exit code 1 (use -v to see invocation)
[1/2] Emitting module TestURLProtocol
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:7:35: error: cannot find type 'URLRequest' in scope
        public typealias MockResponse = (URLRequest) -> (
                                         ^~~~~~~~~~
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:13:51: error: cannot find type 'URLRequest' in scope
        public override class func canInit(with request: URLRequest) -> Bool {
                                                         ^~~~~~~~~~
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:13:29: error: method does not override any method from its superclass
        public override class func canInit(with request: URLRequest) -> Bool {
               ~~~~~~~~            ^
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:18:74: error: cannot find type 'URLRequest' in scope
        public override class func canonicalRequest(for request: URLRequest) -> URLRequest {
                                                                                ^~~~~~~~~~
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:18:59: error: cannot find type 'URLRequest' in scope
        public override class func canonicalRequest(for request: URLRequest) -> URLRequest {
                                                                 ^~~~~~~~~~
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:18:29: error: method does not override any method from its superclass
        public override class func canonicalRequest(for request: URLRequest) -> URLRequest {
               ~~~~~~~~            ^
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:22:23: error: method does not override any method from its superclass
        public override func startLoading() {
               ~~~~~~~~      ^
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:54:23: error: method does not override any method from its superclass
        public override func stopLoading() {}
               ~~~~~~~~      ^
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:5:20: error: only protocols can inherit from 'AnyObject'
public final class TestURLProtocol: URLProtocol {
                   ^
/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.
public final class TestURLProtocol: URLProtocol {
                                    ^~~~~~~~~~~
Foundation.URLProtocol:2:18: note: 'URLProtocol' has been explicitly marked unavailable here
public typealias URLProtocol = AnyObject
                 ^
[2/2] Compiling TestURLProtocol TestURLProtocol.swift
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:7:35: error: cannot find type 'URLRequest' in scope
        public typealias MockResponse = (URLRequest) -> (
                                         ^~~~~~~~~~
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:13:51: error: cannot find type 'URLRequest' in scope
        public override class func canInit(with request: URLRequest) -> Bool {
                                                         ^~~~~~~~~~
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:13:29: error: method does not override any method from its superclass
        public override class func canInit(with request: URLRequest) -> Bool {
               ~~~~~~~~            ^
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:18:74: error: cannot find type 'URLRequest' in scope
        public override class func canonicalRequest(for request: URLRequest) -> URLRequest {
                                                                                ^~~~~~~~~~
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:18:59: error: cannot find type 'URLRequest' in scope
        public override class func canonicalRequest(for request: URLRequest) -> URLRequest {
                                                                 ^~~~~~~~~~
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:18:29: error: method does not override any method from its superclass
        public override class func canonicalRequest(for request: URLRequest) -> URLRequest {
               ~~~~~~~~            ^
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:22:23: error: method does not override any method from its superclass
        public override func startLoading() {
               ~~~~~~~~      ^
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:54:23: error: method does not override any method from its superclass
        public override func stopLoading() {}
               ~~~~~~~~      ^
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:5:20: error: only protocols can inherit from 'AnyObject'
public final class TestURLProtocol: URLProtocol {
                   ^
/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.
public final class TestURLProtocol: URLProtocol {
                                    ^~~~~~~~~~~
Foundation.URLProtocol:2:18: note: 'URLProtocol' has been explicitly marked unavailable here
public typealias URLProtocol = AnyObject
                 ^
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:25:5: error: cannot find 'request' in scope
                                request.url!.removingQueries
                                ^~~~~~~
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:28:32: error: cannot find 'request' in scope
                let response = responseBlock(request)
                                             ^~~~~~~
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:32:10: error: cannot find 'request' in scope
                                url: request.url!,
                                     ^~~~~~~
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:31:26: error: 'HTTPURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
                        let httpURLResponse = HTTPURLResponse(
                                              ^~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:34:18: error: 'nil' requires a contextual type
                                httpVersion: nil,
                                             ^
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:35:19: error: 'nil' requires a contextual type
                                headerFields: nil
                                              ^
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:37:9: error: value of type 'TestURLProtocol' has no member 'client'
                        self.client?.urlProtocol(
                        ~~~~ ^~~~~~
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:40:26: error: cannot infer contextual base in reference to member 'notAllowed'
                                cacheStoragePolicy: .notAllowed
                                                    ~^~~~~~~~~~
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:46:4: error: cannot find 'client' in scope
                        client?.urlProtocol(self, didLoad: data)
                        ^~~~~~
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:47:4: error: cannot find 'client' in scope
                        client?.urlProtocolDidFinishLoading(self)
                        ^~~~~~
/host/spi-builder-workspace/Sources/TestURLProtocol/TestURLProtocol.swift:50:4: error: cannot find 'client' in scope
                        client?.urlProtocol(self, didFailWithError: error)
                        ^~~~~~
error: fatalError
BUILD FAILURE 5.9 linux

Build Machine: Linux 2