Make it possible for lit.site.cfg to contain relative paths, and use it for llvm and clang
Currently, all generated lit.site.cfg files contain absolute paths.
This makes it impossible to build on one machine, and then transfer the
build output to another machine for test execution. Being able to do
this is useful for several use cases:
- When running tests on an ARM machine, it would be possible to build on a fast x86 machine and then copy build artifacts over after building.
- It allows running several test suites (clang, llvm, lld) on 3 different machines, reducing test time from sum(each test suite time) to max(each test suite time).
This patch makes it possible to pass a list of variables that should be
relative in the generated lit.site.cfg.py file to
configure_lit_site_cfg(). The lit.site.cfg.py.in file needs to call
path() on these variables, so that the paths are converted to absolute
form at lit start time.
The testers would have to have an LLVM checkout at the same revision,
and the build dir would have to be at the same relative path as on the
This does not yet cover how to figure out which files to copy from the
builder machine to the tester machines. (One idea is to look at the
--graphviz=test.dot output and copy all inputs of the check-llvm
Differential Revision: https://reviews.llvm.org/D77184