[PATCH] D37917: Resubmit "[lit] Force site configs to be run before source tree configs"

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 15 12:12:30 PDT 2017


zturner created this revision.
Herald added a subscriber: mgorny.
Herald added a reviewer: modocache.
Herald added a reviewer: bollu.

Despite a couple of targeted fixes that went through, there were still problems in some standalone build configurations.  This turned out to be rather tricky, but can be explained simply:

**Before:** the check targets would run `lit.py` from the source tree
**After:** the check targets would run `llvm-lit.py` from the build tree

The interim fixes that were applied only made it try to run the `llvm-lit.py` from the *clang* build tree, which since this is a standalone environment is not going to be correct.  We emit a bunch of source -> build tree mappings into the `llvm-lit.py` for example, and these would be all wrong if we use the wrong `llvm-lit.py`.  Bottom line is that `llvm-lit.py` is tied to a particular build tree, and if you're going to run tests, it needs to be there.

The fix I've done here is to actually do that.  We already have `${LLVM_MAIN_SRC_DIR}` as a result of running `llvm-config`, so I can add an out-of-tree subdirectory to reach in and grab `llvm/utils/llvm-lit`.  This causes it to run the lit configure step and generate `llvm-lit.py` into `<compiler-rt-build-dir>/bin`.

After this, everything works.

I'm submitting this as two separate patches.  The first is the original patch which is broken.  The second is the full diff including new changes to fix.  This way you can diff v1 and v2 and see only the new stuff.


https://reviews.llvm.org/D37917

Files:
  clang-tools-extra/test/Unit/lit.cfg
  clang-tools-extra/test/lit.cfg
  clang/runtime/CMakeLists.txt
  clang/test/Unit/lit.cfg
  clang/test/lit.cfg
  compiler-rt/test/lit.common.cfg
  compiler-rt/test/profile/lit.cfg
  compiler-rt/unittests/lit.common.unit.cfg
  lld/test/Unit/lit.cfg
  lld/test/Unit/lit.site.cfg.in
  lld/test/lit.cfg
  lldb/lit/Unit/lit.cfg
  lldb/lit/lit.cfg
  llvm/CMakeLists.txt
  llvm/cmake/modules/AddLLVM.cmake
  llvm/test/Unit/lit.cfg
  llvm/test/lit.cfg
  llvm/utils/lit/lit/discovery.py
  llvm/utils/lit/tests/lit.cfg
  llvm/utils/llvm-lit/CMakeLists.txt
  llvm/utils/llvm-lit/llvm-lit.in
  polly/test/Unit/lit.cfg
  polly/test/lit.cfg

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37917.115448.patch
Type: text/x-patch
Size: 65850 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170915/bb0336c9/attachment.bin>


More information about the llvm-commits mailing list