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

Side by Side Diff: tools/gn.py

Issue 2855973006: Revert "[infra] Roll clang to match the version used by Flutter" (Closed)
Patch Set: 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
« no previous file with comments | « tools/clang/scripts/update.sh ('k') | tools/ninja.py » ('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 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 # a clang-based sanitizer is specified. 168 # asan or tsan 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')
170 and not gn_args['target_cpu'].startswith('mips') 172 and not gn_args['target_cpu'].startswith('mips')
171 and not ((gn_args['target_os'] == 'linux') 173 and not ((gn_args['target_os'] == 'linux')
172 and (gn_args['host_cpu'] == 'x86') 174 and (gn_args['host_cpu'] == 'x86')
173 and not args.asan 175 and not args.asan
174 and not args.msan 176 and not args.msan
175 and not args.tsan)) # Use clang for sanitizer builds. 177 and not args.tsan)) # Use clang for sanitizer builds.
176 gn_args['is_clang'] = args.clang and has_clang 178 gn_args['is_clang'] = args.clang and has_clang
177 179
178 gn_args['is_asan'] = args.asan and gn_args['is_clang'] 180 gn_args['is_asan'] = args.asan and gn_args['is_clang']
179 gn_args['is_msan'] = args.msan and gn_args['is_clang'] 181 gn_args['is_msan'] = args.msan and gn_args['is_clang']
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 return False 241 return False
240 oses = [process_os_option(os_name) for os_name in args.os] 242 oses = [process_os_option(os_name) for os_name in args.os]
241 for os_name in oses: 243 for os_name in oses:
242 if not os_name in ['android', 'freebsd', 'linux', 'macos', 'win32']: 244 if not os_name in ['android', 'freebsd', 'linux', 'macos', 'win32']:
243 print "Unknown os %s" % os_name 245 print "Unknown os %s" % os_name
244 return False 246 return False
245 if os_name != HOST_OS: 247 if os_name != HOST_OS:
246 if os_name != 'android': 248 if os_name != 'android':
247 print "Unsupported target os %s" % os_name 249 print "Unsupported target os %s" % os_name
248 return False 250 return False
249 if not HOST_OS in ['linux', 'macos']: 251 if not HOST_OS in ['linux']:
250 print ("Cross-compilation to %s is not supported on host os %s." 252 print ("Cross-compilation to %s is not supported on host os %s."
251 % (os_name, HOST_OS)) 253 % (os_name, HOST_OS))
252 return False 254 return False
253 if not arch in ['ia32', 'x64', 'arm', 'armv6', 'armv5te', 'arm64', 'mips', 255 if not arch in ['ia32', 'x64', 'arm', 'armv6', 'armv5te', 'arm64', 'mips',
254 'simdbc', 'simdbc64']: 256 'simdbc', 'simdbc64']:
255 print ("Cross-compilation to %s is not supported for architecture %s." 257 print ("Cross-compilation to %s is not supported for architecture %s."
256 % (os_name, arch)) 258 % (os_name, arch))
257 return False 259 return False
258 return True 260 return True
259 261
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 default=use_wheezy(), 360 default=use_wheezy(),
359 action='store_true') 361 action='store_true')
360 other_group.add_argument('--no-wheezy', 362 other_group.add_argument('--no-wheezy',
361 help='Disable the Debian wheezy sysroot on Linux', 363 help='Disable the Debian wheezy sysroot on Linux',
362 dest='wheezy', 364 dest='wheezy',
363 action='store_false') 365 action='store_false')
364 other_group.add_argument('--workers', '-w', 366 other_group.add_argument('--workers', '-w',
365 type=int, 367 type=int,
366 help='Number of simultaneous GN invocations', 368 help='Number of simultaneous GN invocations',
367 dest='workers', 369 dest='workers',
368 # Set to multiprocessing.cpu_count() when GN can be run in parallel. 370 default=multiprocessing.cpu_count())
369 default=1)
370 371
371 options = parser.parse_args(args) 372 options = parser.parse_args(args)
372 if not process_options(options): 373 if not process_options(options):
373 parser.print_help() 374 parser.print_help()
374 return None 375 return None
375 return options 376 return options
376 377
377 378
378 def run_command(command): 379 def run_command(command):
379 try: 380 try:
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 return 1 427 return 1
427 428
428 endtime = time.time() 429 endtime = time.time()
429 if args.verbose: 430 if args.verbose:
430 print ("GN Time: %.3f seconds" % (endtime - starttime)) 431 print ("GN Time: %.3f seconds" % (endtime - starttime))
431 return 0 432 return 0
432 433
433 434
434 if __name__ == '__main__': 435 if __name__ == '__main__':
435 sys.exit(main(sys.argv)) 436 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « tools/clang/scripts/update.sh ('k') | tools/ninja.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698