LiveUI / S3

S3 Client written in Swift
MIT License
93 stars 60 forks source link

'HTTPURLResponse' is unavailable #49

Open mustachedkdev opened 4 years ago

mustachedkdev commented 4 years ago

remote: /app/.build/checkouts/S3/Sources/S3/Extensions/S3+Private.swift:15:107: error: use of undeclared type 'URLRequest' remote: func make(request url: URL, method: HTTPMethod, headers: HTTPHeaders, data: Data? = nil, cachePolicy: URLRequest.CachePolicy = .useProtocolCachePolicy, on container: Container) throws -> Future { remote: ^~~~~~ remote: /app/.build/checkouts/S3/Sources/S3/Extensions/S3+Private.swift:27:29: error: use of undeclared type 'URLRequest' remote: func execute(_ request: URLRequest, on container: Container) -> Future { remote: ^~~~~~ remote: /app/.build/checkouts/S3/Sources/S3/Extensions/S3+Private.swift:51:58: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it. remote: static func convert(foundationResponse httpResponse: HTTPURLResponse, data: Data?, on worker: Worker) -> HTTPResponse { remote: ^~~~~~~ remote: Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' has been explicitly marked unavailable here remote: public typealias HTTPURLResponse = AnyObject remote: ^ remote: /app/.build/checkouts/S3/Sources/S3/Extensions/S3+Private.swift:16:23: error: use of unresolved identifier 'URLRequest' remote: var request = URLRequest(url: url, cachePolicy: cachePolicy) remote: ^~~~~~ remote: /app/.build/checkouts/S3/Sources/S3/Extensions/S3+Private.swift:30:9: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it. remote: URLSession.shared.dataTask(with: request, completionHandler: { (data, urlResponse, error) in remote: ^~~~~~ remote: Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here remote: public typealias URLSession = AnyObject

mustachedkdev commented 4 years ago

Seems like there should be come conditional imports depending on linux or mac environment

daSkier commented 4 years ago

@mustachedkdev @rafiki270 I'm running into this issue as well on Docker with swift:5.1.3-xenial. Have you found any work arounds or solutions?

proggeramlug commented 4 years ago

Use this here on master, it’s the fix: https://github.com/skelpo/s3-vapor3

PR coming soon too ;)