Xcode hangs with beachball before every build

Over the past week, Xcode has started to hang every time I start a build - it doesn't matter if I use a keyboard shortcut, or are running a single test, or clicking on a single test to build and run - after I start a build process, the cursor waits about 1 sec, then turns into a beachball for about 10 seconds, and then the build starts. I've tried deleting Derived Data, cleaning up old simulators, even completely reinstalling Xcode 13.2.1, but nothing has helped. I do have Git/Github integration turned on, but turning it off did not solve it. It only appears to be one project (my main work project) that does this, so I'm thinking there's some cruft built up somewhere in the project itself. It does have about 15 Swift Packages included in it - could it be attempting to check versions before every build? I would think that unlikely, since I already get the obligatory "Updating packages" when I first open the project.

Any thoughts as to any other things in a project that might lead to such a long freeze before building starts? Thanks!

I think I found the problem -- something about SwiftPM was causing the freeze. I deleted the entire contents of ~/Library/Caches/org.swift.swiftpm and the freeze is gone!

Xcode hangs with beachball before every build
 
 
Q