diff --git a/test/lit.cfg b/test/lit.cfg index c9441bb30..02ab9dacb 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -324,7 +324,14 @@ if not os.path.exists(os.path.join(config.test_exec_root, "..", "..", "clang", " llvm_revision = urlopen( "https://raw.githubusercontent.com/root-project/cling/master/LastKnownGoodLLVMSVNRevision.txt" ).readline().strip().decode('utf-8') - subprocess.Popen(['sudo svn export http://llvm.org/svn/llvm-project/llvm/branches/{0}/utils/lit utils/lit'.format(llvm_revision)], + assert(llvm_revision[:-2] == "release_") + branch_vers = llvm_revision[-2] + branch_ref = subprocess.check_output(["git", "ls-remote", "https://github.com/llvm/llvm-project.git", "release/{0}.x".format(branch_vers)], stderr=subprocess.STDOUT).decode() + commit = branch_ref[:branch_ref.find("\trefs/heads")] + # We get zip instead of git clone to not download git history + subprocess.Popen(['wget https://github.com/llvm/llvm-project/archive/{0}.zip && \ + unzip {0}.zip "llvm-project-{0}/llvm/utils/lit/*" && mkdir utils/ && \ + mv llvm-project-{0}/llvm/utils/lit/ utils/'.format(commit)], cwd=config.llvm_src_root, shell=True, stdin=subprocess.PIPE, diff --git a/tools/packaging/cpt.py b/tools/packaging/cpt.py index 20191faa3..9ac5ed068 100755 --- a/tools/packaging/cpt.py +++ b/tools/packaging/cpt.py @@ -695,8 +695,12 @@ def build_filecheck(): llvm_revision = urlopen( "https://raw.githubusercontent.com/root-project/cling/master/LastKnownGoodLLVMSVNRevision.txt").readline().strip().decode( 'utf-8') - exec_subprocess_call("svn export http://llvm.org/svn/llvm-project/llvm/branches/{0}/utils/FileCheck FileCheck".format(llvm_revision), - os.path.join(CLING_SRC_DIR, "tools")) + assert(llvm_revision[:-2] == "release_") + branch_vers = llvm_revision[-2] + branch_ref = subprocess.check_output(["git", "ls-remote", "https://github.com/llvm/llvm-project.git", "release/{0}.x".format(branch_vers)], stderr=subprocess.STDOUT).decode() + commit = branch_ref[:branch_ref.find("\trefs/heads")] + # We get zip instead of git clone to not download git history + subprocess.Popen(['wget https://github.com/llvm/llvm-project/archive/{0}.zip && unzip {0}.zip "llvm-project-{0}/llvm/utils/*" && mv llvm-project-{0}/llvm/utils/FileCheck FileCheck'.format(commit)], cwd=os.path.join(CLING_SRC_DIR, "tools"), shell=True, stdin=subprocess.PIPE, stdout=None, stderr=subprocess.STDOUT).communicate('yes'.encode('utf-8')) with open(os.path.join(CLING_SRC_DIR, 'tools', 'CMakeLists.txt'), 'a') as file: file.writelines('add_subdirectory(\"FileCheck\")') exec_subprocess_call("cmake {0}".format(LLVM_OBJ_ROOT), CLING_SRC_DIR)