[PATCH] D62022: [lit] Improve globbing in Windows with long paths

Daniel Rodríguez Troitiño via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 16 11:40:31 PDT 2019


drodriguez created this revision.
drodriguez added reviewers: compnerd, zturner.
Herald added subscribers: llvm-commits, delcypher.
Herald added a project: LLVM.

In many Windows API, the maximum path is limited to 260 characters.
However, the same APIs allow up to around 32K characters if using a
special prefix (`\\?\`) and unicode paths.

The modifications in this commit allows globbing to return results that
will be considered long paths in Windows (the glob pattern doesn't need
to be a long path itself). Sadly, the trick will only work in 2.7.16 and
above because of a bug in Python os.listdir when used in Windows. In
that case, the behaviour should be the same as before.

Includes tests for the new behaviour (which should be no problem in
Linux, but should had failed in Windows before applying this patch).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D62022

Files:
  llvm/utils/lit/lit/ShCommands.py
  llvm/utils/lit/tests/unit/GlobItem.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62022.199871.patch
Type: text/x-patch
Size: 4229 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190516/7dc69832/attachment-0001.bin>


More information about the llvm-commits mailing list