我在Linux上有一个后端swift项目(Ubuntu 16.04,最新更新)。我的Package.swift看起来像:
dependencies: [
.package(url: "https://github.com/czechboy0/Redbird.git", from: "0.10.0"),
.package(url: "https://github.com/PerfectlySoft/Perfect-HTTPServer.git", from: "3.0.0"),
.package(url: "https://github.com/Swinject/Swinject.git", .exact("2.2.0")),
.package(url: "https://github.com/IBM-Swift/SwiftyRequest.git", from: "1.0.0"),
.package(url: "https://github.com/PerfectlySoft/Perfect-Logger.git", from: "3.0.0"),
.package(url: "https://github.com/OpenKitten/MongoKitten.git", from: "4.0.0"),
],
当我使用Swift 4执行swift build时,一切都可以正常运行:项目已构建并执行,但是当我使用最新的Swift 5 build执行同一命令时,我得到了25个随机依赖项,并且构建过程停止了:
$ swift build
Updating https://github.com/Swinject/Swinject.git
Updating https://github.com/IBM-Swift/SwiftyRequest.git
Updating https://github.com/PerfectlySoft/PerfectLib.git
Updating https://github.com/vapor/socks.git
Updating https://github.com/PerfectlySoft/Perfect-Logger.git
Updating https://github.com/IBM-Swift/CircuitBreaker.git
Updating https://github.com/IBM-Swift/LoggerAPI.git
Updating https://github.com/PerfectlySoft/Perfect-Thread.git
Updating https://github.com/PerfectlySoft/Perfect-Crypto.git
Updating https://github.com/OpenKitten/KittenCTLS.git
Updating https://github.com/PerfectlySoft/Perfect-COpenSSL-Linux.git
Updating https://github.com/PerfectlySoft/Perfect-libcurl.git
Updating https://github.com/PerfectlySoft/Perfect-Net.git
Updating https://github.com/czechboy0/Redbird.git
Updating https://github.com/OpenKitten/Schrodinger.git
Updating https://github.com/OpenKitten/CryptoKitten.git
Updating https://github.com/OpenKitten/MongoKitten.git
Updating https://github.com/PerfectlySoft/Perfect-CZlib-src.git
Updating https://github.com/OpenKitten/BSON.git
Updating https://github.com/PerfectlySoft/Perfect-HTTP.git
Updating https://github.com/PerfectlySoft/Perfect-HTTPServer.git
Updating https://github.com/PerfectlySoft/Perfect-LinuxBridge.git
Updating https://github.com/PerfectlySoft/Perfect-CURL.git
Updating https://github.com/apple/swift-log.git
Updating https://github.com/OpenKitten/Cheetah.git
每次执行swift build
时,都会得到不同的依赖关系列表和/opt/swift/usr/bin/swift-build
运行过程。我等了好几天,没结果。
答案 0 :(得分:0)
发生此问题是因为我的依赖关系树中至少有一个软件包仍使用Swift 3清单(Swift 5不再支持的清单(不含工具版本的Package.swift文件:4.x或5.x)。) >
swift build --enable-pubgrub-resolver
将帮助您找到它。