aboutsummaryrefslogtreecommitdiff
path: root/helpers/llvm-prepare
diff options
context:
space:
mode:
authorDiana Picus <diana.picus@linaro.org>2016-05-23 19:32:46 +0300
committerDiana Picus <diana.picus@linaro.org>2016-06-15 12:27:43 +0300
commit72189fd702d00d45714f98857a88159097933b5c (patch)
tree285a34a287a234fcc1e558febb0f036e0aa112ba /helpers/llvm-prepare
parent488ec270d3bb2e34837ccf25431d73b5c5d68dc3 (diff)
Use git worktree in the LLVM helper scripts
This commit adds a new script, llvm-env, which sets up the environment for working with LLVM. It looks for an environment variable LLVM_ROOT and tries to create the following hierarchy: $LLVM_ROOT `- repos | `- llvm | `- clang | `- compiler-rt | [...] `- <branch1> | `- llvm | `- build | `- debug `- <branch2> | `- llvm | `- build | `- debug [...] The $LLVM_ROOT/repos directory contains all the repositories, as checked out by llvm-prepare, and will always track master. For other branches, llvm-env <branch_name> will create a new directory, $LLVM_ROOT/<branch_name>, and will add an llvm worktree directory there. If -d is passed, it will also create a debug directory there, otherwise it will create a build directory. Notice that these 2 can live in parallel, and we can switch between them at any time by invoking llvm-env. It will set LLVM_SRC and LLVM_BLD accordingly, and also modify the path to point to the binaries in LLVM_BLD. The other scripts will now work with the LLVM_SRC and LLVM_BLD set by llvm-env in the current shell. Because llvm-env controls whether or not we're doing a debug build, llvm-build will no longer take a -d flag (it will instead look after a LLVM_DEBUG environment variable, also set by llvm-env). There are changes in llvm-projs, too, because now it no longer creates links - instead it creates worktree directories in the corresponding $LLVM_ROOT/<branch>/llvm. Other scripts have also been updated accordingly. To make things easier, here are some of the changes that I had to make that are not particularly important for the review (pretty mechanical stuff): * Moved function has() from llvm-branch to llvm-common, so I could reuse it * Because of this, I had to rename the has() function in llvm-projs to has_link(), which is actually a better name for it anyway * Disable the checks for LLVM_SRC and LLVM_BLD in llvm-common Change-Id: I9e02f6d8e0c803e79838845013b81331dffba99c
Diffstat (limited to 'helpers/llvm-prepare')
-rwxr-xr-xhelpers/llvm-prepare28
1 files changed, 14 insertions, 14 deletions
diff --git a/helpers/llvm-prepare b/helpers/llvm-prepare
index 46a1780..d9f8a2a 100755
--- a/helpers/llvm-prepare
+++ b/helpers/llvm-prepare
@@ -34,43 +34,43 @@ else
svnroot=https://$LLVM_SVNUSER@llvm.org/svn/llvm-project
fi
+llvm_repos=$LLVM_ROOT/repos
+
echo " + Setting up LLVM"
-prepare $LLVM_SRC $gitroot/llvm $svnroot/llvm/trunk
+prepare $llvm_repos/llvm $gitroot/llvm $svnroot/llvm/trunk
echo " + Setting up Clang"
-prepare $LLVM_SRC/../clang $gitroot/clang $svnroot/cfe/trunk
+prepare $llvm_repos/clang $gitroot/clang $svnroot/cfe/trunk
echo " + Setting up Clang Tools Extra"
-prepare $LLVM_SRC/../clang-tools-extra \
+prepare $llvm_repos/clang-tools-extra \
$gitroot/clang-tools-extra $svnroot/clang-tools-extra/trunk
echo " + Setting up Compiler-RT"
-prepare $LLVM_SRC/../compiler-rt $gitroot/compiler-rt $svnroot/compiler-rt/trunk
+prepare $llvm_repos/compiler-rt $gitroot/compiler-rt $svnroot/compiler-rt/trunk
echo " + Setting up LLD Linker"
-prepare $LLVM_SRC/../lld $gitroot/lld $svnroot/lld/trunk
+prepare $llvm_repos/lld $gitroot/lld $svnroot/lld/trunk
echo " + Setting up LibC++"
-prepare $LLVM_SRC/../libcxx $gitroot/libcxx $svnroot/libcxx/trunk
+prepare $llvm_repos/libcxx $gitroot/libcxx $svnroot/libcxx/trunk
echo " + Setting up LibC++ABI"
-prepare $LLVM_SRC/../libcxxabi $gitroot/libcxxabi $svnroot/libcxxabi/trunk
+prepare $llvm_repos/libcxxabi $gitroot/libcxxabi $svnroot/libcxxabi/trunk
echo " + Setting up LibUnwind"
-prepare $LLVM_SRC/../libunwind $gitroot/libunwind $svnroot/libunwind/trunk
+prepare $llvm_repos/libunwind $gitroot/libunwind $svnroot/libunwind/trunk
echo " + Setting up LLDB Debugger"
-prepare $LLVM_SRC/../lldb $gitroot/lldb $svnroot/lldb/trunk
+prepare $llvm_repos/lldb $gitroot/lldb $svnroot/lldb/trunk
echo " + Setting up Test Suite"
-prepare $LLVM_SRC/../test-suite $gitroot/test-suite $svnroot/test-suite/trunk
+prepare $llvm_repos/test-suite $gitroot/test-suite $svnroot/test-suite/trunk
echo " + Setting up LNT Test harness"
-prepare $LLVM_SRC/../lnt $gitroot/lnt $svnroot/lnt/trunk
+prepare $llvm_repos/lnt $gitroot/lnt $svnroot/lnt/trunk
echo " + Setting up Zorg Buildbot Config"
-prepare $LLVM_SRC/../zorg $gitroot/zorg $svnroot/zorg/trunk
-
-mkdir -p $LLVM_BLD
+prepare $llvm_repos/zorg $gitroot/zorg $svnroot/zorg/trunk
echo " + Done"