Build Information
Failed to build DataCache with Swift 5.10 for Linux.
Build Command
bash -c docker run --rm -v "checkouts-4609320-1":/host -w "$workDir" registry.gitlab.com/finestructure/spi-images:basic-5.10-latest swift build 2>&1
Build Log
========================================
RunAll
========================================
Builder version: 4.29.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/huynguyencong/DataCache.git
Reference: master
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/huynguyencong/DataCache
* branch master -> FETCH_HEAD
* [new branch] master -> origin/master
HEAD is now at bcb54d3 Update Podspec tag and package iOS version
Cloned https://github.com/huynguyencong/DataCache.git
Revision (git rev-parse @):
bcb54d313a6ab16fc3f8fa5884ec0f5f331c6ae3
SUCCESS checkout https://github.com/huynguyencong/DataCache.git at master
========================================
Build
========================================
Selected platform: linux
Swift version: 5.10
Building package at path: $workDir
https://github.com/huynguyencong/DataCache.git
Running build ...
bash -c docker run --rm -v "checkouts-4609320-1":/host -w "$workDir" registry.gitlab.com/finestructure/spi-images:basic-5.10-latest swift build 2>&1
Building for debugging...
[0/2] Write sources
[1/2] Write swift-version-24593BA9C3E375BF.txt
error: emit-module command failed with exit code 1 (use -v to see invocation)
[3/6] Compiling DataCache Dictionary+Cache.swift
[4/6] Emitting module DataCache
/host/spi-builder-workspace/Sources/DataCache.swift:22:47: error: cannot find type 'TimeInterval' in scope
static let defaultMaxCachePeriodInSecond: TimeInterval = 60 * 60 * 24 * 7 // a week
^~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:28:20: error: cannot find 'NSCache' in scope
let memCache = NSCache<AnyObject, AnyObject>()
^~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:29:18: error: cannot find type 'DispatchQueue' in scope
let ioQueue: DispatchQueue
^~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:30:22: error: cannot find type 'FileManager' in scope
let fileManager: FileManager
^~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:69:29: error: cannot find type 'Data' in scope
public func write(data: Data, forKey key: String) {
^~~~
/host/spi-builder-workspace/Sources/DataCache.swift:74:40: error: cannot find type 'Data' in scope
private func writeDataToDisk(data: Data, key: String) {
^~~~
/host/spi-builder-workspace/Sources/DataCache.swift:89:48: error: cannot find type 'Data' in scope
public func readData(forKey key:String) -> Data? {
^~~~
/host/spi-builder-workspace/Sources/DataCache.swift:103:57: error: cannot find type 'Data' in scope
public func readDataFromDisk(forKey key: String) -> Data? {
^~~~
/host/spi-builder-workspace/Sources/DataCache.swift:124:31: error: cannot find type 'NSCoding' in scope
public func write(object: NSCoding, forKey key: String) {
^~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:145:51: error: cannot find type 'NSObject' in scope
public func readObject(forKey key: String) -> NSObject? {
^~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:293:6: error: Objective-C interoperability is disabled
@objc public func cleanExpiredDiskCache() {
~^~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:303:5: warning: non-'@objc' instance method in extensions cannot be overridden; use 'public' instead
open func cleanExpiredDiskCache(completion handler: (()->())? = nil) {
^~~~
public
/host/spi-builder-workspace/Sources/DataCache.swift:367:83: error: cannot find type 'URL' in scope
fileprivate func travelCachedFiles(onlyForCacheSize: Bool) -> (urlsToDelete: [URL], diskCacheSize: UInt, cachedFiles: [URL: URLResourceValues]) {
^~~
/host/spi-builder-workspace/Sources/DataCache.swift:367:124: error: cannot find type 'URL' in scope
fileprivate func travelCachedFiles(onlyForCacheSize: Bool) -> (urlsToDelete: [URL], diskCacheSize: UInt, cachedFiles: [URL: URLResourceValues]) {
^~~
[5/6] Compiling DataCache String+MD5.swift
/host/spi-builder-workspace/Sources/String+MD5.swift:35:45: error: missing argument for parameter 'capacity' in call
let MD5String = NSMutableString()
^
capacity: <#Int#>
Foundation.NSMutableString:4:21: note: 'init(capacity:)' declared here
required public init(capacity: Int)
^
[6/6] Compiling DataCache DataCache.swift
/host/spi-builder-workspace/Sources/DataCache.swift:22:47: error: cannot find type 'TimeInterval' in scope
static let defaultMaxCachePeriodInSecond: TimeInterval = 60 * 60 * 24 * 7 // a week
^~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:28:20: error: cannot find 'NSCache' in scope
let memCache = NSCache<AnyObject, AnyObject>()
^~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:29:18: error: cannot find type 'DispatchQueue' in scope
let ioQueue: DispatchQueue
^~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:30:22: error: cannot find type 'FileManager' in scope
let fileManager: FileManager
^~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:69:29: error: cannot find type 'Data' in scope
public func write(data: Data, forKey key: String) {
^~~~
/host/spi-builder-workspace/Sources/DataCache.swift:74:40: error: cannot find type 'Data' in scope
private func writeDataToDisk(data: Data, key: String) {
^~~~
/host/spi-builder-workspace/Sources/DataCache.swift:89:48: error: cannot find type 'Data' in scope
public func readData(forKey key:String) -> Data? {
^~~~
/host/spi-builder-workspace/Sources/DataCache.swift:103:57: error: cannot find type 'Data' in scope
public func readDataFromDisk(forKey key: String) -> Data? {
^~~~
/host/spi-builder-workspace/Sources/DataCache.swift:124:31: error: cannot find type 'NSCoding' in scope
public func write(object: NSCoding, forKey key: String) {
^~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:145:51: error: cannot find type 'NSObject' in scope
public func readObject(forKey key: String) -> NSObject? {
^~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:293:6: error: Objective-C interoperability is disabled
@objc public func cleanExpiredDiskCache() {
~^~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:303:5: warning: non-'@objc' instance method in extensions cannot be overridden; use 'public' instead
open func cleanExpiredDiskCache(completion handler: (()->())? = nil) {
^~~~
public
/host/spi-builder-workspace/Sources/DataCache.swift:367:83: error: cannot find type 'URL' in scope
fileprivate func travelCachedFiles(onlyForCacheSize: Bool) -> (urlsToDelete: [URL], diskCacheSize: UInt, cachedFiles: [URL: URLResourceValues]) {
^~~
/host/spi-builder-workspace/Sources/DataCache.swift:367:124: error: cannot find type 'URL' in scope
fileprivate func travelCachedFiles(onlyForCacheSize: Bool) -> (urlsToDelete: [URL], diskCacheSize: UInt, cachedFiles: [URL: URLResourceValues]) {
^~~
/host/spi-builder-workspace/Sources/DataCache.swift:45:33: error: cannot find 'NSSearchPathForDirectoriesInDomains' in scope
var cachePath = path ?? NSSearchPathForDirectoriesInDomains(.cachesDirectory, FileManager.SearchPathDomainMask.userDomainMask, true).first!
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:45:87: error: cannot find 'FileManager' in scope
var cachePath = path ?? NSSearchPathForDirectoriesInDomains(.cachesDirectory, FileManager.SearchPathDomainMask.userDomainMask, true).first!
^~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:45:70: error: cannot infer contextual base in reference to member 'cachesDirectory'
var cachePath = path ?? NSSearchPathForDirectoriesInDomains(.cachesDirectory, FileManager.SearchPathDomainMask.userDomainMask, true).first!
~^~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:46:35: error: cannot find type 'NSString' in scope
cachePath = (cachePath as NSString).appendingPathComponent(DataCache.cacheDirectoryPrefix + name)
^~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:49:19: error: cannot find 'DispatchQueue' in scope
ioQueue = DispatchQueue(label: DataCache.ioQueuePrefix + name)
^~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:51:28: error: cannot find 'FileManager' in scope
self.fileManager = FileManager()
^~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:54:13: error: cannot find 'NotificationCenter' in scope
NotificationCenter.default.addObserver(self, selector: #selector(cleanExpiredDiskCache), name: UIApplication.willTerminateNotification, object: nil)
^~~~~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:54:108: error: cannot find 'UIApplication' in scope
NotificationCenter.default.addObserver(self, selector: #selector(cleanExpiredDiskCache), name: UIApplication.willTerminateNotification, object: nil)
^~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:54:68: error: '#selector' can only be used with the Objective-C runtime
NotificationCenter.default.addObserver(self, selector: #selector(cleanExpiredDiskCache), name: UIApplication.willTerminateNotification, object: nil)
^
/host/spi-builder-workspace/Sources/DataCache.swift:55:13: error: cannot find 'NotificationCenter' in scope
NotificationCenter.default.addObserver(self, selector: #selector(cleanExpiredDiskCache), name: UIApplication.didEnterBackgroundNotification, object: nil)
^~~~~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:55:108: error: cannot find 'UIApplication' in scope
NotificationCenter.default.addObserver(self, selector: #selector(cleanExpiredDiskCache), name: UIApplication.didEnterBackgroundNotification, object: nil)
^~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:55:68: error: '#selector' can only be used with the Objective-C runtime
NotificationCenter.default.addObserver(self, selector: #selector(cleanExpiredDiskCache), name: UIApplication.didEnterBackgroundNotification, object: nil)
^
/host/spi-builder-workspace/Sources/DataCache.swift:60:9: error: cannot find 'NotificationCenter' in scope
NotificationCenter.default.removeObserver(self)
^~~~~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:90:66: error: cannot find type 'Data' in scope
var data = memCache.object(forKey: key as AnyObject) as? Data
^~~~
/host/spi-builder-workspace/Sources/DataCache.swift:109:24: error: cannot find 'JSONEncoder' in scope
let data = try JSONEncoder().encode(codable)
^~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:110:9: error: no exact matches in call to instance method 'write'
write(data: data, forKey: key)
^
/host/spi-builder-workspace/Sources/DataCache.swift:130:17: note: incorrect labels for candidate (have: '(data:forKey:)', expected: '(string:forKey:)')
public func write(string: String, forKey key: String) {
^
/host/spi-builder-workspace/Sources/DataCache.swift:135:17: note: incorrect labels for candidate (have: '(data:forKey:)', expected: '(dictionary:forKey:)')
public func write(dictionary: Dictionary<AnyHashable, Any>, forKey key: String) {
^
/host/spi-builder-workspace/Sources/DataCache.swift:140:17: note: incorrect labels for candidate (have: '(data:forKey:)', expected: '(array:forKey:)')
public func write(array: Array<Any>, forKey key: String) {
^
/host/spi-builder-workspace/Sources/DataCache.swift:115:20: error: cannot find 'JSONDecoder' in scope
return try JSONDecoder().decode(T.self, from: data)
^~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:125:20: error: cannot find 'NSKeyedArchiver' in scope
let data = NSKeyedArchiver.archivedData(withRootObject: object)
^~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:126:9: error: no exact matches in call to instance method 'write'
write(data: data, forKey: key)
^
/host/spi-builder-workspace/Sources/DataCache.swift:130:17: note: incorrect labels for candidate (have: '(data:forKey:)', expected: '(string:forKey:)')
public func write(string: String, forKey key: String) {
^
/host/spi-builder-workspace/Sources/DataCache.swift:135:17: note: incorrect labels for candidate (have: '(data:forKey:)', expected: '(dictionary:forKey:)')
public func write(dictionary: Dictionary<AnyHashable, Any>, forKey key: String) {
^
/host/spi-builder-workspace/Sources/DataCache.swift:140:17: note: incorrect labels for candidate (have: '(data:forKey:)', expected: '(array:forKey:)')
public func write(array: Array<Any>, forKey key: String) {
^
/host/spi-builder-workspace/Sources/DataCache.swift:131:33: error: cannot find type 'NSCoding' in scope
write(object: string as NSCoding, forKey: key)
^~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:131:9: error: no exact matches in call to instance method 'write'
write(object: string as NSCoding, forKey: key)
^
/host/spi-builder-workspace/Sources/DataCache.swift:108:17: note: incorrect labels for candidate (have: '(object:forKey:)', expected: '(codable:forKey:)')
public func write<T: Encodable>(codable: T, forKey key: String) throws {
^
/host/spi-builder-workspace/Sources/DataCache.swift:130:17: note: incorrect labels for candidate (have: '(object:forKey:)', expected: '(string:forKey:)')
public func write(string: String, forKey key: String) {
^
/host/spi-builder-workspace/Sources/DataCache.swift:136:37: error: cannot find type 'NSCoding' in scope
write(object: dictionary as NSCoding, forKey: key)
^~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:136:14: error: incorrect argument label in call (have 'object:forKey:', expected 'dictionary:forKey:')
write(object: dictionary as NSCoding, forKey: key)
^~~~~~~
dictionary
/host/spi-builder-workspace/Sources/DataCache.swift:141:32: error: cannot find type 'NSCoding' in scope
write(object: array as NSCoding, forKey: key)
^~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:141:14: error: incorrect argument label in call (have 'object:forKey:', expected 'array:forKey:')
write(object: array as NSCoding, forKey: key)
^~~~~~~
array
/host/spi-builder-workspace/Sources/DataCache.swift:355:13: error: cannot find 'DispatchQueue' in scope
DispatchQueue.main.async(execute: { () -> Void in
^~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:369:28: error: cannot find 'URL' in scope
let diskCacheURL = URL(fileURLWithPath: cachePath)
^~~
/host/spi-builder-workspace/Sources/DataCache.swift:370:31: error: cannot find type 'URLResourceKey' in scope
let resourceKeys: Set<URLResourceKey> = [.isDirectoryKey, .contentAccessDateKey, .totalFileAllocatedSizeKey]
^~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:371:26: error: cannot find type 'Date' in scope
let expiredDate: Date? = (maxCachePeriodInSecond < 0) ? nil : Date(timeIntervalSinceNow: -maxCachePeriodInSecond)
^~~~
/host/spi-builder-workspace/Sources/DataCache.swift:373:28: error: cannot find 'URL' in scope
var cachedFiles = [URL: URLResourceValues]()
^~~
/host/spi-builder-workspace/Sources/DataCache.swift:373:33: error: cannot find 'URLResourceValues' in scope
var cachedFiles = [URL: URLResourceValues]()
^~~~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:373:27: error: cannot call value of non-function type '[AnyHashable : Any]'
var cachedFiles = [URL: URLResourceValues]()
^ ~~
/host/spi-builder-workspace/Sources/DataCache.swift:374:29: error: cannot find 'URL' in scope
var urlsToDelete = [URL]()
^~~
/host/spi-builder-workspace/Sources/DataCache.swift:374:28: error: cannot call value of non-function type '[Any]'
var urlsToDelete = [URL]()
^ ~~
/host/spi-builder-workspace/Sources/DataCache.swift:377:139: error: cannot infer contextual base in reference to member 'skipsHiddenFiles'
for fileUrl in (try? fileManager.contentsOfDirectory(at: diskCacheURL, includingPropertiesForKeys: Array(resourceKeys), options: .skipsHiddenFiles)) ?? [] {
~^~~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:412:30: error: cannot find type 'NSString' in scope
return (cachePath as NSString).appendingPathComponent(fileName)
^~~~~~~~
error: fatalError
[0/1] Planning build
Building for debugging...
[0/1] Write swift-version-24593BA9C3E375BF.txt
error: emit-module command failed with exit code 1 (use -v to see invocation)
[2/4] Emitting module DataCache
/host/spi-builder-workspace/Sources/DataCache.swift:22:47: error: cannot find type 'TimeInterval' in scope
static let defaultMaxCachePeriodInSecond: TimeInterval = 60 * 60 * 24 * 7 // a week
^~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:28:20: error: cannot find 'NSCache' in scope
let memCache = NSCache<AnyObject, AnyObject>()
^~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:29:18: error: cannot find type 'DispatchQueue' in scope
let ioQueue: DispatchQueue
^~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:30:22: error: cannot find type 'FileManager' in scope
let fileManager: FileManager
^~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:69:29: error: cannot find type 'Data' in scope
public func write(data: Data, forKey key: String) {
^~~~
/host/spi-builder-workspace/Sources/DataCache.swift:74:40: error: cannot find type 'Data' in scope
private func writeDataToDisk(data: Data, key: String) {
^~~~
/host/spi-builder-workspace/Sources/DataCache.swift:89:48: error: cannot find type 'Data' in scope
public func readData(forKey key:String) -> Data? {
^~~~
/host/spi-builder-workspace/Sources/DataCache.swift:103:57: error: cannot find type 'Data' in scope
public func readDataFromDisk(forKey key: String) -> Data? {
^~~~
/host/spi-builder-workspace/Sources/DataCache.swift:124:31: error: cannot find type 'NSCoding' in scope
public func write(object: NSCoding, forKey key: String) {
^~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:145:51: error: cannot find type 'NSObject' in scope
public func readObject(forKey key: String) -> NSObject? {
^~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:293:6: error: Objective-C interoperability is disabled
@objc public func cleanExpiredDiskCache() {
~^~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:303:5: warning: non-'@objc' instance method in extensions cannot be overridden; use 'public' instead
open func cleanExpiredDiskCache(completion handler: (()->())? = nil) {
^~~~
public
/host/spi-builder-workspace/Sources/DataCache.swift:367:83: error: cannot find type 'URL' in scope
fileprivate func travelCachedFiles(onlyForCacheSize: Bool) -> (urlsToDelete: [URL], diskCacheSize: UInt, cachedFiles: [URL: URLResourceValues]) {
^~~
/host/spi-builder-workspace/Sources/DataCache.swift:367:124: error: cannot find type 'URL' in scope
fileprivate func travelCachedFiles(onlyForCacheSize: Bool) -> (urlsToDelete: [URL], diskCacheSize: UInt, cachedFiles: [URL: URLResourceValues]) {
^~~
[3/4] Compiling DataCache String+MD5.swift
/host/spi-builder-workspace/Sources/String+MD5.swift:35:45: error: missing argument for parameter 'capacity' in call
let MD5String = NSMutableString()
^
capacity: <#Int#>
Foundation.NSMutableString:4:21: note: 'init(capacity:)' declared here
required public init(capacity: Int)
^
[4/4] Compiling DataCache DataCache.swift
/host/spi-builder-workspace/Sources/DataCache.swift:22:47: error: cannot find type 'TimeInterval' in scope
static let defaultMaxCachePeriodInSecond: TimeInterval = 60 * 60 * 24 * 7 // a week
^~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:28:20: error: cannot find 'NSCache' in scope
let memCache = NSCache<AnyObject, AnyObject>()
^~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:29:18: error: cannot find type 'DispatchQueue' in scope
let ioQueue: DispatchQueue
^~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:30:22: error: cannot find type 'FileManager' in scope
let fileManager: FileManager
^~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:69:29: error: cannot find type 'Data' in scope
public func write(data: Data, forKey key: String) {
^~~~
/host/spi-builder-workspace/Sources/DataCache.swift:74:40: error: cannot find type 'Data' in scope
private func writeDataToDisk(data: Data, key: String) {
^~~~
/host/spi-builder-workspace/Sources/DataCache.swift:89:48: error: cannot find type 'Data' in scope
public func readData(forKey key:String) -> Data? {
^~~~
/host/spi-builder-workspace/Sources/DataCache.swift:103:57: error: cannot find type 'Data' in scope
public func readDataFromDisk(forKey key: String) -> Data? {
^~~~
/host/spi-builder-workspace/Sources/DataCache.swift:124:31: error: cannot find type 'NSCoding' in scope
public func write(object: NSCoding, forKey key: String) {
^~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:145:51: error: cannot find type 'NSObject' in scope
public func readObject(forKey key: String) -> NSObject? {
^~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:293:6: error: Objective-C interoperability is disabled
@objc public func cleanExpiredDiskCache() {
~^~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:303:5: warning: non-'@objc' instance method in extensions cannot be overridden; use 'public' instead
open func cleanExpiredDiskCache(completion handler: (()->())? = nil) {
^~~~
public
/host/spi-builder-workspace/Sources/DataCache.swift:367:83: error: cannot find type 'URL' in scope
fileprivate func travelCachedFiles(onlyForCacheSize: Bool) -> (urlsToDelete: [URL], diskCacheSize: UInt, cachedFiles: [URL: URLResourceValues]) {
^~~
/host/spi-builder-workspace/Sources/DataCache.swift:367:124: error: cannot find type 'URL' in scope
fileprivate func travelCachedFiles(onlyForCacheSize: Bool) -> (urlsToDelete: [URL], diskCacheSize: UInt, cachedFiles: [URL: URLResourceValues]) {
^~~
/host/spi-builder-workspace/Sources/DataCache.swift:45:33: error: cannot find 'NSSearchPathForDirectoriesInDomains' in scope
var cachePath = path ?? NSSearchPathForDirectoriesInDomains(.cachesDirectory, FileManager.SearchPathDomainMask.userDomainMask, true).first!
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:45:87: error: cannot find 'FileManager' in scope
var cachePath = path ?? NSSearchPathForDirectoriesInDomains(.cachesDirectory, FileManager.SearchPathDomainMask.userDomainMask, true).first!
^~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:45:70: error: cannot infer contextual base in reference to member 'cachesDirectory'
var cachePath = path ?? NSSearchPathForDirectoriesInDomains(.cachesDirectory, FileManager.SearchPathDomainMask.userDomainMask, true).first!
~^~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:46:35: error: cannot find type 'NSString' in scope
cachePath = (cachePath as NSString).appendingPathComponent(DataCache.cacheDirectoryPrefix + name)
^~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:49:19: error: cannot find 'DispatchQueue' in scope
ioQueue = DispatchQueue(label: DataCache.ioQueuePrefix + name)
^~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:51:28: error: cannot find 'FileManager' in scope
self.fileManager = FileManager()
^~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:54:13: error: cannot find 'NotificationCenter' in scope
NotificationCenter.default.addObserver(self, selector: #selector(cleanExpiredDiskCache), name: UIApplication.willTerminateNotification, object: nil)
^~~~~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:54:108: error: cannot find 'UIApplication' in scope
NotificationCenter.default.addObserver(self, selector: #selector(cleanExpiredDiskCache), name: UIApplication.willTerminateNotification, object: nil)
^~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:54:68: error: '#selector' can only be used with the Objective-C runtime
NotificationCenter.default.addObserver(self, selector: #selector(cleanExpiredDiskCache), name: UIApplication.willTerminateNotification, object: nil)
^
/host/spi-builder-workspace/Sources/DataCache.swift:55:13: error: cannot find 'NotificationCenter' in scope
NotificationCenter.default.addObserver(self, selector: #selector(cleanExpiredDiskCache), name: UIApplication.didEnterBackgroundNotification, object: nil)
^~~~~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:55:108: error: cannot find 'UIApplication' in scope
NotificationCenter.default.addObserver(self, selector: #selector(cleanExpiredDiskCache), name: UIApplication.didEnterBackgroundNotification, object: nil)
^~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:55:68: error: '#selector' can only be used with the Objective-C runtime
NotificationCenter.default.addObserver(self, selector: #selector(cleanExpiredDiskCache), name: UIApplication.didEnterBackgroundNotification, object: nil)
^
/host/spi-builder-workspace/Sources/DataCache.swift:60:9: error: cannot find 'NotificationCenter' in scope
NotificationCenter.default.removeObserver(self)
^~~~~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:90:66: error: cannot find type 'Data' in scope
var data = memCache.object(forKey: key as AnyObject) as? Data
^~~~
/host/spi-builder-workspace/Sources/DataCache.swift:109:24: error: cannot find 'JSONEncoder' in scope
let data = try JSONEncoder().encode(codable)
^~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:110:9: error: no exact matches in call to instance method 'write'
write(data: data, forKey: key)
^
/host/spi-builder-workspace/Sources/DataCache.swift:130:17: note: incorrect labels for candidate (have: '(data:forKey:)', expected: '(string:forKey:)')
public func write(string: String, forKey key: String) {
^
/host/spi-builder-workspace/Sources/DataCache.swift:135:17: note: incorrect labels for candidate (have: '(data:forKey:)', expected: '(dictionary:forKey:)')
public func write(dictionary: Dictionary<AnyHashable, Any>, forKey key: String) {
^
/host/spi-builder-workspace/Sources/DataCache.swift:140:17: note: incorrect labels for candidate (have: '(data:forKey:)', expected: '(array:forKey:)')
public func write(array: Array<Any>, forKey key: String) {
^
/host/spi-builder-workspace/Sources/DataCache.swift:115:20: error: cannot find 'JSONDecoder' in scope
return try JSONDecoder().decode(T.self, from: data)
^~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:125:20: error: cannot find 'NSKeyedArchiver' in scope
let data = NSKeyedArchiver.archivedData(withRootObject: object)
^~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:126:9: error: no exact matches in call to instance method 'write'
write(data: data, forKey: key)
^
/host/spi-builder-workspace/Sources/DataCache.swift:130:17: note: incorrect labels for candidate (have: '(data:forKey:)', expected: '(string:forKey:)')
public func write(string: String, forKey key: String) {
^
/host/spi-builder-workspace/Sources/DataCache.swift:135:17: note: incorrect labels for candidate (have: '(data:forKey:)', expected: '(dictionary:forKey:)')
public func write(dictionary: Dictionary<AnyHashable, Any>, forKey key: String) {
^
/host/spi-builder-workspace/Sources/DataCache.swift:140:17: note: incorrect labels for candidate (have: '(data:forKey:)', expected: '(array:forKey:)')
public func write(array: Array<Any>, forKey key: String) {
^
/host/spi-builder-workspace/Sources/DataCache.swift:131:33: error: cannot find type 'NSCoding' in scope
write(object: string as NSCoding, forKey: key)
^~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:131:9: error: no exact matches in call to instance method 'write'
write(object: string as NSCoding, forKey: key)
^
/host/spi-builder-workspace/Sources/DataCache.swift:108:17: note: incorrect labels for candidate (have: '(object:forKey:)', expected: '(codable:forKey:)')
public func write<T: Encodable>(codable: T, forKey key: String) throws {
^
/host/spi-builder-workspace/Sources/DataCache.swift:130:17: note: incorrect labels for candidate (have: '(object:forKey:)', expected: '(string:forKey:)')
public func write(string: String, forKey key: String) {
^
/host/spi-builder-workspace/Sources/DataCache.swift:136:37: error: cannot find type 'NSCoding' in scope
write(object: dictionary as NSCoding, forKey: key)
^~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:136:14: error: incorrect argument label in call (have 'object:forKey:', expected 'dictionary:forKey:')
write(object: dictionary as NSCoding, forKey: key)
^~~~~~~
dictionary
/host/spi-builder-workspace/Sources/DataCache.swift:141:32: error: cannot find type 'NSCoding' in scope
write(object: array as NSCoding, forKey: key)
^~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:141:14: error: incorrect argument label in call (have 'object:forKey:', expected 'array:forKey:')
write(object: array as NSCoding, forKey: key)
^~~~~~~
array
/host/spi-builder-workspace/Sources/DataCache.swift:355:13: error: cannot find 'DispatchQueue' in scope
DispatchQueue.main.async(execute: { () -> Void in
^~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:369:28: error: cannot find 'URL' in scope
let diskCacheURL = URL(fileURLWithPath: cachePath)
^~~
/host/spi-builder-workspace/Sources/DataCache.swift:370:31: error: cannot find type 'URLResourceKey' in scope
let resourceKeys: Set<URLResourceKey> = [.isDirectoryKey, .contentAccessDateKey, .totalFileAllocatedSizeKey]
^~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:371:26: error: cannot find type 'Date' in scope
let expiredDate: Date? = (maxCachePeriodInSecond < 0) ? nil : Date(timeIntervalSinceNow: -maxCachePeriodInSecond)
^~~~
/host/spi-builder-workspace/Sources/DataCache.swift:373:28: error: cannot find 'URL' in scope
var cachedFiles = [URL: URLResourceValues]()
^~~
/host/spi-builder-workspace/Sources/DataCache.swift:373:33: error: cannot find 'URLResourceValues' in scope
var cachedFiles = [URL: URLResourceValues]()
^~~~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:373:27: error: cannot call value of non-function type '[AnyHashable : Any]'
var cachedFiles = [URL: URLResourceValues]()
^ ~~
/host/spi-builder-workspace/Sources/DataCache.swift:374:29: error: cannot find 'URL' in scope
var urlsToDelete = [URL]()
^~~
/host/spi-builder-workspace/Sources/DataCache.swift:374:28: error: cannot call value of non-function type '[Any]'
var urlsToDelete = [URL]()
^ ~~
/host/spi-builder-workspace/Sources/DataCache.swift:377:139: error: cannot infer contextual base in reference to member 'skipsHiddenFiles'
for fileUrl in (try? fileManager.contentsOfDirectory(at: diskCacheURL, includingPropertiesForKeys: Array(resourceKeys), options: .skipsHiddenFiles)) ?? [] {
~^~~~~~~~~~~~~~~~
/host/spi-builder-workspace/Sources/DataCache.swift:412:30: error: cannot find type 'NSString' in scope
return (cachePath as NSString).appendingPathComponent(fileName)
^~~~~~~~
error: fatalError
BUILD FAILURE 5.10 linux