diff options
| author | Tomohiro Kashiwada <kikairoya@gmail.com> | 2025-11-04 18:37:58 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-04 11:37:58 +0200 |
| commit | 84cc2b0ebc2b28e0474c9aa46264f4c20adcc959 (patch) | |
| tree | d3da9008d1738cd8c37da6e6dab2a83b33942add /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
| parent | 9ee9fb0d4090ffb3799ddb731394e403dbda2fb3 (diff) | |
| download | llvm-84cc2b0ebc2b28e0474c9aa46264f4c20adcc959.zip llvm-84cc2b0ebc2b28e0474c9aa46264f4c20adcc959.tar.gz llvm-84cc2b0ebc2b28e0474c9aa46264f4c20adcc959.tar.bz2 | |
[LIT] replace `lit.util.mkdir` with `pathlib.Path.mkdir` (#163948)
`lit.util.mkdir` and `lit.util.mkdir_p` were written during the Python
2.x era.
Since modern `pathlib` functions have similar functionality, we can
simply use those instead.
If you encounter a path length issue after this change, the registry
value `LongPathsEnabled` must be set as described in
https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation
. Note that the Python runtime is already marked as a `longPathAware`
executable.
**Background:**
On Cygwin, a file named `file_name.exe` can be accessed without the
suffix, simply as `file_name`, as shown below:
```
$ echo > file_name.exe
$ file file_name.exe
file_name.exe: very short file (no magic)
$ file file_name
file_name: very short file (no magic)
```
In this situation, while running `mkdir file_name` works as intended,
checking for the existence of the target before calling `mkdir`
incorrectly reports that it already exists and thus skips the directory
creation.
```
$ test -e file_name && echo exists
exists
$ mkdir file_name && echo ok
ok
$ file file_name
file_name: directory
```
Therefore, the existence pre-check should be skipped on Cygwin. Instead
of add a workaround, refactored them.
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions
