[Lldb-commits] [lldb] [lldb] add a warning if `dirname` is not in the PATH (PR #164494)

Charles Zablit via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 21 13:54:06 PDT 2025


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

This patch adds a check in lldb's API test CMakeLists file to ensure that `dirname` is in the PATH, which is not obvious on Windows.

>From 13cdc22b45790ff7a780575df3e17debb2af70e0 Mon Sep 17 00:00:00 2001
From: Charles Zablit <c_zablit at apple.com>
Date: Tue, 21 Oct 2025 13:51:59 -0700
Subject: [PATCH] [lldb] add a warning if `dirname` is not in the PATH

---
 lldb/test/API/CMakeLists.txt | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lldb/test/API/CMakeLists.txt b/lldb/test/API/CMakeLists.txt
index b1ace6296f46a..df2648d3c3518 100644
--- a/lldb/test/API/CMakeLists.txt
+++ b/lldb/test/API/CMakeLists.txt
@@ -74,6 +74,15 @@ else()
   endif()
 endif()
 
+find_program(LLDB_DIRNAME_PATH dirname)
+if(LLDB_DIRNAME_PATH)
+  message(STATUS "Found dirname: ${LLDB_DIRNAME_PATH}")
+else()
+  message(STATUS "Did not find 'dirname'.")
+  message(WARNING
+        "Many LLDB API tests require the 'dirname' tool. Please provide it in Path.")
+endif()
+
 if (TARGET clang)
   set(LLDB_DEFAULT_TEST_COMPILER "${LLVM_TOOLS_BINARY_DIR}/clang${CMAKE_EXECUTABLE_SUFFIX}")
 else()



More information about the lldb-commits mailing list