I'm dealing with a heavily modularised codebase where features are split into their own packages, each within a respective GitHub repo, with some dependencies between them, forming a dependency graph that generally has 50+ Swift Packages.
The codebase and the modularisation is amazing and providing us with a huge amount of benefits, but the whole team's productivity suffers because of the tooling.
Opening an Xcode project with a lot of Swift package dependencies is a game of roulette. More often than not, the dependency resolution will fail with various errors, like caching issues, SwiftPM.SPMRepositoryError error 3
, error 5
, etc...
Resetting package caches often solves the problem, but sometimes you have to manually delete all caches, restart Xcode, or even restart a computer. The problem is that dependency resolution is extremely slow even with a gigabit connection. It can easily take up to five minutes on the M1 Pro and then fail.
When this happens often, and to the whole iOS team, the amount of wasted time becomes very worrying.
It's worth saying that we haven't noticed any issues when dealing with pure Swift packages through the command line, but working with them from Xcode is a nightmare. Unfortunately, most of our products are iOS apps, so we can't avoid Xcode.
I'm of course waiting for Xcode 14 to see if that will help in any way. If that doesn't happen, I was thinking of spinning up a package registry in a hope of at least making the resolution faster, but that will only be possible if Xcode 14 supports the registry, or at least using packages that use the registry.
I'm starting this thread to see if there are other people experiencing similar problems in hope that somebody has found potential remedies to the problems.