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

Side by Side Diff: tools/bots/compiler.py

Issue 303483004: Add support for running dart2js in batch mode on the bots (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « tools/bots/bot.py ('k') | no next file » | 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/python 1 #!/usr/bin/python
2 2
3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
4 # for details. All rights reserved. Use of this source code is governed by a 4 # for details. All rights reserved. Use of this source code is governed by a
5 # BSD-style license that can be found in the LICENSE file. 5 # BSD-style license that can be found in the LICENSE file.
6 6
7 """ 7 """
8 Dart2js buildbot steps 8 Dart2js buildbot steps
9 9
10 Runs tests for the dart2js compiler. 10 Runs tests for the dart2js compiler.
11 """ 11 """
12 12
13 import os 13 import os
14 import platform 14 import platform
15 import re 15 import re
16 import shutil 16 import shutil
17 import socket 17 import socket
18 import subprocess 18 import subprocess
19 import sys 19 import sys
20 20
21 import bot 21 import bot
22 22
23 DARTIUM_BUILDER = r'none-dartium-(linux|mac|windows)' 23 DARTIUM_BUILDER = r'none-dartium-(linux|mac|windows)'
24 DART2JS_BUILDER = ( 24 DART2JS_BUILDER = (
25 r'dart2js-(linux|mac|windows)(-(jsshell))?-(debug|release)(-(checked|host-ch ecked))?(-(host-checked))?(-(minified))?(-(x64))?-?(\d*)-?(\d*)') 25 r'dart2js-(linux|mac|windows)(-(jsshell))?-(debug|release)(-(checked|host-ch ecked))?(-(host-checked))?(-(minified))?(-(x64))?(-(batch))?-?(\d*)-?(\d*)')
26 DART2JS_FULL_BUILDER = r'dart2js-full-(linux|mac|windows)(-checked)?(-minified)? -(\d+)-(\d+)' 26 DART2JS_FULL_BUILDER = r'dart2js-full-(linux|mac|windows)(-checked)?(-minified)? -(\d+)-(\d+)'
27 WEB_BUILDER = ( 27 WEB_BUILDER = (
28 r'dart2js-(ie9|ie10|ie11|ff|safari|chrome|chromeOnAndroid|safarimobilesim|op era|drt)-(win7|win8|mac10\.8|mac10\.7|linux)(-(all|html))?(-(csp))?(-(\d+)-(\d+) )?') 28 r'dart2js-(ie9|ie10|ie11|ff|safari|chrome|chromeOnAndroid|safarimobilesim|op era|drt)-(win7|win8|mac10\.8|mac10\.7|linux)(-(all|html))?(-(csp))?(-(\d+)-(\d+) )?')
29 29
30 DART2JS_FULL_CONFIGURATIONS = { 30 DART2JS_FULL_CONFIGURATIONS = {
31 'linux' : [ ], 31 'linux' : [ ],
32 'mac' : [ ], 32 'mac' : [ ],
33 'windows' : [ 33 'windows' : [
34 {'runtime' : 'ie9'}, 34 {'runtime' : 'ie9'},
35 {'runtime' : 'ie9', 'additional_flags' : ['--checked']}, 35 {'runtime' : 'ie9', 'additional_flags' : ['--checked']},
(...skipping 13 matching lines...) Expand all
49 system = None 49 system = None
50 checked = False 50 checked = False
51 host_checked = False 51 host_checked = False
52 minified = False 52 minified = False
53 shard_index = None 53 shard_index = None
54 total_shards = None 54 total_shards = None
55 test_set = None 55 test_set = None
56 csp = None 56 csp = None
57 arch = None 57 arch = None
58 dart2js_full = False 58 dart2js_full = False
59 batch = False
59 60
60 dart2js_pattern = re.match(DART2JS_BUILDER, builder_name) 61 dart2js_pattern = re.match(DART2JS_BUILDER, builder_name)
61 dart2js_full_pattern = re.match(DART2JS_FULL_BUILDER, builder_name) 62 dart2js_full_pattern = re.match(DART2JS_FULL_BUILDER, builder_name)
62 web_pattern = re.match(WEB_BUILDER, builder_name) 63 web_pattern = re.match(WEB_BUILDER, builder_name)
63 dartium_pattern = re.match(DARTIUM_BUILDER, builder_name) 64 dartium_pattern = re.match(DARTIUM_BUILDER, builder_name)
64 65
65 if web_pattern: 66 if web_pattern:
66 compiler = 'dart2js' 67 compiler = 'dart2js'
67 runtime = web_pattern.group(1) 68 runtime = web_pattern.group(1)
68 system = web_pattern.group(2) 69 system = web_pattern.group(2)
(...skipping 30 matching lines...) Expand all
99 if dart2js_pattern.group(6) == 'checked': 100 if dart2js_pattern.group(6) == 'checked':
100 checked = True 101 checked = True
101 if dart2js_pattern.group(6) == 'host-checked': 102 if dart2js_pattern.group(6) == 'host-checked':
102 host_checked = True 103 host_checked = True
103 if dart2js_pattern.group(8) == 'host-checked': 104 if dart2js_pattern.group(8) == 'host-checked':
104 host_checked = True 105 host_checked = True
105 if dart2js_pattern.group(10) == 'minified': 106 if dart2js_pattern.group(10) == 'minified':
106 minified = True 107 minified = True
107 if dart2js_pattern.group(12) == 'x64': 108 if dart2js_pattern.group(12) == 'x64':
108 arch = 'x64' 109 arch = 'x64'
109 shard_index = dart2js_pattern.group(13) 110 if dart2js_pattern.group(14) == 'batch':
110 total_shards = dart2js_pattern.group(14) 111 batch = True
112 shard_index = dart2js_pattern.group(15)
113 total_shards = dart2js_pattern.group(16)
111 elif dartium_pattern: 114 elif dartium_pattern:
112 compiler = 'none' 115 compiler = 'none'
113 runtime = 'dartium' 116 runtime = 'dartium'
114 mode = 'release' 117 mode = 'release'
115 system = dartium_pattern.group(1) 118 system = dartium_pattern.group(1)
116 else : 119 else :
117 return None 120 return None
118 121
119 # We have both win7 and win8 bots, functionality is the same. 122 # We have both win7 and win8 bots, functionality is the same.
120 if system.startswith('win'): 123 if system.startswith('win'):
121 system = 'windows' 124 system = 'windows'
122 125
123 # We have both 10.8 and 10.7 bots, functionality is the same. 126 # We have both 10.8 and 10.7 bots, functionality is the same.
124 if system == 'mac10.8' or system == 'mac10.7': 127 if system == 'mac10.8' or system == 'mac10.7':
125 system = 'mac' 128 system = 'mac'
126 129
127 if (system == 'windows' and platform.system() != 'Windows') or ( 130 if (system == 'windows' and platform.system() != 'Windows') or (
128 system == 'mac' and platform.system() != 'Darwin') or ( 131 system == 'mac' and platform.system() != 'Darwin') or (
129 system == 'linux' and platform.system() != 'Linux'): 132 system == 'linux' and platform.system() != 'Linux'):
130 print ('Error: You cannot emulate a buildbot with a platform different ' 133 print ('Error: You cannot emulate a buildbot with a platform different '
131 'from your own.') 134 'from your own.')
132 return None 135 return None
133 return bot.BuildInfo(compiler, runtime, mode, system, checked, host_checked, 136 return bot.BuildInfo(compiler, runtime, mode, system, checked, host_checked,
134 minified, shard_index, total_shards, is_buildbot, 137 minified, shard_index, total_shards, is_buildbot,
135 test_set, csp, arch, dart2js_full) 138 test_set, csp, arch, dart2js_full, batch=batch)
136 139
137 140
138 def NeedsXterm(compiler, runtime): 141 def NeedsXterm(compiler, runtime):
139 return runtime in ['ie9', 'ie10', 'ie11', 'chrome', 'safari', 'opera', 142 return runtime in ['ie9', 'ie10', 'ie11', 'chrome', 'safari', 'opera',
140 'ff', 'drt', 'dartium'] 143 'ff', 'drt', 'dartium']
141 144
142 145
143 def TestStepName(name, runtime, flags): 146 def TestStepName(name, runtime, flags):
144 # Filter out flags with '=' as this breaks the /stats feature of the 147 # Filter out flags with '=' as this breaks the /stats feature of the
145 # build bot. 148 # build bot.
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 [os.environ['PATH'], tools_dir, platform_tools_dir]) 325 [os.environ['PATH'], tools_dir, platform_tools_dir])
323 326
324 def RunCompilerTests(build_info): 327 def RunCompilerTests(build_info):
325 test_flags = [] 328 test_flags = []
326 if build_info.shard_index: 329 if build_info.shard_index:
327 test_flags = ['--shards=%s' % build_info.total_shards, 330 test_flags = ['--shards=%s' % build_info.total_shards,
328 '--shard=%s' % build_info.shard_index] 331 '--shard=%s' % build_info.shard_index]
329 if build_info.checked: test_flags += ['--checked'] 332 if build_info.checked: test_flags += ['--checked']
330 if build_info.minified: test_flags += ['--minified'] 333 if build_info.minified: test_flags += ['--minified']
331 if build_info.host_checked: test_flags += ['--host-checked'] 334 if build_info.host_checked: test_flags += ['--host-checked']
335 if build_info.batch: test_flags += ['--dart2js-batch']
332 336
333 if build_info.dart2js_full: 337 if build_info.dart2js_full:
334 compiler = build_info.compiler 338 compiler = build_info.compiler
335 assert compiler == 'dart2js' 339 assert compiler == 'dart2js'
336 system = build_info.system 340 system = build_info.system
337 arch = build_info.arch 341 arch = build_info.arch
338 mode = build_info.mode 342 mode = build_info.mode
339 is_buildbot = build_info.is_buildbot 343 is_buildbot = build_info.is_buildbot
340 for configuration in DART2JS_FULL_CONFIGURATIONS[system]: 344 for configuration in DART2JS_FULL_CONFIGURATIONS[system]:
341 additional_flags = configuration.get('additional_flags', []) 345 additional_flags = configuration.get('additional_flags', [])
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 if build_info.mode == 'debug': 380 if build_info.mode == 'debug':
377 target = 'dart2js_bot_debug' 381 target = 'dart2js_bot_debug'
378 args = [sys.executable, './tools/build.py', '--mode=' + build_info.mode, 382 args = [sys.executable, './tools/build.py', '--mode=' + build_info.mode,
379 '--arch=' + build_info.arch, target] 383 '--arch=' + build_info.arch, target]
380 print 'Build SDK and d8: %s' % (' '.join(args)) 384 print 'Build SDK and d8: %s' % (' '.join(args))
381 bot.RunProcess(args) 385 bot.RunProcess(args)
382 386
383 387
384 if __name__ == '__main__': 388 if __name__ == '__main__':
385 bot.RunBot(GetBuildInfo, RunCompilerTests, build_step=BuildCompiler) 389 bot.RunBot(GetBuildInfo, RunCompilerTests, build_step=BuildCompiler)
OLDNEW
« no previous file with comments | « tools/bots/bot.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698