in a CI/CD system, when multiple concurrent xcode processes run in parallel on the same mac-agent, errors occur with the processing of the shared cache.
Error example: ❌ fatal error: malformed or corrupted AST file: 'could not find file '.../Pods/Firebase/CoreOnly/Sources/module.modulemap' referenced by AST file '~Library/Developer/Xcode/DerivedData/ModuleCache.noindex/2FKA2K2BK8GI0/ObjectiveC-1KD62J152BYGO.pcm''
in the build on another agent the following error:
❌ fatal error: module file '~/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/2FKA2K2BK8GI0/Foundation-A3SOD99KJ0S9.pcm' is out of date and needs to be rebuilt: signature mismatch
add a trigger on the xcode process to read-write data movement in DerivedData
if the process somehow goes on, then wait and start the process in a minute
also think about isolating build threads to xcode xcode 13.4.1
I took advantage of ruby and sketched out such a script that simply suspends other parallel xcode build processes if the xcodebuild process is already running on the agent.