Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Side by Side Diff: tools/clang/scripts/update.py

Issue 1302053002: Roll Clang 243039:245402 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/clang/scripts/package.py ('k') | tools/clang/scripts/update.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Windows can't run .sh files, so this is a Python implementation of 6 """Windows can't run .sh files, so this is a Python implementation of
7 update.sh. This script should replace update.sh on all platforms eventually.""" 7 update.sh. This script should replace update.sh on all platforms eventually."""
8 8
9 import argparse 9 import argparse
10 import contextlib 10 import contextlib
(...skipping 10 matching lines...) Expand all
21 import time 21 import time
22 import urllib2 22 import urllib2
23 import zipfile 23 import zipfile
24 24
25 # Do NOT CHANGE this if you don't know what you're doing -- see 25 # Do NOT CHANGE this if you don't know what you're doing -- see
26 # https://code.google.com/p/chromium/wiki/UpdatingClang 26 # https://code.google.com/p/chromium/wiki/UpdatingClang
27 # Reverting problematic clang rolls is safe, though. 27 # Reverting problematic clang rolls is safe, though.
28 # Note: this revision is only used for Windows. Other platforms use update.sh. 28 # Note: this revision is only used for Windows. Other platforms use update.sh.
29 # TODO(thakis): Use the same revision on Windows and non-Windows. 29 # TODO(thakis): Use the same revision on Windows and non-Windows.
30 # TODO(thakis): Remove update.sh, use update.py everywhere. 30 # TODO(thakis): Remove update.sh, use update.py everywhere.
31 LLVM_WIN_REVISION = '243039' 31 LLVM_WIN_REVISION = '245402'
32 32
33 use_head_revision = 'LLVM_FORCE_HEAD_REVISION' in os.environ 33 use_head_revision = 'LLVM_FORCE_HEAD_REVISION' in os.environ
34 if use_head_revision: 34 if use_head_revision:
35 LLVM_WIN_REVISION = 'HEAD' 35 LLVM_WIN_REVISION = 'HEAD'
36 36
37 # This is incremented when pushing a new build of Clang at the same revision. 37 # This is incremented when pushing a new build of Clang at the same revision.
38 CLANG_SUB_REVISION=1 38 CLANG_SUB_REVISION=1
39 39
40 PACKAGE_VERSION = "%s-%s" % (LLVM_WIN_REVISION, CLANG_SUB_REVISION) 40 PACKAGE_VERSION = "%s-%s" % (LLVM_WIN_REVISION, CLANG_SUB_REVISION)
41 41
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 os.remove(f) # For unversioned files. 234 os.remove(f) # For unversioned files.
235 RunCommand(['svn', 'revert', f]) 235 RunCommand(['svn', 'revert', f])
236 236
237 237
238 def ApplyLocalPatches(): 238 def ApplyLocalPatches():
239 # There's no patch program on Windows by default. We don't need patches on 239 # There's no patch program on Windows by default. We don't need patches on
240 # Windows yet, and maybe this not working on Windows will motivate us to 240 # Windows yet, and maybe this not working on Windows will motivate us to
241 # remove patches over time. 241 # remove patches over time.
242 assert sys.platform != 'win32' 242 assert sys.platform != 'win32'
243 243
244 # Apply patch for tests failing with --disable-pthreads (llvm.org/PR11974) 244 # No patches.
245 clang_patches = [ r"""\
246 --- test/Index/crash-recovery-modules.m»(revision 202554)
247 +++ test/Index/crash-recovery-modules.m»(working copy)
248 @@ -12,6 +12,8 @@
249
250 // REQUIRES: crash-recovery
251 // REQUIRES: shell
252 +// XFAIL: *
253 +// (PR11974)
254
255 @import Crash;
256 """, r"""\
257 --- unittests/libclang/LibclangTest.cpp (revision 215949)
258 +++ unittests/libclang/LibclangTest.cpp (working copy)
259 @@ -431,7 +431,7 @@
260 EXPECT_EQ(0U, clang_getNumDiagnostics(ClangTU));
261 }
262
263 -TEST_F(LibclangReparseTest, ReparseWithModule) {
264 +TEST_F(LibclangReparseTest, DISABLED_ReparseWithModule) {
265 const char *HeaderTop = "#ifndef H\n#define H\nstruct Foo { int bar;";
266 const char *HeaderBottom = "\n};\n#endif\n";
267 const char *MFile = "#include \"HeaderFile.h\"\nint main() {"
268 """
269 ]
270
271 # The UBSan run-time, which is now bundled with the ASan run-time, doesn't
272 # work on Mac OS X 10.8 (PR23539).
273 compiler_rt_patches = [ r"""\
274 --- CMakeLists.txt» (revision 241602)
275 +++ CMakeLists.txt» (working copy)
276 @@ -305,6 +305,7 @@
277 list(APPEND SANITIZER_COMMON_SUPPORTED_OS iossim)
278 endif()
279 endif()
280 + set(SANITIZER_MIN_OSX_VERSION "10.7")
281 if(SANITIZER_MIN_OSX_VERSION VERSION_LESS "10.7")
282 message(FATAL_ERROR "Too old OS X version: ${SANITIZER_MIN_OSX_VERSION}")
283 endif()
284 """
285 ]
286
287 for path, patches in [(CLANG_DIR, clang_patches),
288 (COMPILER_RT_DIR, compiler_rt_patches)]:
289 print 'Applying patches in', path
290 for patch in patches:
291 print patch
292 p = subprocess.Popen( ['patch', '-p0', '-d', path], stdin=subprocess.PIPE)
293 (stdout, stderr) = p.communicate(input=patch)
294 if p.returncode != 0:
295 raise RuntimeError('stdout %s, stderr %s' % (stdout, stderr))
296 245
297 246
298 def DeleteChromeToolsShim(): 247 def DeleteChromeToolsShim():
299 OLD_SHIM_DIR = os.path.join(LLVM_DIR, 'tools', 'zzz-chrometools') 248 OLD_SHIM_DIR = os.path.join(LLVM_DIR, 'tools', 'zzz-chrometools')
300 shutil.rmtree(OLD_SHIM_DIR, ignore_errors=True) 249 shutil.rmtree(OLD_SHIM_DIR, ignore_errors=True)
301 shutil.rmtree(CHROME_TOOLS_SHIM_DIR, ignore_errors=True) 250 shutil.rmtree(CHROME_TOOLS_SHIM_DIR, ignore_errors=True)
302 251
303 252
304 def CreateChromeToolsShim(): 253 def CreateChromeToolsShim():
305 """Hooks the Chrome tools into the LLVM build. 254 """Hooks the Chrome tools into the LLVM build.
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 # above). 578 # above).
630 #if args.bootstrap and sys.platform == 'win32': 579 #if args.bootstrap and sys.platform == 'win32':
631 # The bootstrap compiler produces 64-bit binaries by default. 580 # The bootstrap compiler produces 64-bit binaries by default.
632 #cflags += ['-m32'] 581 #cflags += ['-m32']
633 #cxxflags += ['-m32'] 582 #cxxflags += ['-m32']
634 compiler_rt_args = base_cmake_args + [ 583 compiler_rt_args = base_cmake_args + [
635 '-DCMAKE_C_FLAGS=' + ' '.join(cflags), 584 '-DCMAKE_C_FLAGS=' + ' '.join(cflags),
636 '-DCMAKE_CXX_FLAGS=' + ' '.join(cxxflags)] 585 '-DCMAKE_CXX_FLAGS=' + ' '.join(cxxflags)]
637 if sys.platform != 'win32': 586 if sys.platform != 'win32':
638 compiler_rt_args += ['-DLLVM_CONFIG_PATH=' + 587 compiler_rt_args += ['-DLLVM_CONFIG_PATH=' +
639 os.path.join(LLVM_BUILD_DIR, 'bin', 'llvm-config')] 588 os.path.join(LLVM_BUILD_DIR, 'bin', 'llvm-config'),
589 '-DSANITIZER_MIN_OSX_VERSION="10.7"']
640 RunCommand(['cmake'] + compiler_rt_args + [LLVM_DIR], 590 RunCommand(['cmake'] + compiler_rt_args + [LLVM_DIR],
641 msvc_arch='x86', env=deployment_env) 591 msvc_arch='x86', env=deployment_env)
642 RunCommand(['ninja', 'compiler-rt'], msvc_arch='x86') 592 RunCommand(['ninja', 'compiler-rt'], msvc_arch='x86')
643 593
644 # TODO(hans): Make this (and the .gypi and .isolate files) version number 594 # TODO(hans): Make this (and the .gypi and .isolate files) version number
645 # independent. 595 # independent.
646 if sys.platform == 'win32': 596 if sys.platform == 'win32':
647 platform = 'windows' 597 platform = 'windows'
648 elif sys.platform == 'darwin': 598 elif sys.platform == 'darwin':
649 platform = 'darwin' 599 platform = 'darwin'
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 741
792 args.force_local_build = True 742 args.force_local_build = True
793 # Skip local patches when using HEAD: they probably don't apply anymore. 743 # Skip local patches when using HEAD: they probably don't apply anymore.
794 args.with_patches = False 744 args.with_patches = False
795 745
796 return UpdateClang(args) 746 return UpdateClang(args)
797 747
798 748
799 if __name__ == '__main__': 749 if __name__ == '__main__':
800 sys.exit(main()) 750 sys.exit(main())
OLDNEW
« no previous file with comments | « tools/clang/scripts/package.py ('k') | tools/clang/scripts/update.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698