[lldb] Add early CMake check for 'make' tool (#111531)
Many LLDB's dotest.py based tests require the `make` tool. If it's not found in Path, they fail with an obscure error and show up as `UNRESOLVED`. On Windows, 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 check for it at configuration time. This error isn't 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.
This commit is contained in:
@@ -268,10 +268,6 @@ def parseOptionsAndInitTestdirs():
|
||||
|
||||
if args.make:
|
||||
configuration.make_path = args.make
|
||||
elif platform_system == "FreeBSD" or platform_system == "NetBSD":
|
||||
configuration.make_path = "gmake"
|
||||
else:
|
||||
configuration.make_path = "make"
|
||||
|
||||
if args.dsymutil:
|
||||
configuration.dsymutil = args.dsymutil
|
||||
|
||||
@@ -49,6 +49,20 @@ set(LLDB_DEFAULT_TEST_EXECUTABLE "${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb${CMAKE_EXEC
|
||||
|
||||
set(LLDB_DEFAULT_TEST_DSYMUTIL "${LLVM_TOOLS_BINARY_DIR}/dsymutil${CMAKE_EXECUTABLE_SUFFIX}")
|
||||
|
||||
if(LLDB_TEST_MAKE)
|
||||
set(LLDB_DEFAULT_TEST_MAKE ${LLDB_TEST_MAKE})
|
||||
else()
|
||||
find_program(LLDB_DEFAULT_TEST_MAKE make gmake)
|
||||
if(LLDB_DEFAULT_TEST_MAKE)
|
||||
message(STATUS "Found make: ${LLDB_DEFAULT_TEST_MAKE}")
|
||||
else()
|
||||
message(STATUS "Not found: make")
|
||||
message(SEND_ERROR
|
||||
"LLDB tests require 'make' tool. Please pass via `LLDB_TEST_MAKE` "
|
||||
"(or otherwise disable tests with `LLDB_INCLUDE_TESTS=OFF`)")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (TARGET clang)
|
||||
set(LLDB_DEFAULT_TEST_COMPILER "${LLVM_TOOLS_BINARY_DIR}/clang${CMAKE_EXECUTABLE_SUFFIX}")
|
||||
else()
|
||||
@@ -58,6 +72,7 @@ endif()
|
||||
set(LLDB_TEST_EXECUTABLE "${LLDB_DEFAULT_TEST_EXECUTABLE}" CACHE PATH "lldb executable used for testing")
|
||||
set(LLDB_TEST_COMPILER "${LLDB_DEFAULT_TEST_COMPILER}" CACHE PATH "C Compiler to use for building LLDB test inferiors")
|
||||
set(LLDB_TEST_DSYMUTIL "${LLDB_DEFAULT_TEST_DSYMUTIL}" CACHE PATH "dsymutil used for generating dSYM bundles")
|
||||
set(LLDB_TEST_MAKE "${LLDB_DEFAULT_TEST_MAKE}" CACHE PATH "make tool used for building test executables")
|
||||
|
||||
if ("${LLDB_TEST_COMPILER}" STREQUAL "")
|
||||
message(FATAL_ERROR "LLDB test compiler not specified. Tests will not run.")
|
||||
|
||||
@@ -250,6 +250,9 @@ if is_configured("test_compiler"):
|
||||
if is_configured("dsymutil"):
|
||||
dotest_cmd += ["--dsymutil", config.dsymutil]
|
||||
|
||||
if is_configured("make"):
|
||||
dotest_cmd += ["--make", config.make]
|
||||
|
||||
if is_configured("llvm_tools_dir"):
|
||||
dotest_cmd += ["--llvm-tools-dir", config.llvm_tools_dir]
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ config.lldb_executable = lit_config.substitute('@LLDB_TEST_EXECUTABLE@')
|
||||
config.test_arch = '@LLDB_TEST_ARCH@'
|
||||
config.test_compiler = lit_config.substitute('@LLDB_TEST_COMPILER@')
|
||||
config.dsymutil = lit_config.substitute('@LLDB_TEST_DSYMUTIL@')
|
||||
config.make = lit_config.substitute('@LLDB_TEST_MAKE@')
|
||||
config.has_libcxx = @LLDB_HAS_LIBCXX@
|
||||
config.libcxx_libs_dir = "@LIBCXX_LIBRARY_DIR@"
|
||||
config.libcxx_include_dir = "@LIBCXX_GENERATED_INCLUDE_DIR@"
|
||||
|
||||
Reference in New Issue
Block a user