[libcxx-commits] [PATCH] D76431: Introduce LIBUNWIND_LIT_ARGS, LIBCXXABI_LIT_ARGS and LIBCXX_LIT_AGRS

Sergej Jaskiewicz via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Mar 19 08:05:02 PDT 2020


broadwaylamb created this revision.
broadwaylamb added reviewers: ldionne, phosek, jroelofs, mclow.lists, EricWF.
Herald added subscribers: libcxx-commits, danielkiss, dexonsmith, kristof.beyls, mgorny.
Herald added projects: libc++, libc++abi.
Herald added a reviewer: libc++.
Herald added a reviewer: libc++abi.
broadwaylamb edited the summary of this revision.

Right now the LIT args that are used for running libunwind, libc++abi and libc++ tests are taken from the `LLVM_LIT_ARGS` variable. Furthermore, //every// test target in the LLVM project, be it LLVM, clang, lld or libc++, use that variable for running LIT.

This is suboptimal if we're building such projects simultaneously as one toolchain: for example, if we're leveraging the `llvm/runtimes` directory for building a toolchain in one go (like we do in builders llvm-clang-win-x-armv7l <http://lab.llvm.org:8011/builders/llvm-clang-win-x-armv7l> and llvm-clang-win-x-aarch64 <http://lab.llvm.org:8011/builders/llvm-clang-win-x-aarch64>) we can't tell the clang LIT target to run 8 parallel jobs and the libc++ LIT target to run 64 parallel jobs.

This patch introduces three new CMake variables: `LIBUNWIND_LIT_ARGS`, `LIBCXXABI_LIT_ARGS` and `LIBCXX_LIT_AGRS`. If they are defined, we use them to configure LIT targets and don't look at `LLVM_LIT_ARGS`. If they are not defined, we fall back to `LLVM_LIT_ARGS`.

(I wonder if setting a global variable is a good solution, but I've looked at the `llvm/cmake/modules/AddLLVM.cmake` file, where the `add_lit_target` function is defined, and it doesn't seem easy to change the behavior to pass the string containing LIT args as an argument to the `add_lit_target` function. Mainly because some downstream projects (at least Swift) depend on that function.)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D76431

Files:
  libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake
  libcxxabi/cmake/Modules/HandleOutOfTreeLLVM.cmake
  libunwind/CMakeLists.txt


Index: libunwind/CMakeLists.txt
===================================================================
--- libunwind/CMakeLists.txt
+++ libunwind/CMakeLists.txt
@@ -102,7 +102,13 @@
     if (MSVC OR XCODE)
       set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
     endif()
-    set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "Default options for lit")
+
+    if (DEFINED LIBUNWIND_LIT_ARGS)
+      # libunwind-specific LIT args always win over generic LIT args
+      set(LLVM_LIT_ARGS "${LIBUNWIND_LIT_ARGS}")
+    endif()
+    set(LIBUNWIND_LIT_ARGS "${LIT_ARGS_DEFAULT}"   CACHE STRING "libunwind-specific options for lit")
+    set(LLVM_LIT_ARGS      "${LIBUNWIND_LIT_ARGS}" CACHE STRING "Default options for lit")
 
     # On Win32 hosts, provide an option to specify the path to the GnuWin32 tools.
     if (WIN32 AND NOT CYGWIN)
Index: libcxxabi/cmake/Modules/HandleOutOfTreeLLVM.cmake
===================================================================
--- libcxxabi/cmake/Modules/HandleOutOfTreeLLVM.cmake
+++ libcxxabi/cmake/Modules/HandleOutOfTreeLLVM.cmake
@@ -124,7 +124,13 @@
     if (MSVC OR XCODE)
       set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
     endif()
-    set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "Default options for lit")
+    
+    if (DEFINED LIBCXXABI_LIT_ARGS)
+      # libc++abi-specific LIT args always win over generic LIT args
+      set(LLVM_LIT_ARGS "${LIBCXXABI_LIT_ARGS}")
+    endif()
+    set(LIBCXXABI_LIT_ARGS "${LIT_ARGS_DEFAULT}"   CACHE STRING "libc++abi-specific options for lit")
+    set(LLVM_LIT_ARGS      "${LIBCXXABI_LIT_ARGS}" CACHE STRING "Default options for lit")
   endif()
 
   # Required doc configuration
Index: libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake
===================================================================
--- libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake
+++ libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake
@@ -124,7 +124,12 @@
     if (MSVC OR XCODE)
       set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
     endif()
-    set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "Default options for lit")
+    if (DEFINED LIBCXX_LIT_ARGS)
+      # libc++-specific LIT args always win over generic LIT args
+      set(LLVM_LIT_ARGS "${LIBCXX_LIT_ARGS}")
+    endif()
+    set(LIBCXX_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "libc++-specific options for lit")
+    set(LLVM_LIT_ARGS   "${LIBCXX_LIT_ARGS}"  CACHE STRING "Default options for lit")
   endif()
 
   # Required doc configuration


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76431.251381.patch
Type: text/x-patch
Size: 2539 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20200319/5a0a866d/attachment-0001.bin>


More information about the libcxx-commits mailing list