[clang] [llvm] [clang][deps] Overload `Filesystem::exists` in `DependencyScanningFilesystem` to have it use cached `status` (PR #88152)

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 11 09:06:31 PDT 2024


jansvoboda11 wrote:

@aganea Ah, got it. Unfortunately, caching stat failures for all directories doesn't work for modules. Clang is supposed to create the modules cache directory if one doesn't exist. But if we first cache its non-existence, Clang will never see it again, even after Clang itself created it.

I think we could turn off caching of stat failures only for the modules cache directory by giving the build system an API to configure `DependencyScanningService` with the modules cache directory, wire up all `DependencyScanningWorkerFilesystem` to only avoid caching stat failures for that path, and have all `DependencyScanningWorker` overwrite the `-fmodules-cache-path=<path>` arguments with the configured path.

In the meantime, are you able to work around this for your non-modular use-case by applying your change when building your own compiler downstream?

Also, just to be sure, this is not a regression, correct?

https://github.com/llvm/llvm-project/pull/88152


More information about the cfe-commits mailing list