[Lldb-commits] [lldb] [lldb] Add early CMake check for 'make' tool (PR #111531)

Stefan Gränitz via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 8 06:57:38 PDT 2024


https://github.com/weliveindetail created https://github.com/llvm/llvm-project/pull/111531

Around 400 of LLDB's dotest.py based tests require the `make` tool to be found in Path. If it's not found, they fail with an obscure error and show up as `UNRESOLVED`. llvm-lit takes care of MSYS based testing tools like cat, printf, etc., but make is not part of that. Let's catch the situation early and raise an error if LLDB_ENFORCE_STRICT_TEST_REQUIREMENTS was enabled. This error is not fatal: It should fail the build, but not immediately stop the configuration process. There might be other issues further down the line that can be caught in the same buildbot run.

>From c7356d3c265869ff387c977dd18e9c617dc31c8d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Gr=C3=A4nitz?= <stefan.graenitz at gmail.com>
Date: Tue, 8 Oct 2024 15:40:37 +0200
Subject: [PATCH] [lldb] Add early CMake check for 'make' tool

Around 400 of LLDB's dotest.py based tests require the make tool to be found in Path. If it's not found, they fail with an obscure error and show up as UNRESOLVED.
llvm-lit takes care of MSYS based testing tools like cat, printf, etc., but make is not part of that. Let's catch the situation early and raise an error if LLDB_ENFORCE_STRICT_TEST_REQUIREMENTS was enabled.
This error is not fatal: It should fail the build, but not immediately stop the configuration process. There might be other issues further down the line that can be caught in the same buildbot run.
---
 lldb/test/CMakeLists.txt | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/lldb/test/CMakeLists.txt b/lldb/test/CMakeLists.txt
index 5ac474736eb63d..7993be2602e538 100644
--- a/lldb/test/CMakeLists.txt
+++ b/lldb/test/CMakeLists.txt
@@ -29,6 +29,18 @@ if(LLDB_ENFORCE_STRICT_TEST_REQUIREMENTS)
         "`LLDB_ENFORCE_STRICT_TEST_REQUIREMENTS=OFF`")
     endif()
   endforeach()
+
+  # On Windows make is not part of the MSYS tools that llvm-lit takes care of
+  find_program(MAKE_TOOL make)
+  if(MAKE_TOOL)
+    message(STATUS "Found make: ${MAKE_TOOL}")
+  else()
+    message(STATUS "Not found: make")
+    message(SEND_ERROR
+          "LLDB tests require 'make' tool. Please install and add it to Path "
+          "(or otherwise disable strict testing requirements with "
+          "`LLDB_ENFORCE_STRICT_TEST_REQUIREMENTS=OFF`)")
+  endif()
 endif()
 
 if(LLDB_BUILT_STANDALONE)



More information about the lldb-commits mailing list