"Infinite" execution in swift-build while resolving dependencies?

Hi,
Summary: the attached project runs swift-build at 100% until killed manually, and never starts a single swift compile. Can you help me resolve this so the project will build?

I make the Neo4j Swift driver Theo, and I am having a problem before releasing the 5.0 version: when a Vapor project sets it as a dependency, swift-build will not finish resolving the dependencies. The longest run I've given it has been 10h20m (time said real 624m7.090s, user 620m25.111s, sys 1m52.509s)

Attached is an example project that demonstrates this behaviour. Simply do "swift build" and it will get stuck on resolving the dependencies, never getting to actually build any code.

I have tried this with both on macOS Mojave 10.14.5 with Xcode 10.2.1, and macOS Catalina beta 3 with Xcode 11 beta 3. The result also seems to be the same if Package.swift says swift-tools-version 4.0 or 5.0

If I build with only Theo as the dependency, swift-build runs fine.

What I wonder may be a part of this is that both Vapor and Theo depend on SwiftNIO, but while Vapor depends on version 1, Theo already depends on version 2. Just speculating, though.

I don't really understand the output of "swift build --verbose". It seems to contradict what I said with swiftc not being run, but I don't see them run using "top -u" or catch them with "ps aux|grep swiftc".

I so look forward to your help in getting this example project to compile, as I really look forward to releasing Theo 5.0 SPM support.

Attachment link / Github

Cheers

Niklas

Yes this will not work.

I also don't understand why we don't get a proper error message instead of infinite resolving.

The infinite recursion is definitely a bug. Please report it: bugs.swift.org

With the newer Swift in Xcode 11, try the experimental new resolver. $ swift build --enable-pubgrub-resolver If there is an underlying issue with your dependency tree, that might do a better job of finding and reporting it.

2 Likes

Thanks, I’ll file the bug. And I’ll document the conflict of dependency versions so Theo users hopefully don’t run into this

Terms of Service

Privacy Policy

Cookie Policy