[PATCH] D154130: [lit][clang] Avoid realpath on Windows due to MAX_PATH limitations

Douglas Yung via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 18 12:53:32 PDT 2023


dyung added a comment.

Sorry to comment so late, but I just had time to look into this a little bit. This change broke running lit tests for me on Windows, and I wanted to see if there was a way I could restore it.

For reference, my sources are stored locally at `C:\Dev\git\dev`, but I until this change, I was able to access them through a file system junction point at `C:\src\git\dev` and run lit tests using that. But after this change, I can no longer run the lit tests when I am in `C:\src\git\dev`. My system is setup this way because we have weird A/V scanning rules that only exclude certain named directories, and my original path wasn't one of them, so I used the file system junction point to get my builds excluded while continuing to use the path structure that was familiar to me and that I also use on other systems (mac/linux).

Since this change seems to be targeted towards preventing resolving paths that are greater than `MAX_PATH` on Windows, could we possibly leave the substitution in, but check if the resulting path is longer than MAX_PATH rather than just excluding it completely?

Specifically, where I am seeing the difference is in the new function `abs_path_preserve_drive()` in util.py where we are now using `os.path.abspath()` instead of `os.path.realpath()`. I'm not completely sure what the effects of such a change might be to the rest of this change, but keeping the old conversion and then checking against `MAX_PATH` it seems would still accomplish your goal while allowing cases like mine to continue working as they previously did.

Thoughts?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154130/new/

https://reviews.llvm.org/D154130



More information about the cfe-commits mailing list