[Lldb-commits] [lldb] [lldb/test] Fix libcxx configuration handling for remote platforms (PR #172761)

via lldb-commits lldb-commits at lists.llvm.org
Wed Dec 17 15:47:17 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Med Ismail Bennani (medismailben)

<details>
<summary>Changes</summary>

When using --platform remote-* options, explicitly clear the libcxx configuration variables instead of just warning and continuing with potentially set values. This prevents the test suite from attempting to use custom libcxx paths on remote platforms where they're not applicable.

Also initialize libcxx variables to None when not specified, ensuring a clean state regardless of how the arguments are parsed.

---
Full diff: https://github.com/llvm/llvm-project/pull/172761.diff


1 Files Affected:

- (modified) lldb/packages/Python/lldbsuite/test/dotest.py (+11-1) 


``````````diff
diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py
index f280bd2b3887b..fcd60a1bc0db8 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest.py
@@ -290,15 +290,25 @@ def parseOptionsAndInitTestdirs():
             logging.warning(
                 "Custom libc++ is not supported for remote runs: ignoring --libcxx arguments"
             )
+            # Don't set libcxx paths for remote platforms - use SDK's libc++ instead
+            configuration.libcxx_include_dir = None
+            configuration.libcxx_include_target_dir = None
+            configuration.libcxx_library_dir = None
         elif not (args.libcxx_include_dir and args.libcxx_library_dir):
             logging.error(
                 "Custom libc++ requires both --libcxx-include-dir and --libcxx-library-dir"
             )
             sys.exit(-1)
         else:
+            # Use custom libcxx for local runs
             configuration.libcxx_include_dir = args.libcxx_include_dir
             configuration.libcxx_include_target_dir = args.libcxx_include_target_dir
             configuration.libcxx_library_dir = args.libcxx_library_dir
+    else:
+        # No custom libcxx specified
+        configuration.libcxx_include_dir = None
+        configuration.libcxx_include_target_dir = None
+        configuration.libcxx_library_dir = None
 
     configuration.cmake_build_type = args.cmake_build_type.lower()
 
@@ -312,7 +322,7 @@ def parseOptionsAndInitTestdirs():
         lldbtest_config.out_of_tree_debugserver = args.out_of_tree_debugserver
 
     # Set SDKROOT if we are using an Apple SDK
-    if args.sysroot is not None:
+    if args.sysroot:
         configuration.sdkroot = args.sysroot
     elif platform_system == "Darwin" and args.apple_sdk:
         configuration.sdkroot = seven.get_command_output(

``````````

</details>


https://github.com/llvm/llvm-project/pull/172761


More information about the lldb-commits mailing list