I've been using XCode for development in C++ for several years. Suddenly, today it started having the following problem: Any time I try to compile my code, (even if I just finished successfully compiling it), it spends several minutes running CLangStatCache. This is according to the result of "Perform Action... Build with Timing Summary". Furthermore, if I first delete the ".../DerivedData/SDKStatCaches.noindex" folder, the problem goes away and it compiles immediately. However, it creates a new folder with a 32 Mb file in it, and then has the same problem the next time unless I delete that folder again. I do not want to have to delete this file every time I compile my code. Is there some way to turn this off? What happened that is different today from any other day in the last several years? I did just download and install the latest System software update, including XCode... Did that break something?
How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here
XCode suddenly spending minutes running CLangStatCache
Thank you for sharing your experience. To assist you further, could you please provide the specific versions of macOS and Xcode that you upgraded your system to?
Given that the issue has only arisen since the upgrade, it is possible that there is a bug in the new Xcode version or macOS. If this is the case, we would appreciate it if you could file a bug report for our attention.
In addition to the Xcode versions, please include the previous version where the issue did not occur and the macOS version that you are currently using. A concise and focused project description will be beneficial in our investigation.
That'll help us better understand what's going on. If you're not familiar with preparing a test project, take a look at Creating a test project.
Once you open the bug report, please post the FB number here for my reference.
If you have any questions about filing a bug report, take a look at Bug Reporting: How and Why?
Albert Pascual Worldwide Developer Relations.