Meanwhile in 2025: Microsoft's C++ compiler cannot handle long paths.

@vitaut This is one of those catch-22 things where that everyone needs to fix it to have a working experience disincentivizes anyone from fixing it.

There have been attempts but they run into some other part of the system that doesn't work which makes the churn to touch it not worth doing.

@malwareminigun Do you know if [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem]
"LongPathsEnabled"=dword:00000001 helps with cl?
@vitaut as far as I know, no.
@vitaut To expand on that now that I'm at my desk: as far as I know there was an attempt to make this work in vcpkg with a copy of ninja patched to accept longer paths and it failed because that just blew up in other parts of the toolchain.

@vitaut @malwareminigun you'd also need to inject a new manifest into cl.exe that enables long paths. But even if that does work (and that's a big if) cl is not a fully self-contained exe. It can call out to many other tools which would also need to be fixed.

If you did patch all relevant binaries with the manifest then chances are that at least one of those will be assuming MAX_PATH and break on longer paths. But feel free to try :)

@vitaut despite windows PATH_MAX equivalent being the absolute pathmaxxingest platform out there … 64KiB ought to be enough for anyone

@vitaut also fun is using a case-sensitive filesystem, although that's perhaps more a general VS tooling issue rather than cl specifically.

It does like to randomly uppercase or lowercase paths (in whole or in part) and it's not even self-consistent when doing that so it's not possible to workaround without duplicating file names using every variation of casing.