[Lldb-commits] [lldb] [lldb/test] Downgrade missing-libcxx check from error to warning (PR #199262)

via lldb-commits lldb-commits at lists.llvm.org
Fri May 22 12:36:28 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Med Ismail Bennani (medismailben)

<details>
<summary>Changes</summary>

The cmake check that fails when `LLDB_HAS_LIBCXX` is `OFF` is too strict: the test infrastructure already handles the missing-libcxx case gracefully. `lit.cfg.py` only adds `--libcxx-include-dir` / `--libcxx-library-dir` to the `dotest` command when `config.has_libcxx` is true; otherwise `dotest` falls back to whatever libc++ the compiler picks up by default (system libc++ on Darwin).

Dotest also has a category-based skip path: `checkLibcxxSupport()` appends "libc++" to `configuration.skip_categories` when libc++ isn't available and the user hasn't explicitly asked for it, so the `@<!-- -->add_test_categories(["libc++"])` tests are filtered out automatically. On Darwin `canRunLibcxxTests()` always returns `True` (SDK libc++ is present), so libc++ tests still run there — against the SDK's libc++.

Hard-failing the cmake configure means downstreams that intentionally opt out of building libc++ in-tree can't keep `LLDB_INCLUDE_TESTS=ON` to get the `ninja check-lldb-*` targets for the tests they do want to run (Shell tests, non-libc++ API tests, cloud-device tests, etc.).

Downgrade `SEND_ERROR` to `WARNING` and rephrase the message so it reflects the actual fallback behavior instead of demanding the user either enable libcxx or disable tests outright.

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


1 Files Affected:

- (modified) lldb/test/CMakeLists.txt (+9-6) 


``````````diff
diff --git a/lldb/test/CMakeLists.txt b/lldb/test/CMakeLists.txt
index ed9dcd11cc6cd..fdfa1fa83efef 100644
--- a/lldb/test/CMakeLists.txt
+++ b/lldb/test/CMakeLists.txt
@@ -205,13 +205,16 @@ if(TARGET clang)
             "LLDB_TEST_LIBCXX_ROOT_DIR to it.")
       endif()
     else()
-      # We require libcxx for the test suite, so if we aren't building it,
-      # provide a helpful error about how to resolve the situation.
+      # The LLDB test suite uses libc++ for many tests. If it isn't being
+      # built in-tree, warn and let the suite fall back to whatever libc++
+      # the compiler picks up by default (the system one on Darwin); the
+      # libc++-specific tests will be skipped or run against system libc++.
       if(NOT LLDB_HAS_LIBCXX)
-        message(SEND_ERROR
-          "LLDB test suite requires libc++, but it is currently disabled. "
-          "Please add `libcxx` to `LLVM_ENABLE_RUNTIMES` or disable tests via "
-          "`LLDB_INCLUDE_TESTS=OFF`.")
+        message(WARNING
+          "LLDB test suite normally uses an in-tree libc++; it is currently "
+          "disabled. libc++-specific tests will be skipped or fall back to the "
+          "system libc++. Add `libcxx` to `LLVM_ENABLE_RUNTIMES` to enable "
+          "the full test surface.")
       endif()
     endif()
   endif()

``````````

</details>


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


More information about the lldb-commits mailing list