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

Side by Side Diff: tools/gn.py

Issue 2854583002: [infra] Roll clang to match the version used by Flutter (Closed)
Patch Set: Fixes for Windows Created 3 years, 7 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
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2016 The Dart project authors. All rights reserved. 2 # Copyright 2016 The Dart project 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 import argparse 6 import argparse
7 import multiprocessing 7 import multiprocessing
8 import os 8 import os
9 import subprocess 9 import subprocess
10 import sys 10 import sys
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 gn_args['dart_debug'] = mode == 'debug' 158 gn_args['dart_debug'] = mode == 'debug'
159 159
160 # This setting is only meaningful for Flutter. Standalone builds of the VM 160 # This setting is only meaningful for Flutter. Standalone builds of the VM
161 # should leave this set to 'develop', which causes the build to defer to 161 # should leave this set to 'develop', which causes the build to defer to
162 # 'is_debug', 'is_release' and 'is_product'. 162 # 'is_debug', 'is_release' and 'is_product'.
163 gn_args['dart_runtime_mode'] = 'develop' 163 gn_args['dart_runtime_mode'] = 'develop'
164 164
165 # TODO(zra): Investigate using clang with these configurations. 165 # TODO(zra): Investigate using clang with these configurations.
166 # Clang compiles tcmalloc's inline assembly for ia32 on Linux wrong, so we 166 # Clang compiles tcmalloc's inline assembly for ia32 on Linux wrong, so we
167 # don't use clang in that configuration. Thus, we use gcc for ia32 *unless* 167 # don't use clang in that configuration. Thus, we use gcc for ia32 *unless*
168 # asan or tsan is specified. 168 # a clang-based sanitizer is specified.
169 has_clang = (host_os != 'win' 169 has_clang = (host_os != 'win'
170 and args.os not in ['android']
171 and not gn_args['target_cpu'].startswith('arm')
172 and not gn_args['target_cpu'].startswith('mips') 170 and not gn_args['target_cpu'].startswith('mips')
173 and not ((gn_args['target_os'] == 'linux') 171 and not ((gn_args['target_os'] == 'linux')
174 and (gn_args['host_cpu'] == 'x86') 172 and (gn_args['host_cpu'] == 'x86')
175 and not args.asan 173 and not args.asan
176 and not args.msan 174 and not args.msan
177 and not args.tsan)) # Use clang for sanitizer builds. 175 and not args.tsan)) # Use clang for sanitizer builds.
178 gn_args['is_clang'] = args.clang and has_clang 176 gn_args['is_clang'] = args.clang and has_clang
179 177
180 gn_args['is_asan'] = args.asan and gn_args['is_clang'] 178 gn_args['is_asan'] = args.asan and gn_args['is_clang']
181 gn_args['is_msan'] = args.msan and gn_args['is_clang'] 179 gn_args['is_msan'] = args.msan and gn_args['is_clang']
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 return False 239 return False
242 oses = [process_os_option(os_name) for os_name in args.os] 240 oses = [process_os_option(os_name) for os_name in args.os]
243 for os_name in oses: 241 for os_name in oses:
244 if not os_name in ['android', 'freebsd', 'linux', 'macos', 'win32']: 242 if not os_name in ['android', 'freebsd', 'linux', 'macos', 'win32']:
245 print "Unknown os %s" % os_name 243 print "Unknown os %s" % os_name
246 return False 244 return False
247 if os_name != HOST_OS: 245 if os_name != HOST_OS:
248 if os_name != 'android': 246 if os_name != 'android':
249 print "Unsupported target os %s" % os_name 247 print "Unsupported target os %s" % os_name
250 return False 248 return False
251 if not HOST_OS in ['linux']: 249 if not HOST_OS in ['linux', 'macos']:
252 print ("Cross-compilation to %s is not supported on host os %s." 250 print ("Cross-compilation to %s is not supported on host os %s."
253 % (os_name, HOST_OS)) 251 % (os_name, HOST_OS))
254 return False 252 return False
255 if not arch in ['ia32', 'x64', 'arm', 'armv6', 'armv5te', 'arm64', 'mips', 253 if not arch in ['ia32', 'x64', 'arm', 'armv6', 'armv5te', 'arm64', 'mips',
256 'simdbc', 'simdbc64']: 254 'simdbc', 'simdbc64']:
257 print ("Cross-compilation to %s is not supported for architecture %s." 255 print ("Cross-compilation to %s is not supported for architecture %s."
258 % (os_name, arch)) 256 % (os_name, arch))
259 return False 257 return False
260 return True 258 return True
261 259
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 default=use_wheezy(), 358 default=use_wheezy(),
361 action='store_true') 359 action='store_true')
362 other_group.add_argument('--no-wheezy', 360 other_group.add_argument('--no-wheezy',
363 help='Disable the Debian wheezy sysroot on Linux', 361 help='Disable the Debian wheezy sysroot on Linux',
364 dest='wheezy', 362 dest='wheezy',
365 action='store_false') 363 action='store_false')
366 other_group.add_argument('--workers', '-w', 364 other_group.add_argument('--workers', '-w',
367 type=int, 365 type=int,
368 help='Number of simultaneous GN invocations', 366 help='Number of simultaneous GN invocations',
369 dest='workers', 367 dest='workers',
370 default=multiprocessing.cpu_count()) 368 # Set to multiprocessing.cpu_count() when GN can be run in parallel.
369 default=1)
371 370
372 options = parser.parse_args(args) 371 options = parser.parse_args(args)
373 if not process_options(options): 372 if not process_options(options):
374 parser.print_help() 373 parser.print_help()
375 return None 374 return None
376 return options 375 return options
377 376
378 377
379 def run_command(command): 378 def run_command(command):
380 try: 379 try:
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 return 1 426 return 1
428 427
429 endtime = time.time() 428 endtime = time.time()
430 if args.verbose: 429 if args.verbose:
431 print ("GN Time: %.3f seconds" % (endtime - starttime)) 430 print ("GN Time: %.3f seconds" % (endtime - starttime))
432 return 0 431 return 0
433 432
434 433
435 if __name__ == '__main__': 434 if __name__ == '__main__':
436 sys.exit(main(sys.argv)) 435 sys.exit(main(sys.argv))
OLDNEW
« tools/buildtools/update.py ('K') | « tools/clang/scripts/update.sh ('k') | tools/ninja.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698