swift - 在 Linux 上迁移到 Swift 5 后包管理器出现奇怪问题

标签 swift linux

我在 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 构建时,一切正常:项目构建并执行但是当我使用最新的 Swift 5 构建执行相同的命令时,我得到了 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 运行过程。我等了好几天都没有结果。

最佳答案

问题的发生是因为我的依赖关系树中至少有一个包仍然使用 Swift 3 list (不带工具版本的 Package.swift 文件:4.x 或 5.x),Swift 5 不再支持这些 list 。

swift build --enable-pubgrub-resolver

将有助于找到它。

关于swift - 在 Linux 上迁移到 Swift 5 后包管理器出现奇怪问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56754511/

相关文章:

swift - 带有 NSWindowController 的菜单栏应用

c - 对 sync_fetch_and_add_4 的 undefined reference

linux - 从 LLVM 位代码创建与位置无关的目标文件

ios - 在 Storyboard 中使用 LOTAnimationView 和自动布局

ios - 在 TableView 部分标题中添加 UIButton 和 UIImage

KVO 时 iOS 11 AVPlayer 崩溃

ios - 如何将文本写入 swift3 iOS 中保存在服务器上的文件

linux - Grep 一行然后打印 awk 直到某个子串

c - 为什么我缺少终止“字符?

linux - 是否有 GNU CLI 实用程序帮助页面 (--help) 格式的 RFC 或等效规范?