gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-04 11:48:49 26 4
gpt4 key购买 nike

我在 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com