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

**URL:** https://discourse.cmake.org/t/cmake-ninja-is-using-windows-short-paths-which-causes-ccache-misses/11332
**Category:** Usage
**Tags:** os:windows, gen:ninja
**Created:** [July 26, 2024, 3:53pm UTC](https://discourse.cmake.org/t/cmake-ninja-is-using-windows-short-paths-which-causes-ccache-misses/11332 "2024-07-26T15:53:26Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![pablo.odorico](https://discourse.cmake.org/user_avatar/discourse.cmake.org/pablo.odorico/32/4802_2.png) [@pablo.odorico](https://discourse.cmake.org/u/pablo.odorico)
#### Post date: [July 26, 2024, 3:53pm UTC](https://discourse.cmake.org/t/cmake-ninja-is-using-windows-short-paths-which-causes-ccache-misses/11332/1 "2024-07-26T15:53:27Z")

</div>

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](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/fsutil-8dot3name#syntax) 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

---

<div class="post-metadata">

### Author: ![pablo.odorico](https://discourse.cmake.org/user_avatar/discourse.cmake.org/pablo.odorico/32/4802_2.png) [@pablo.odorico](https://discourse.cmake.org/u/pablo.odorico)
#### Post date: [July 31, 2024, 8:19am UTC](https://discourse.cmake.org/t/cmake-ninja-is-using-windows-short-paths-which-causes-ccache-misses/11332/2 "2024-07-31T08:19:29Z")

</div>

I also [reported the issue to CCache](https://github.com/ccache/ccache/issues/1490) 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`
