Page MenuHomePhabricator

Introduce LIBUNWIND_LIT_ARGS, LIBCXXABI_LIT_ARGS and LIBCXX_LIT_AGRS
AbandonedPublic

Authored by broadwaylamb on Mar 19 2020, 8:01 AM.

Details

Reviewers
ldionne
phosek
jroelofs
mclow.lists
EricWF
Group Reviewers
Restricted Project
Restricted Project
Restricted Project
Summary

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 and 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.)

Diff Detail

Event Timeline

broadwaylamb created this revision.Mar 19 2020, 8:01 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMar 19 2020, 8:01 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Herald added a reviewer: Restricted Project. · View Herald Transcript
broadwaylamb edited the summary of this revision. (Show Details)Mar 19 2020, 8:03 AM
ldionne requested changes to this revision.Mar 20 2020, 7:47 AM

I personally think we should move away from tying CMake and lit together by funneling lit arguments through it. Instead, it would be better to store special lit.cfg files in libcxx/ for use by bots. But we're not quite there yet, and this patch has the effect of decoupling libcxx/libcxxabi/libunwind from LLVM global variables, so I'm sort-of OK with it. I'd like to move towards a future where we don't need to process the CMake files in llvm/* to build the runtimes.

libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake
127

Why isn't that in libcxx/CMakeLists.txt?

This revision now requires changes to proceed.Mar 20 2020, 7:47 AM
broadwaylamb marked an inline comment as done.Mar 20 2020, 9:19 AM
broadwaylamb added inline comments.
libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake
127

We were setting LLVM_LIT_ARGS here, so I figured that LIBCXX_LIT_ARGS should also be set here.

Why do we need separate options for each project?
I think that's the wrong direction.

@EricWF could you elaborate? What would be the right direction?

broadwaylamb abandoned this revision.Apr 5 2020, 1:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 5 2020, 1:10 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript