diff options
author | Salud Lemus <saludlemus@google.com> | 2019-08-23 16:49:28 -0700 |
---|---|---|
committer | Salud Lemus <saludlemus@google.com> | 2019-08-26 20:48:09 +0000 |
commit | 42235709e88cbb239b9514d888919beb7c4a2c9e (patch) | |
tree | 522da299d73617637f8f4492955b24796998ad57 /llvm_tools/llvm_bisection.py | |
parent | 6277e420d2b9260f9bcc1ac6b22b63ef7ef4b79c (diff) | |
download | toolchain-utils-42235709e88cbb239b9514d888919beb7c4a2c9e.tar.gz |
LLVM tools: Maintain up-to-date LLVM repo in 'llvm_tools'
Keeps an up-to-date LLVM source tree in 'llvm_tools' directory.
Previously, the LLVM repo would be cloned once and then be forgotten.
BUG=None
TEST=Ran the 'llvm_bisection.py' script on a previously created JSON
file (the script created it before). Successfully created tryjobs that
were not in the 'jobs' list. Also, successfully kept the LLVM repo
up-to-date in 'llvm_tools'.
Change-Id: If9038da788eb0fe0fe258274c1942f1d687868b4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1769483
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: George Burgess <gbiv@chromium.org>
Tested-by: Salud Lemus <saludlemus@google.com>
Diffstat (limited to 'llvm_tools/llvm_bisection.py')
-rwxr-xr-x | llvm_tools/llvm_bisection.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/llvm_tools/llvm_bisection.py b/llvm_tools/llvm_bisection.py index 9cf2f447..b4705d49 100755 --- a/llvm_tools/llvm_bisection.py +++ b/llvm_tools/llvm_bisection.py @@ -15,6 +15,7 @@ import json import os from assert_not_in_chroot import VerifyOutsideChroot +from get_llvm_hash import CreateTempLLVMRepo from get_llvm_hash import LLVMHash from modify_a_tryjob import AddTryjob from patch_manager import _ConvertToASCII @@ -272,17 +273,17 @@ def GetRevisionsListAndHashList(start, end, parallel, src_path, new_llvm = LLVMHash() with new_llvm.CreateTempDirectory() as temp_dir: - if not src_path: - new_llvm.CloneLLVMRepo(temp_dir) - src_path = temp_dir + with CreateTempLLVMRepo(temp_dir) as new_repo: + if not src_path: + src_path = new_repo - # Get a list of revisions between start and end. - revisions = GetRevisionsBetweenBisection(start, end, parallel, src_path, - pending_revisions) + # Get a list of revisions between start and end. + revisions = GetRevisionsBetweenBisection(start, end, parallel, src_path, + pending_revisions) - git_hashes = [ - new_llvm.GetGitHashForVersion(src_path, rev) for rev in revisions - ] + git_hashes = [ + new_llvm.GetGitHashForVersion(src_path, rev) for rev in revisions + ] assert revisions, ('No revisions between start %d and end %d to create ' 'tryjobs.' % (start, end)) |