Зависимость продукта не найдена - только до Swift 4.2 - PullRequest
0 голосов
/ 07 октября 2018

Я поддерживаю два проекта менеджера пакетов Swift на GitHub.Один из них, DiceKit , зависит от другого, ProtocolKit .Они также используют swift-tools-version из 4,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

Однако в Swift 4.2log, получение зависимостей выполнено успешно:

$ 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)

Для справки здесь - это файл Package.swift для DiceKit:

// 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"]),
    ]
)

И здесь - это то, что для 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"]),
    ]
)

Я на этом сошел с ума, и я очень признателен за любую помощь, которую вы все можете оказать.Заранее спасибо!

...