Skip to content

Commit

Permalink
[cpt]Stop using svn
Browse files Browse the repository at this point in the history
LLVM repository has migrated from svn to git
  • Loading branch information
reikdas committed Feb 6, 2021
1 parent 2124965 commit 6ab5330
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
9 changes: 8 additions & 1 deletion test/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 6 additions & 2 deletions tools/packaging/cpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6ab5330

Please sign in to comment.