def main(): parser = argparse.ArgumentParser(description='upload new clang revision') parser.add_argument('clang_git_revision', nargs=1, help='Clang git revision to build the toolchain for.') parser.add_argument('clang_sub_revision', type=int, nargs='?', default=1, help='Clang sub-revision to build the toolchain for.') args = parser.parse_args() clang_git_revision = args.clang_git_revision[0] # To get the commit count, we need a checkout. CheckoutLLVM(clang_git_revision, LLVM_DIR) clang_svn_revision = 'n' + GetCommitCount(clang_git_revision) clang_sub_revision = args.clang_sub_revision # Needs shell=True on Windows due to git.bat in depot_tools. os.chdir(CHROMIUM_DIR) git_revision = subprocess.check_output( ["git", "rev-parse", "origin/master"], shell=is_win).strip() print("Making a patch for Clang {}-{}-{}".format(clang_svn_revision, clang_git_revision[:8], clang_sub_revision)) print("Chrome revision: {}".format(git_revision)) clang_old_git_revision, clang_old_svn_revision, clang_old_sub_revision = \ PatchRevision(clang_git_revision, clang_svn_revision, clang_sub_revision) rev_string = "{}-{}-{}".format(clang_svn_revision, clang_git_revision[:8], clang_sub_revision) Git(["checkout", "-b", "clang-{}".format(rev_string)]) Git(["add", UPDATE_PY_PATH]) old_rev_string = "{}-{}-{}".format(clang_old_svn_revision, clang_old_git_revision[:8], clang_old_sub_revision) commit_message = 'Ran `{}`.'.format(' '.join(sys.argv)) + COMMIT_FOOTER Git([ "commit", "-m", "Roll clang {} : {}.\n\n{}".format(old_rev_string, rev_string, commit_message) ]) Git(["cl", "upload", "-f", "--bypass-hooks"]) Git([ "cl", "try", "-B", "chromium/try", "-b", "linux_upload_clang", "-b", "mac_upload_clang", "-b", "win_upload_clang", "-r", git_revision ]) print("Please, wait until the try bots succeeded " "and then push the binaries to goma.")
def main(): parser = argparse.ArgumentParser(description='upload new clang revision') parser.add_argument('clang_git_revision', nargs=1, help='Clang git revision to build the toolchain for.') parser.add_argument('clang_sub_revision', type=int, nargs='?', default=1, help='Clang sub-revision to build the toolchain for.') args = parser.parse_args() clang_raw_git_revision = args.clang_git_revision[0] # To `git describe`, we need a checkout. CheckoutLLVM(clang_raw_git_revision, LLVM_DIR) clang_git_revision = GetCommitDescription(clang_raw_git_revision) clang_sub_revision = args.clang_sub_revision os.chdir(CHROMIUM_DIR) print("Making a patch for Clang {}-{}".format(clang_git_revision, clang_sub_revision)) rev_string = "{}-{}".format(clang_git_revision, clang_sub_revision) Git(["checkout", "origin/main", "-b", "clang-{}".format(rev_string)]) old_rev_string = PatchRevision(clang_git_revision, clang_sub_revision) Git(["add", UPDATE_PY_PATH]) commit_message = 'Ran `{}`.'.format(' '.join(sys.argv)) + COMMIT_FOOTER Git([ "commit", "-m", "Roll clang {} : {}\n\n{}".format(old_rev_string, rev_string, commit_message) ]) Git(["cl", "upload", "-f", "--bypass-hooks"]) Git([ "cl", "try", "-B", "chromium/try", "-b", "linux_upload_clang", "-b", "mac_upload_clang", "-b", "mac_upload_clang_arm", "-b", "win_upload_clang" ]) print("Please, wait until the try bots succeeded " "and then push the binaries to goma.")