[Lldb-commits] [lldb] [lldb][test] Rename session logs through their extended-length path (PR #226976)

Charles Zablit via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 28 05:59:49 PDT 2026


https://github.com/charles-zablit created https://github.com/llvm/llvm-project/pull/226976

On Windows, renaming `Incomplete.log` to `<Prefix>_<test-name>.log` makes the destination longer than the source, so it can cross `MAX_PATH` where the source did not. `os.rename` then fails with `WinError 3` on a file that exists, and a test that behaved correctly is reported as unresolved:

```
FileNotFoundError: [WinError 3] The system cannot find the path specified:
   '...\Incomplete.log' -> '...\ExpectedFailure_test_implementation_only_import_main_executable_resilient_no_library_module_dwarf_clang_swift.log'
```

Address the destination through `lldbutil.get_extended_windows_path`, including the existence check and removal above it.

>From 41854fed24bf844eee54fdaadbcf6af46ed4e60a Mon Sep 17 00:00:00 2001
From: Charles Zablit <c_zablit at apple.com>
Date: Mon, 28 Sep 2026 13:57:31 +0100
Subject: [PATCH] [lldb][test] Rename session logs through their
 extended-length path

---
 lldb/packages/Python/lldbsuite/test/lldbtest.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index 1f4329147252e..0c577d1aea73f 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -1438,17 +1438,18 @@ def dumpSessionInfo(self):
             for src in self.log_files:
                 if os.path.isfile(src):
                     dst = src.replace(src_log_basename, dst_log_basename)
-                    if os.name == "nt" and os.path.isfile(dst):
+                    long_dst = lldbutil.get_extended_windows_path(dst)
+                    if os.name == "nt" and os.path.isfile(long_dst):
                         # On Windows, renaming a -> b will throw an exception if
                         # b exists.  On non-Windows platforms it silently
                         # replaces the destination.  Ultimately this means that
                         # atomic renames are not guaranteed to be possible on
                         # Windows, but we need this to work anyway, so just
                         # remove the destination first if it already exists.
-                        remove_file(dst)
+                        remove_file(long_dst)
 
                     lldbutil.mkdir_p(os.path.dirname(dst))
-                    os.rename(src, dst)
+                    os.rename(lldbutil.get_extended_windows_path(src), long_dst)
                     files.append(dst)
             if files:
                 print(



More information about the lldb-commits mailing list