every now and then SwiftPM on macOS gets stuck in some kind of unrecoverable state. it looks like this:
% swift build --build-tests
Another instance of SwiftPM is already running using '/Users/diana/GitHub/ordo/.build',
waiting until that process has finished execution...
it has two differential diagnoses:
- it does not print a PID, usually if there really exists another SwiftPM instance, that error message prints the PID of that process
- nobody else, including sourcekit-lsp, seems to be able to unstick SwiftPM either. the way you know this is because
.builddoes not instantly reappear when you delete.buildas it usually does. thus, whatever is preventing the developer’sswift buildinvocation from progressing is also affecting all the other little demons as well.
there are lots of caches i’ve tried nuking (~/.cache, ~/.swiftpm, ~/Library/Caches/, ~/Library/Developer/Xcode/DerivedData, $TMPDIR, etc.) but nothing gets SwiftPM unstuck on macOS. it is almost as if SwiftPM is completely paralyzed. the only thing that gets it working again is a total system reboot of macOS.
are these known issues, and if so, what causes it?