[PATCH] D154599: [lld] respect LLVM_EXTERNAL_LIT

Konrad Wilhelm Kleine via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 6 05:12:14 PDT 2023


kwk created this revision.
kwk added a reviewer: tstellar.
Herald added a project: All.
kwk requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Consider a setup without a system-wide installation of lit.
Instead you pass the path to lit like this:

  cmake ...
  -DLLVM_EXTERNAL_LIT=<PATH_TO_LIT_BINARY> ...

Then you will run into this error:

  ninja: error: unknown target 'check-lld'

I have a buildbot builder that fails with this message. Here's the
passage that triggers this error:

https://github.com/llvm/llvm-zorg/blob/d3bfd5ccbceb542098c350e4d071ceceac6854cb/zorg/buildbot/builders/annotated/standalone-build.sh#L194-L239

By using `LLVM_EXTERNAL_LIT` instead of `LLVM_LIT` we fix this problem.

See
here <https://llvm.org/docs/GettingStarted.html#stand-alone-builds> for
a description:

> Both the LLVM_ROOT and LLVM_EXTERNAL_LIT options are required to do stand-alone builds for all sub-projects. Additional required options for each sub-project can be found in the table below.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D154599

Files:
  lld/CMakeLists.txt


Index: lld/CMakeLists.txt
===================================================================
--- lld/CMakeLists.txt
+++ lld/CMakeLists.txt
@@ -61,7 +61,7 @@
 
     if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
       # Note: path not really used, except for checking if lit was found
-      set(LLVM_LIT ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
+      set(LLVM_EXTERNAL_LIT ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
       if(NOT LLVM_UTILS_PROVIDED)
         add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/FileCheck utils/FileCheck)
         add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/not utils/not)
@@ -74,13 +74,13 @@
       endif()
     else()
       # Seek installed Lit.
-      find_program(LLVM_LIT
+      find_program(LLVM_EXTERNAL_LIT
                    NAMES llvm-lit lit.py lit
                    PATHS "${LLVM_MAIN_SRC_DIR}/utils/lit"
                    DOC "Path to lit.py")
     endif()
 
-    if(LLVM_LIT)
+    if(LLVM_EXTERNAL_LIT)
       # Define the default arguments to use with 'lit', and an option for the user
       # to override.
       set(LIT_ARGS_DEFAULT "-sv")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154599.537670.patch
Type: text/x-patch
Size: 1089 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230706/7c756f60/attachment.bin>


More information about the llvm-commits mailing list