Strange errors from SourceKit-LSP in fresh Objective-C project

In a mostly fresh objc project (no settings tweaked, only added a Person class) I get these strange errors at the very top of each .m file:

No such file or directory: '/Users/tanner/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation'

Stat cache file '/Users/tanner/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/iphonesimulator18.2-22C146-ba1d5608dbd73fcc092a45042755c403.sdkstatcache' not found

It looks like this:


These aren't necessarily getting in the way of me doing any work, but they're annoying. Here's my generated buildServer.json if that helps:

{
	"name": "xcode build server",
	"version": "0.2",
	"bspVersion": "2.0",
	"languages": [
		"c",
		"cpp",
		"objective-c",
		"objective-cpp",
		"swift"
	],
	"argv": [
		"/opt/homebrew/bin/xcode-build-server"
	],
	"workspace": "/Users/tanner/Desktop/Objc-LSP-Testing/Objc-LSP-Testing.xcodeproj/project.xcworkspace",
	"build_root": "/Users/tanner/Library/Developer/Xcode/DerivedData/Objc-LSP-Testing-ccgdqdmwqixwuuagkwoccjnfdkht",
	"scheme": "Objc-LSP-Testing",
	"kind": "xcode"
}

What can I do to get rid of these errors?

1 Like

I assume you're not also seeing these in the build itself? IIUC xcode-build-server generates arguments based on the build log, so I'm fairly surprised you'd hit either of these two errors. To have them at all, you must have done a build, and thus I'd expect both files to exist.

@SolaWing have you seen this before?

No. may clean cache in ~/Library/Developer/Xcode/DerivedData, and do a full rebuild fix this problem?

The issue seems to be gone now in my demo project. I can't recall if I cleaned derived data between now and my post, but there is no entry for this project there, so maybe that was it. I might have done a build in Xcode first, but I don't remember now.

Thanks @bnbarham and @SolaWing for looking at this :folded_hands: