Strange issue with Package manager after migration to Swift 5 on Linux

I have a backend swift project on Linux (Ubuntu 16.04 with last updates). My Package.swift looks like:

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

when I execute swift build with Swift 4 everything works perfect: project built and executed But when I execute the same command with latest Swift 5 build I got 25 random dependencies and building process stopped:

$ 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

Each time I executed swift build I got different list of dependencies and /opt/swift/usr/bin/swift-build running process. I am waiting several times for several days with no result.

May be someone has any ideas how to debug the issue?

Can you try to run swift build --enable-pubgrub-resolver, that might be able to give you better error messages.

If I had to guess it's probably that at least one package in your dependency tree still uses Swift 3 manifests (Package.swift files with out tools-version: 4.x or 5.x) which are no longer supported in Swift 5.

2 Likes

This would also be my guess because I had the same thing happening and it was because of that reason. Here's a corresponding bug report.

Thank you, it helps. Where is Correct answer button?