Update clang.

CopyDiaDllTo is no longer needed after
9f7781171e.
As a bonus, this makes the script much easier to use outside of the
bots.

Change-Id: Ib59b7e6ff9276b860032134ad7eaa006492e76b9
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/43464
Reviewed-by: Adam Langley <agl@google.com>
chromium-5359
David Benjamin 4 years ago committed by Adam Langley
parent 51607f1fe1
commit 8c32f941ad
  1. 45
      util/bot/update_clang.py

@ -19,12 +19,10 @@ import urllib2
# CLANG_REVISION and CLANG_SUB_REVISION determine the build of clang # CLANG_REVISION and CLANG_SUB_REVISION determine the build of clang
# to use. These should be synced with tools/clang/scripts/update.py in # to use. These should be synced with tools/clang/scripts/update.py in
# Chromium. # Chromium.
CLANG_REVISION = '4e0d9925d6a3561449bdd8def27fd3f3f1b3fb9f' CLANG_REVISION = 'llvmorg-12-init-5627-gf086e85e'
CLANG_SVN_REVISION = 'n346557' CLANG_SUB_REVISION = 2
CLANG_SUB_REVISION = 1
PACKAGE_VERSION = '%s-%s-%s' % (CLANG_SVN_REVISION, CLANG_REVISION[:8], PACKAGE_VERSION = '%s-%s' % (CLANG_REVISION, CLANG_SUB_REVISION)
CLANG_SUB_REVISION)
# Path constants. (All of these should be absolute paths.) # Path constants. (All of these should be absolute paths.)
THIS_DIR = os.path.abspath(os.path.dirname(__file__)) THIS_DIR = os.path.abspath(os.path.dirname(__file__))
@ -35,13 +33,6 @@ STAMP_FILE = os.path.join(LLVM_BUILD_DIR, 'cr_build_revision')
CDS_URL = os.environ.get('CDS_CLANG_BUCKET_OVERRIDE', CDS_URL = os.environ.get('CDS_CLANG_BUCKET_OVERRIDE',
'https://commondatastorage.googleapis.com/chromium-browser-clang') 'https://commondatastorage.googleapis.com/chromium-browser-clang')
# Bump after VC updates.
DIA_DLL = {
'2013': 'msdia120.dll',
'2015': 'msdia140.dll',
'2017': 'msdia140.dll',
}
def DownloadUrl(url, output_file): def DownloadUrl(url, output_file):
"""Download url into output_file.""" """Download url into output_file."""
@ -133,34 +124,6 @@ def CopyFile(src, dst):
shutil.copy(src, dst) shutil.copy(src, dst)
vs_version = None
def GetVSVersion():
global vs_version
if vs_version:
return vs_version
# Try using the toolchain in depot_tools.
# This sets environment variables used by SelectVisualStudioVersion below.
sys.path.append(THIS_DIR)
import vs_toolchain
vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs()
# Use gyp to find the MSVS installation, either in depot_tools as per above,
# or a system-wide installation otherwise.
sys.path.append(os.path.join(THIS_DIR, 'gyp', 'pylib'))
import gyp.MSVSVersion
vs_version = gyp.MSVSVersion.SelectVisualStudioVersion(
vs_toolchain.GetVisualStudioVersion())
return vs_version
def CopyDiaDllTo(target_dir):
# This script always wants to use the 64-bit msdia*.dll.
dia_path = os.path.join(GetVSVersion().Path(), 'DIA SDK', 'bin', 'amd64')
dia_dll = os.path.join(dia_path, DIA_DLL[GetVSVersion().ShortName()])
CopyFile(dia_dll, target_dir)
def UpdateClang(): def UpdateClang():
cds_file = "clang-%s.tgz" % PACKAGE_VERSION cds_file = "clang-%s.tgz" % PACKAGE_VERSION
if sys.platform == 'win32' or sys.platform == 'cygwin': if sys.platform == 'win32' or sys.platform == 'cygwin':
@ -185,8 +148,6 @@ def UpdateClang():
try: try:
DownloadAndUnpack(cds_full_url, LLVM_BUILD_DIR) DownloadAndUnpack(cds_full_url, LLVM_BUILD_DIR)
print 'clang %s unpacked' % PACKAGE_VERSION print 'clang %s unpacked' % PACKAGE_VERSION
if sys.platform == 'win32':
CopyDiaDllTo(os.path.join(LLVM_BUILD_DIR, 'bin'))
WriteStampFile(PACKAGE_VERSION) WriteStampFile(PACKAGE_VERSION)
return 0 return 0
except urllib2.URLError: except urllib2.URLError:

Loading…
Cancel
Save