i tried to add my own package to the list and run the validate.swift
script, but it does not specify a swift version and is not compiling on my environment. i tried with swift 4.2, 5.0.1, 5.2 (which is the version matching the xcode in your github action workflow), and the latest nightly build.
output with 4.2:
$ swiftenv local 4.2
$ swift validate.swift diff
validate.swift:116:11: error: use of undeclared type 'Result'
extension Result where Success == Void {
^~~~~~
validate.swift:117:17: error: use of undeclared type 'Failure'
init(_ error: Failure?) {
^~~~~~~
validate.swift:160:45: error: use of undeclared type 'Result'
func getPackageSwiftURL(for gitURL: URL) -> Result<URL, PackageError> {
^~~~~~
validate.swift:189:96: error: use of undeclared type 'Result'
func download(_ packageSwiftURL: URL, withSession session: URLSession, _ callback: @escaping ((Result<URL, PackageError>) -> Void)) -> URLSessionDataTask {
^~~~~~
validate.swift:317:122: error: use of undeclared type 'Result'
func filterRepos(_ packageUrls: [URL], withSession session: URLSession, includingMaster: Bool, _ completion: @escaping ((Result<[URL], Error>) -> Void)) {
^~~~~~
validate.swift:356:30: error: use of unresolved identifier 'Result'
var packageUnsetResults = [Result<Void, PackageError>?].init(repeating: nil, count: packageUrls.count)
^~~~~~
validate.swift:365:38: error: use of unresolved identifier 'Result'
packageUnsetResults[index] = Result<Void, PackageError>(error)
^~~~~~
validate.swift:427:97: error: argument type 'String' does not conform to expected type 'CVarArg'
print(String(format: helpText, CommandLine.arguments.first?.components(separatedBy: "/").last ?? "validate.sh"))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
as! CVarArg
output with 5.0.1:
$ swiftenv local 5.0.1
$ swift validate.swift diff
validate.swift:221:11: warning: 'launchPath' is deprecated: renamed to 'executableURL'
process.launchPath = "/usr/bin/swift"
^
validate.swift:221:11: note: use 'executableURL' instead
process.launchPath = "/usr/bin/swift"
^~~~~~~~~~
executableURL
validate.swift:268:11: warning: 'launch()' is deprecated: renamed to 'run'
process.launch()
^
validate.swift:268:11: note: use 'run' instead
process.launch()
^~~~~~
run
validate.swift:427:97: error: argument type 'String' does not conform to expected type 'CVarArg'
print(String(format: helpText, CommandLine.arguments.first?.components(separatedBy: "/").last ?? "validate.sh"))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
as! CVarArg
output with 5.2:
$ swiftenv local 5.2
$ swift validate.swift diff
validate.swift:189:136: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
func download(_ packageSwiftURL: URL, withSession session: URLSession, _ callback: @escaping ((Result<URL, PackageError>) -> Void)) -> URLSessionDataTask {
^~~~~~~~~~~~~~~~~~
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' has been explicitly marked unavailable here
public typealias URLSessionDataTask = AnyObject
^
validate.swift:189:60: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
func download(_ packageSwiftURL: URL, withSession session: URLSession, _ callback: @escaping ((Result<URL, PackageError>) -> Void)) -> URLSessionDataTask {
^~~~~~~~~~
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
public typealias URLSession = AnyObject
^
validate.swift:282:57: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
func verifyPackage(at gitURL: URL, withSession session: URLSession, _ callback: @escaping ((PackageError?) -> Void)) {
^~~~~~~~~~
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
public typealias URLSession = AnyObject
^
validate.swift:317:61: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
func filterRepos(_ packageUrls: [URL], withSession session: URLSession, includingMaster: Bool, _ completion: @escaping ((Result<[URL], Error>) -> Void)) {
^~~~~~~~~~
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
public typealias URLSession = AnyObject
^
validate.swift:351:60: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
func parseRepos(_ packageUrls: [URL], withSession session: URLSession, _ completion: @escaping (([URL: PackageError]) -> Void)) {
^~~~~~~~~~
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
public typealias URLSession = AnyObject
^
validate.swift:411:13: error: 'URLSessionConfiguration' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
let config: URLSessionConfiguration = .default
^~~~~~~~~~~~~~~~~~~~~~~
Foundation.URLSessionConfiguration:2:18: note: 'URLSessionConfiguration' has been explicitly marked unavailable here
public typealias URLSessionConfiguration = AnyObject
^
validate.swift:416:15: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
let session = URLSession(configuration: config)
^~~~~~~~~~
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
public typealias URLSession = AnyObject
^
validate.swift:427:97: error: argument type 'String' does not conform to expected type 'CVarArg'
print(String(format: helpText, CommandLine.arguments.first?.components(separatedBy: "/").last ?? "validate.sh"))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
as! CVarArg
validate.swift:143:14: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
let task = URLSession.shared.dataTask(with: apiURL) { (data, response, error) in
^~~~~~~~~~
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
public typealias URLSession = AnyObject
^
validate.swift:221:11: warning: 'launchPath' is deprecated: renamed to 'executableURL'
process.launchPath = "/usr/bin/swift"
^
validate.swift:221:11: note: use 'executableURL' instead
process.launchPath = "/usr/bin/swift"
^~~~~~~~~~
executableURL
validate.swift:268:11: warning: 'launch()' is deprecated: renamed to 'run'
process.launch()
^
validate.swift:268:11: note: use 'run' instead
process.launch()
^~~~~~
run
output with DEVELOPMENT-SNAPSHOT-2020-05-26-a
:
$ swiftenv local DEVELOPMENT-SNAPSHOT-2020-05-26-a
klossy@klossy:~/downloads/MasterPackageList$ swift validate.swift diff
validate.swift:189:136: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
func download(_ packageSwiftURL: URL, withSession session: URLSession, _ callback: @escaping ((Result<URL, PackageError>) -> Void)) -> URLSessionDataTask {
^~~~~~~~~~~~~~~~~~
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' has been explicitly marked unavailable here
public typealias URLSessionDataTask = AnyObject
^
validate.swift:189:60: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
func download(_ packageSwiftURL: URL, withSession session: URLSession, _ callback: @escaping ((Result<URL, PackageError>) -> Void)) -> URLSessionDataTask {
^~~~~~~~~~
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
public typealias URLSession = AnyObject
^
validate.swift:282:57: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
func verifyPackage(at gitURL: URL, withSession session: URLSession, _ callback: @escaping ((PackageError?) -> Void)) {
^~~~~~~~~~
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
public typealias URLSession = AnyObject
^
validate.swift:317:61: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
func filterRepos(_ packageUrls: [URL], withSession session: URLSession, includingMaster: Bool, _ completion: @escaping ((Result<[URL], Error>) -> Void)) {
^~~~~~~~~~
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
public typealias URLSession = AnyObject
^
validate.swift:351:60: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
func parseRepos(_ packageUrls: [URL], withSession session: URLSession, _ completion: @escaping (([URL: PackageError]) -> Void)) {
^~~~~~~~~~
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
public typealias URLSession = AnyObject
^
validate.swift:411:13: error: 'URLSessionConfiguration' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
let config: URLSessionConfiguration = .default
^~~~~~~~~~~~~~~~~~~~~~~
Foundation.URLSessionConfiguration:2:18: note: 'URLSessionConfiguration' has been explicitly marked unavailable here
public typealias URLSessionConfiguration = AnyObject
^
validate.swift:416:15: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
let session = URLSession(configuration: config)
^~~~~~~~~~
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
public typealias URLSession = AnyObject
^
validate.swift:427:3: error: type of expression is ambiguous without more context
print(String(format: helpText, CommandLine.arguments.first?.components(separatedBy: "/").last ?? "validate.sh"))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
validate.swift:143:14: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
let task = URLSession.shared.dataTask(with: apiURL) { (data, response, error) in
^~~~~~~~~~
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
public typealias URLSession = AnyObject
^
validate.swift:221:11: warning: 'launchPath' is deprecated: renamed to 'executableURL'
process.launchPath = "/usr/bin/swift"
^
validate.swift:221:11: note: use 'executableURL' instead
process.launchPath = "/usr/bin/swift"
^~~~~~~~~~
executableURL
validate.swift:268:11: warning: 'launch()' is deprecated: renamed to 'run'
process.launch()
^
validate.swift:268:11: note: use 'run' instead
process.launch()
^~~~~~
run