未找到产品依赖项 — 仅在 Swift 4.2 之前

Sam*_*Sam 5 dependencies swift swift-package-manager swift4 swift4.2

我正在 GitHub 上维护两个 Swift Package Manager 项目。其中一个DiceKit依赖于另一个ProtocolKit。他们也都使用swift-tools-version4.0。

DiceKit 与 Travis CI 建立了持续集成,如下所示。它在 macOS 和 Linux、Swift 4.0、4.0.2、4.0.3、4.1、4.1.1、4.1.2、4.1.3 和 4.2 上进行了测试。但是,除了 4.2 之外的每个版本的测试都失败了,而 4.2 上的测试却成功了。

这是 macOS Swift 4.0 日志中的错误:

$ swift test
error: dependency graph is unresolvable; found these conflicting  requirements:
Dependencies: 
    https://github.com/Samasaur1/ProtocolKit.git @ 1.0.0..<2.0.0
error: product dependency 'ProtocolKit' not found
Fetching https://github.com/Samasaur1/ProtocolKit.git
Run Code Online (Sandbox Code Playgroud)

但是,在 Swift 4.2 日志中,获取依赖项是成功的:

$ swift test
Fetching https://github.com/Samasaur1/ProtocolKit.git
Completed resolution in 1.44s
Cloning https://github.com/Samasaur1/ProtocolKit.git
Resolving https://github.com/Samasaur1/ProtocolKit.git at 1.0.2
Compile Swift Module 'ProtocolKit' (1 sources)
Compile Swift Module 'DiceKit' (3 sources)
Compile Swift Module 'DiceKitTests' (4 sources)
Run Code Online (Sandbox Code Playgroud)

作为参考,这里Package.swiftDiceKit的文件:

// swift-tools-version:4.0
// Managed by ice

import PackageDescription

let package = Package(
    name: "DiceKit",
    products: [
        .library(name: "DiceKit", targets: ["DiceKit"]),
    ],
    dependencies: [
        .package(url: "https://github.com/Samasaur1/ProtocolKit.git", from: "1.0.0"),
    ],
    targets: [
        .target(name: "DiceKit", dependencies: ["ProtocolKit"]),
        .testTarget(name: "DiceKitTests", dependencies: ["DiceKit"]),
    ]
)
Run Code Online (Sandbox Code Playgroud)

这里是一个ProtocolKit:

// swift-tools-version:4.0
// Managed by ice

import PackageDescription

let package = Package(
    name: "ProtocolKit",
    products: [
        .library(name: "ProtocolKit", targets: ["ProtocolKit"]),
    ],
    targets: [
        .target(name: "ProtocolKit", dependencies: []),
        .testTarget(name: "ProtocolKitTests", dependencies: ["ProtocolKit"]),
    ]
)
Run Code Online (Sandbox Code Playgroud)

我对此无能为力,我真的很感激你们能提供的任何帮助。提前致谢!