This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Track test dependencies with add_lldb_test_dependency
ClosedPublic

Authored by JDevlieghere on Oct 7 2019, 5:10 PM.

Details

Summary

I often use ninja lldb-test-deps to build all the test dependencies before running a subset of the tests with lit --filter. This functionality seems to break relatively often because test dependencies are tracked in an ad-hoc way in different cmake files. This patch adds a helper function add_lldb_test_dependency to unify test dependency tracking by adding dependencies to lldb-test-deps.

Diff Detail

Repository
rL LLVM

Event Timeline

JDevlieghere created this revision.Oct 7 2019, 5:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 7 2019, 5:10 PM
Herald added a subscriber: teemperor. · View Herald Transcript
xiaobai accepted this revision.Oct 7 2019, 5:15 PM

Looks good to me. I find it interesting that we had an lldb-test-deps custom target before but most things were depending on ${LLDB_TEST_DEPS} anyway.

This revision is now accepted and ready to land.Oct 7 2019, 5:15 PM

Looks good to me. I find it interesting that we had an lldb-test-deps custom target before but most things were depending on ${LLDB_TEST_DEPS} anyway.

Yep. IIRC the main motivation was Swift's build-script that would build the test dependencies before running a subset of them (the swift tests) for PR testing.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptOct 7 2019, 10:24 PM

On Linux OS (Fedora 30 x86_64) with GIT monorepo:
After rL374000:

#rm -rf *
cmake ~/redhat/llvm-monorepo2/llvm/ -DCMAKE_BUILD_TYPE=Release  -DLLVM_USE_LINKER=gold -DLLVM_ENABLE_PROJECTS="lldb;clang;lld"  -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLLVM_ENABLE_ASSERTIONS=ON
make check-lldb
...
llvm-lit: /home/jkratoch/redhat/llvm-monorepo2/llvm/utils/lit/lit/llvm/subst.py:134: fatal: Did not find count in /home/jkratoch/redhat/llvm-monorepo2-clangassert/./bin

After rL373996 (this patch):

llvm-lit: llvm-monorepo2/llvm/utils/lit/lit/llvm/subst.py:127: note: Did not find obj2yaml in llvm-monorepo2-clangassert/./bin:llvm-monorepo2-clangassert/./bin
llvm-lit: llvm-monorepo2/llvm/utils/lit/lit/llvm/subst.py:127: note: Did not find llvm-pdbutil in llvm-monorepo2-clangassert/./bin:llvm-monorepo2-clangassert/./bin
llvm-lit: llvm-monorepo2/llvm/utils/lit/lit/llvm/subst.py:127: note: Did not find llvm-mc in llvm-monorepo2-clangassert/./bin:llvm-monorepo2-clangassert/./bin
llvm-lit: llvm-monorepo2/llvm/utils/lit/lit/llvm/subst.py:127: note: Did not find llvm-readobj in llvm-monorepo2-clangassert/./bin:llvm-monorepo2-clangassert/./bin
llvm-lit: llvm-monorepo2/llvm/utils/lit/lit/llvm/subst.py:127: note: Did not find llvm-objdump in llvm-monorepo2-clangassert/./bin:llvm-monorepo2-clangassert/./bin
llvm-lit: llvm-monorepo2/llvm/utils/lit/lit/llvm/subst.py:127: note: Did not find llvm-objcopy in llvm-monorepo2-clangassert/./bin:llvm-monorepo2-clangassert/./bin
llvm-lit: llvm-monorepo2/llvm/utils/lit/lit/llvm/subst.py:127: note: Did not find lli in llvm-monorepo2-clangassert/./bin:llvm-monorepo2-clangassert/./bin
llvm-lit: llvm-monorepo2/llvm/utils/lit/lit/llvm/config.py:169: fatal: Could not run process ['llvm-monorepo2-clangassert/./bin/llvm-config', '--assertion-mode', '--build-mode', '--targets-built']

Surprisingly a Fedora buildbot does not have this problem.