Dependency issue in SwiftPM - but I wasn't sure how to log it

I was submitting a few (very) minor PRs to SwiftPM, and I've found that I can't easily build it myself (on main) due to a dependency mismatch/misalignment. The error I'm getting is nicely described:

error: Dependencies could not be resolved because 
root depends on 'swift-argument-parser' 1.2.2..<1.3.0 
and 'swift-driver' depends on 'swift-argument-parser' 1.0.1..<1.1.0.

So it seems the most plausible way to handle this is to update the dependencies of swift-driver so that the version ranges are in alignment, but I wanted to check here first.

(I'm also assuming that when the toolchain is being built, it's assembling this from "all the stuff in the same branch" kind of mechanism, although I didn't spot a way to reproduce that easily on my own system, short a building a whole toolchain myself, which seemed to be brutally overkill for checking a small PR within SwiftPM)

Am I missing something obvious here, and would a PR to swift-driver to bring the versions of swift-argument-parser into alignment be welcome? Or would this be better submitted as a bug to SwiftPM?

1 Like

i have the same problem right now. i ended up just downgrading SAP in the root package.

1 Like

The driver dependency already looks correct to me: swift-driver/Package.swift at main · apple/swift-driver · GitHub

Two options how this could be happening locally:

  • possibly you just need to run swift package update (or the Xcode equivalent)
  • if you are using the bootstrap script, you may have to manually update your swift-driver etc checkouts
1 Like

:person_facepalming: Thank you @NeoNacho - swift package update did the trick, I'd just brainlessly forgotten there were earlier versions cached in there.

it is a very new fix, just landed last week it looks like. refreshing cache also fixed it for me!

1 Like