CMake + Ninja is using Windows short paths which causes CCache misses

Hello,
Is there a way I can prevent CMake from using Windows “8.3” short paths when invoking cl.exe?
For example: C:\\PROGRA~2\\MIB055~1\\2022\\BUILDT~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe

I’m trying to deploy CCache with HTTP secondary storage and because these abbreviated paths are not the same on all systems I’m seeing many cache misses.

I know fsutil 8dot3name can be used to disable and remove 8.3 paths, but that involves some risks due to registry references.

I’m using CMake 3.25.1, Ninja 1.12.0, CCache 4.10.2 and latest VS2022.

Thanks,
Pablo

I also reported the issue to CCache and mentioned a possible workaround, which is to proactively change the short names on all builders to something like MICROS~9 : fsutil file setshortname "c:\Program Files (x86)\Microsoft Visual Studio" MICROS~9