Xcode build is hanging at the planning build phase with local spm packages

Hi there. We have a large ios project which consists of lots of local spm packages (100+) and some third party spm dependencies. The problem is as the project grows (adding more local packages) xcode build seems to freeze in clean builds. All the packages have static library targets. It tooks over 1 minute to start actually start compiling the code. These are the steps that xcode build freezes.

Using new build system
Building targets in parallel
Planning build
Analyzing workspace
Constructing build description

We also have cocoapods version of the project which consists of xcode framework targets instead of local spm packages. It has not this issue and compiles almost 1 minute faster compared to spm version.

So how can we optimize this?


We're in a similar situation. Would love some debug tips here.

Unfortunately we don’t have any solution. We had a session with two xcode engineer during wwdc21. They informed us this is an edge case in build system and we opened radar together. Then we moved away from adopting spm. We adopted tuist and we are using it since then.