Kitura / Kitura-CouchDB

CouchDB adapter for Kitura
Apache License 2.0
51 stars 29 forks source link

Swift PM enters an infinite loop with CouchDB + Kitura #71

Closed yarduza closed 6 years ago

yarduza commented 6 years ago

When using both Kitura and CouchDB as dependencies the PM enters an infinite loop.

These are the dependencies I tried it with (clean package init with only these two): dependencies: [

    .package(url: "https://github.com/IBM-Swift/Kitura-CouchDB.git", .upToNextMinor(from: "2.0.0")),
    .package(url: "https://github.com/IBM-Swift/Kitura.git", .upToNextMinor(from: "2.0.0")) 

], Looking at the logs (swift build -v) it seems to be related to BlueSocket somehow

UPDATE: When trying with the previous rev it works fine (dcdc61061553306226c92768c3b44485379e39a7):

    .package(url: "https://github.com/IBM-Swift/Kitura-CouchDB.git", .revision("dcdc61061553306226c92768c3b44485379e39a7")),
    .package(url: "https://github.com/IBM-Swift/Kitura.git", .upToNextMinor(from: "2.0.0")) 
christiancompton commented 6 years ago

Thank you for sharing this @yarduza. I was able to replicate the issue you identified here. This issue can be resolved by using the latest release of Kitura, in this case:

.package(url: "https://github.com/IBM-Swift/Kitura.git", .upToNextMinor(from: "2.1.0"))

Please let us know if this solves the problem.

yarduza commented 6 years ago

Thanks @christiancompton, it solves the basic reduced issue, however, the broader aspect of it is that in my app I'm using Kitura as part of Kitura-Session, and the latter uses .package(url: "https://github.com/IBM-Swift/Kitura.git", .upToNextMinor(from: "2.0.0")) to bring in Kitura.

Trying to state another package for Kitura inside the manifest results in an unresolvable dependency graph. Any way around this?

djones6 commented 6 years ago

FYI, Kitura-Session 2.1.0 has been tagged, which bumps the Kitura dependency to 2.1.0.

yarduza commented 6 years ago

Thanks for the update. Issue remains though.

djones6 commented 6 years ago

Could you make sure you have done a swift package update, as this will pull any new tags down before trying to resolve your dependencies (otherwise, it will continue to use the tags it has previously resolved in your Package.resolved file).

If this still does not work, can you share your current set of (Kitura-related) dependencies?

ianpartridge commented 6 years ago

Closing as the original issue was solved. There is a known broader SPM problem with its dependency resolution - it uses a basic backtracking algorithm which often struggles with moderately complex dependency graphs. 😞