The Swift Package Index logo.Swift Package Index

Build Information

Failed to build Replacer 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/tattn/Replacer.git
Reference: 0.1.0
Cloned https://github.com/tattn/Replacer.git into spi-builder-workspace
SUCCESS checkout https://github.com/tattn/Replacer.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
Fetching https://github.com/Alamofire/Alamofire.git
[1/26716] Fetching alamofire
Fetched https://github.com/Alamofire/Alamofire.git (2.79s)
Computing version for https://github.com/Alamofire/Alamofire.git
Computed https://github.com/Alamofire/Alamofire.git at 4.9.1 (0.30s)
Creating working copy for https://github.com/Alamofire/Alamofire.git
Working copy of https://github.com/Alamofire/Alamofire.git resolved at 4.9.1
Building for debugging...
[1/6] Compiling Replacer URLSessionConfiguration+.swift
/host/spi-builder-workspace/Sources/Replacer/URLSessionConfiguration+.swift:11:1: error: non-nominal type 'URLSessionConfiguration' (aka 'AnyObject') cannot be extended
extension URLSessionConfiguration {
^         ~~~~~~~~~~~~~~~~~~~~~~~
error: emit-module command failed with exit code 1 (use -v to see invocation)
[2/6] Emitting module Replacer
/host/spi-builder-workspace/Sources/Replacer/Replacer.swift:12:43: error: cannot find type 'Selector' in scope
public func replaceStatic(_ fromSelector: Selector,
                                          ^~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/Replacer.swift:14:44: error: cannot find type 'Selector' in scope
                          with toSelector: Selector,
                                           ^~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/Replacer.swift:30:45: error: cannot find type 'Selector' in scope
public func replaceInstance(_ fromSelector: Selector,
                                            ^~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/Replacer.swift:32:46: error: cannot find type 'Selector' in scope
                            with toSelector: Selector,
                                             ^~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/Replacer.swift:51:48: error: cannot find type 'Selector' in scope
private func addOrExchangeMethod(fromSelector: Selector,
                                               ^~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/Replacer.swift:52:46: error: cannot find type 'Method' in scope
                                 fromMethod: Method,
                                             ^~~~~~
/host/spi-builder-workspace/Sources/Replacer/Replacer.swift:54:46: error: cannot find type 'Selector' in scope
                                 toSelector: Selector,
                                             ^~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/Replacer.swift:55:44: error: cannot find type 'Method' in scope
                                 toMethod: Method,
                                           ^~~~~~
/host/spi-builder-workspace/Sources/Replacer/URLSessionConfiguration+.swift:11:1: error: non-nominal type 'URLSessionConfiguration' (aka 'AnyObject') cannot be extended
extension URLSessionConfiguration {
^         ~~~~~~~~~~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/URLStub.swift:19:39: error: cannot find type 'URLRequest' in scope
    public typealias ResponseBlock = (URLRequest) -> (Data?, Error?)
                                      ^~~~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/URLStubManager.swift:45:31: error: cannot find type 'URLRequest' in scope
    func findStub(by request: URLRequest) -> URLStub? {
                              ^~~~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/URLStubProtocol.swift:13:52: error: cannot find type 'URLRequest' in scope
    override open class func canInit(with request: URLRequest) -> Bool {
                                                   ^~~~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/URLStubProtocol.swift:13:30: error: method does not override any method from its superclass
    override open class func canInit(with request: URLRequest) -> Bool {
    ~~~~~~~~                 ^
/host/spi-builder-workspace/Sources/Replacer/URLStubProtocol.swift:17:75: error: cannot find type 'URLRequest' in scope
    override open class func canonicalRequest(for request: URLRequest) -> URLRequest {
                                                                          ^~~~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/URLStubProtocol.swift:17:60: error: cannot find type 'URLRequest' in scope
    override open class func canonicalRequest(for request: URLRequest) -> URLRequest {
                                                           ^~~~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/URLStubProtocol.swift:17:30: error: method does not override any method from its superclass
    override open class func canonicalRequest(for request: URLRequest) -> URLRequest {
    ~~~~~~~~                 ^
/host/spi-builder-workspace/Sources/Replacer/URLStubProtocol.swift:21:24: error: method does not override any method from its superclass
    override open func startLoading() {
    ~~~~~~~~           ^
/host/spi-builder-workspace/Sources/Replacer/URLStubProtocol.swift:43:24: error: method does not override any method from its superclass
    override open func stopLoading() {
    ~~~~~~~~           ^
/host/spi-builder-workspace/Sources/Replacer/URLStubProtocol.swift:11:14: error: only protocols can inherit from 'AnyObject'
public class URLStubProtocol: URLProtocol {
             ^
/host/spi-builder-workspace/Sources/Replacer/URLStubProtocol.swift:11:31: error: 'URLProtocol' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
public class URLStubProtocol: URLProtocol {
                              ^~~~~~~~~~~
Foundation.URLProtocol:2:18: note: 'URLProtocol' has been explicitly marked unavailable here
public typealias URLProtocol = AnyObject
                 ^
[3/6] Compiling Replacer Replacer.swift
/host/spi-builder-workspace/Sources/Replacer/Replacer.swift:12:43: error: cannot find type 'Selector' in scope
public func replaceStatic(_ fromSelector: Selector,
                                          ^~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/Replacer.swift:14:44: error: cannot find type 'Selector' in scope
                          with toSelector: Selector,
                                           ^~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/Replacer.swift:30:45: error: cannot find type 'Selector' in scope
public func replaceInstance(_ fromSelector: Selector,
                                            ^~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/Replacer.swift:32:46: error: cannot find type 'Selector' in scope
                            with toSelector: Selector,
                                             ^~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/Replacer.swift:51:48: error: cannot find type 'Selector' in scope
private func addOrExchangeMethod(fromSelector: Selector,
                                               ^~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/Replacer.swift:52:46: error: cannot find type 'Method' in scope
                                 fromMethod: Method,
                                             ^~~~~~
/host/spi-builder-workspace/Sources/Replacer/Replacer.swift:54:46: error: cannot find type 'Selector' in scope
                                 toSelector: Selector,
                                             ^~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/Replacer.swift:55:44: error: cannot find type 'Method' in scope
                                 toMethod: Method,
                                           ^~~~~~
/host/spi-builder-workspace/Sources/Replacer/Replacer.swift:19:22: error: cannot find 'class_getClassMethod' in scope
    guard let from = class_getClassMethod(fromClass, fromSelector),
                     ^~~~~~~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/Replacer.swift:20:18: error: cannot find 'class_getClassMethod' in scope
        let to = class_getClassMethod(toClass, toSelector) else {
                 ^~~~~~~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/Replacer.swift:24:5: error: cannot find 'method_exchangeImplementations' in scope
    method_exchangeImplementations(from, to)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/Replacer.swift:37:22: error: cannot find 'class_getInstanceMethod' in scope
    guard let from = class_getInstanceMethod(fromClass, fromSelector),
                     ^~~~~~~~~~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/Replacer.swift:38:18: error: cannot find 'class_getInstanceMethod' in scope
        let to = class_getInstanceMethod(toClass, toSelector) else {
                 ^~~~~~~~~~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/Replacer.swift:58:8: error: cannot find 'class_addMethod' in scope
    if class_addMethod(fromClass,
       ^~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/Replacer.swift:60:24: error: cannot find 'method_getImplementation' in scope
                       method_getImplementation(toMethod),
                       ^~~~~~~~~~~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/Replacer.swift:61:24: error: cannot find 'method_getTypeEncoding' in scope
                       method_getTypeEncoding(toMethod)) {
                       ^~~~~~~~~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/Replacer.swift:64:9: error: cannot find 'class_replaceMethod' in scope
        class_replaceMethod(fromClass,
        ^~~~~~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/Replacer.swift:66:29: error: cannot find 'method_getImplementation' in scope
                            method_getImplementation(fromMethod),
                            ^~~~~~~~~~~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/Replacer.swift:67:29: error: cannot find 'method_getTypeEncoding' in scope
                            method_getTypeEncoding(fromMethod))
                            ^~~~~~~~~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/Replacer.swift:70:9: error: cannot find 'method_exchangeImplementations' in scope
        method_exchangeImplementations(fromMethod, toMethod)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[4/6] Compiling Replacer URLStub.swift
/host/spi-builder-workspace/Sources/Replacer/URLStub.swift:19:39: error: cannot find type 'URLRequest' in scope
    public typealias ResponseBlock = (URLRequest) -> (Data?, Error?)
                                      ^~~~~~~~~~
[5/6] Compiling Replacer URLStubManager.swift
/host/spi-builder-workspace/Sources/Replacer/URLStubManager.swift:45:31: error: cannot find type 'URLRequest' in scope
    func findStub(by request: URLRequest) -> URLStub? {
                              ^~~~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/URLStubManager.swift:28:43: error: cannot find 'class_getClassMethod' in scope
        let defaultSessionConfiguration = class_getClassMethod(URLSessionConfiguration.self, #selector(getter: URLSessionConfiguration.default))!
                                          ^~~~~~~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/URLStubManager.swift:28:94: error: '#selector' can only be used with the Objective-C runtime
        let defaultSessionConfiguration = class_getClassMethod(URLSessionConfiguration.self, #selector(getter: URLSessionConfiguration.default))!
                                                                                             ^
/host/spi-builder-workspace/Sources/Replacer/URLStubManager.swift:29:51: error: cannot find 'class_getClassMethod' in scope
        let swizzledDefaultSessionConfiguration = class_getClassMethod(URLSessionConfiguration.self, #selector(getter: URLSessionConfiguration.mock))!
                                                  ^~~~~~~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/URLStubManager.swift:29:102: error: '#selector' can only be used with the Objective-C runtime
        let swizzledDefaultSessionConfiguration = class_getClassMethod(URLSessionConfiguration.self, #selector(getter: URLSessionConfiguration.mock))!
                                                                                                     ^
/host/spi-builder-workspace/Sources/Replacer/URLStubManager.swift:30:9: error: cannot find 'method_exchangeImplementations' in scope
        method_exchangeImplementations(defaultSessionConfiguration, swizzledDefaultSessionConfiguration)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/URLStubManager.swift:38:21: error: type 'URLProtocol' (aka 'AnyObject') has no member 'registerClass'
        URLProtocol.registerClass(URLStubProtocol.self)
        ~~~~~~~~~~~ ^~~~~~~~~~~~~
[6/6] Compiling Replacer URLStubProtocol.swift
/host/spi-builder-workspace/Sources/Replacer/URLStubProtocol.swift:13:52: error: cannot find type 'URLRequest' in scope
    override open class func canInit(with request: URLRequest) -> Bool {
                                                   ^~~~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/URLStubProtocol.swift:13:30: error: method does not override any method from its superclass
    override open class func canInit(with request: URLRequest) -> Bool {
    ~~~~~~~~                 ^
/host/spi-builder-workspace/Sources/Replacer/URLStubProtocol.swift:17:75: error: cannot find type 'URLRequest' in scope
    override open class func canonicalRequest(for request: URLRequest) -> URLRequest {
                                                                          ^~~~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/URLStubProtocol.swift:17:60: error: cannot find type 'URLRequest' in scope
    override open class func canonicalRequest(for request: URLRequest) -> URLRequest {
                                                           ^~~~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/URLStubProtocol.swift:17:30: error: method does not override any method from its superclass
    override open class func canonicalRequest(for request: URLRequest) -> URLRequest {
    ~~~~~~~~                 ^
/host/spi-builder-workspace/Sources/Replacer/URLStubProtocol.swift:21:24: error: method does not override any method from its superclass
    override open func startLoading() {
    ~~~~~~~~           ^
/host/spi-builder-workspace/Sources/Replacer/URLStubProtocol.swift:43:24: error: method does not override any method from its superclass
    override open func stopLoading() {
    ~~~~~~~~           ^
/host/spi-builder-workspace/Sources/Replacer/URLStubProtocol.swift:11:14: error: only protocols can inherit from 'AnyObject'
public class URLStubProtocol: URLProtocol {
             ^
/host/spi-builder-workspace/Sources/Replacer/URLStubProtocol.swift:11:31: error: 'URLProtocol' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
public class URLStubProtocol: URLProtocol {
                              ^~~~~~~~~~~
Foundation.URLProtocol:2:18: note: 'URLProtocol' has been explicitly marked unavailable here
public typealias URLProtocol = AnyObject
                 ^
/host/spi-builder-workspace/Sources/Replacer/URLStubManager.swift:45:31: error: cannot find type 'URLRequest' in scope
    func findStub(by request: URLRequest) -> URLStub? {
                              ^~~~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/URLStubProtocol.swift:22:55: error: cannot find 'request' in scope
        let stub = URLStubManager.shared.findStub(by: request)!
                                                      ^~~~~~~
/host/spi-builder-workspace/Sources/Replacer/URLStubProtocol.swift:29:32: error: 'HTTPURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
                let response = HTTPURLResponse(url: self.request.url!, statusCode: statusCode, httpVersion: nil, headerFields: nil)
                               ^~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/Replacer/URLStubProtocol.swift:29:58: error: value of type 'URLStubProtocol' has no member 'request'
                let response = HTTPURLResponse(url: self.request.url!, statusCode: statusCode, httpVersion: nil, headerFields: nil)
                                                    ~~~~ ^~~~~~~
/host/spi-builder-workspace/Sources/Replacer/URLStubProtocol.swift:29:109: error: 'nil' requires a contextual type
                let response = HTTPURLResponse(url: self.request.url!, statusCode: statusCode, httpVersion: nil, headerFields: nil)
                                                                                                            ^
/host/spi-builder-workspace/Sources/Replacer/URLStubProtocol.swift:29:128: error: 'nil' requires a contextual type
                let response = HTTPURLResponse(url: self.request.url!, statusCode: statusCode, httpVersion: nil, headerFields: nil)
                                                                                                                               ^
error: fatalError
BUILD FAILURE 5.9 linux

Build Machine: Linux 2