2 # Copyright (c) 2012 The Native Client Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
11 sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
12 import pynacl.platform
14 python = sys.executable
20 ######################################################################
22 ######################################################################
24 python + ' buildbot\\buildbot_standard.py opt 32 newlib --no-gyp',
26 python + ' buildbot\\buildbot_standard.py opt 32 glibc --no-gyp',
29 python + ' buildbot\\buildbot_standard.py opt 32 newlib --no-gyp',
31 python + ' buildbot\\buildbot_standard.py opt 32 glibc --no-gyp',
33 'precise-64-validator-opt':
34 python + ' buildbot/buildbot_standard.py opt 64 glibc --validator',
37 'precise_64-newlib-dbg-clang':
38 python + ' buildbot/buildbot_standard.py dbg 64 newlib --clang',
39 'mac10.7-newlib-dbg-clang':
40 python + ' buildbot/buildbot_standard.py dbg 32 newlib --clang',
43 'precise_64-newlib-dbg-asan':
44 python + ' buildbot/buildbot_standard.py opt 64 newlib --asan',
45 'mac10.7-newlib-dbg-asan':
46 python + ' buildbot/buildbot_standard.py opt 32 newlib --asan',
49 'oneiric_32-newlib-arm_hw-pnacl-panda-dbg':
50 bash + ' buildbot/buildbot_pnacl.sh mode-buildbot-arm-hw-dbg',
51 'oneiric_32-newlib-arm_hw-pnacl-panda-opt':
52 bash + ' buildbot/buildbot_pnacl.sh mode-buildbot-arm-hw-opt',
53 'precise_64-newlib-arm_qemu-pnacl-dbg':
54 bash + ' buildbot/buildbot_pnacl.sh mode-buildbot-arm-dbg',
55 'precise_64-newlib-arm_qemu-pnacl-opt':
56 bash + ' buildbot/buildbot_pnacl.sh mode-buildbot-arm-opt',
57 'precise_64-newlib-x86_32-pnacl':
58 python + ' buildbot/buildbot_pnacl.py opt 32 pnacl',
59 'precise_64-newlib-x86_64-pnacl':
60 python + ' buildbot/buildbot_pnacl.py opt 64 pnacl',
61 'mac10.8-newlib-opt-pnacl':
62 python + ' buildbot/buildbot_pnacl.py opt 32 pnacl',
63 'win7-64-newlib-opt-pnacl':
64 python + ' buildbot/buildbot_pnacl.py opt 64 pnacl',
65 'precise_64-newlib-mips-pnacl':
66 echo + ' "TODO(mseaborn): add mips"',
68 'precise_64-newlib-arm_qemu-pnacl-buildonly-spec':
69 bash + ' buildbot/buildbot_spec2k.sh pnacl-arm-buildonly',
70 'oneiric_32-newlib-arm_hw-pnacl-panda-spec':
71 bash + ' buildbot/buildbot_spec2k.sh pnacl-arm-hw',
72 'lucid_64-newlib-x86_32-pnacl-spec':
73 bash + ' buildbot/buildbot_spec2k.sh pnacl-x8632',
74 'lucid_64-newlib-x86_64-pnacl-spec':
75 bash + ' buildbot/buildbot_spec2k.sh pnacl-x8664',
77 'lucid_64-newlib-x86_32-spec':
78 bash + ' buildbot/buildbot_spec2k.sh nacl-x8632',
79 'lucid_64-newlib-x86_64-spec':
80 bash + ' buildbot/buildbot_spec2k.sh nacl-x8664',
83 'precise64-newlib-dbg-android':
84 python + ' buildbot/buildbot_standard.py dbg arm newlib --android',
85 'precise64-newlib-opt-android':
86 python + ' buildbot/buildbot_standard.py opt arm newlib --android',
89 'precise-64-newlib-dbg-valgrind':
90 echo + ' "Valgrind bots are disabled: see '
91 'https://code.google.com/p/nativeclient/issues/detail?id=3158"',
92 'precise-64-glibc-dbg-valgrind':
93 echo + ' "Valgrind bots are disabled: see '
94 'https://code.google.com/p/nativeclient/issues/detail?id=3158"',
96 'mac10.6-newlib-coverage':
97 python + (' buildbot/buildbot_standard.py '
98 'coverage 64 newlib --coverage'),
99 'precise-64-32-newlib-coverage':
100 python + (' buildbot/buildbot_standard.py '
101 'coverage 32 newlib --coverage'),
102 'precise-64-64-newlib-coverage':
103 python + (' buildbot/buildbot_standard.py '
104 'coverage 64 newlib --coverage'),
105 'xp-newlib-coverage':
106 python + (' buildbot/buildbot_standard.py '
107 'coverage 32 newlib --coverage'),
109 ######################################################################
111 ######################################################################
112 'nacl-precise64_validator_opt':
113 python + ' buildbot/buildbot_standard.py opt 64 glibc --validator',
114 'nacl-precise64_newlib_dbg_valgrind':
115 bash + ' buildbot/buildbot_valgrind.sh newlib',
116 'nacl-precise64_glibc_dbg_valgrind':
117 bash + ' buildbot/buildbot_valgrind.sh glibc',
119 'nacl-precise64-newlib-dbg-android':
120 python + ' buildbot/buildbot_standard.py dbg arm newlib --android',
121 'nacl-precise64-newlib-opt-android':
122 python + ' buildbot/buildbot_standard.py opt arm newlib --android',
124 'nacl-mac10.6-newlib-coverage':
125 python + (' buildbot/buildbot_standard.py '
126 'coverage 64 newlib --coverage'),
127 'nacl-precise-64-32-newlib-coverage':
128 python + (' buildbot/buildbot_standard.py '
129 'coverage 32 newlib --coverage'),
130 'nacl-precise-64-64-newlib-coverage':
131 python + (' buildbot/buildbot_standard.py '
132 'coverage 64 newlib --coverage'),
133 'nacl-win32-newlib-coverage':
134 python + (' buildbot/buildbot_standard.py '
135 'coverage 32 newlib --coverage'),
137 'nacl-precise_64-newlib-dbg-clang':
138 python + ' buildbot/buildbot_standard.py dbg 64 newlib --clang',
139 'nacl-mac10.6-newlib-dbg-clang':
140 python + ' buildbot/buildbot_standard.py dbg 32 newlib --clang',
142 'nacl-precise_64-newlib-arm_qemu-pnacl':
143 bash + ' buildbot/buildbot_pnacl.sh mode-trybot-qemu',
144 'nacl-precise_64-newlib-x86_32-pnacl':
145 python + ' buildbot/buildbot_pnacl.py opt 32 pnacl',
146 'nacl-precise_64-newlib-x86_64-pnacl':
147 python + ' buildbot/buildbot_pnacl.py opt 64 pnacl',
148 'nacl-precise_64-newlib-mips-pnacl':
149 echo + ' "TODO(mseaborn): add mips"',
150 'nacl-arm_opt_panda':
151 bash + ' buildbot/buildbot_pnacl.sh mode-buildbot-arm-try',
152 'nacl-arm_hw_opt_panda':
153 bash + ' buildbot/buildbot_pnacl.sh mode-buildbot-arm-hw-try',
154 'nacl-mac10.8_newlib_opt_pnacl':
155 python + ' buildbot/buildbot_pnacl.py opt 32 pnacl',
156 'nacl-win7_64_newlib_opt_pnacl':
157 python + ' buildbot/buildbot_pnacl.py opt 64 pnacl',
158 # Pnacl spec2k trybots
159 'nacl-precise_64-newlib-x86_32-pnacl-spec':
160 bash + ' buildbot/buildbot_spec2k.sh pnacl-trybot-x8632',
161 'nacl-precise_64-newlib-x86_64-pnacl-spec':
162 bash + ' buildbot/buildbot_spec2k.sh pnacl-trybot-x8664',
163 'nacl-arm_perf_panda':
164 bash + ' buildbot/buildbot_spec2k.sh pnacl-trybot-arm-buildonly',
165 'nacl-arm_hw_perf_panda':
166 bash + ' buildbot/buildbot_spec2k.sh pnacl-trybot-arm-hw',
168 'precise64-glibc': bash + ' buildbot/buildbot_linux-glibc-makefile.sh',
169 'mac-glibc': bash + ' buildbot/buildbot_mac-glibc-makefile.sh',
170 'win7-glibc': 'buildbot\\buildbot_windows-glibc-makefile.bat',
171 # Toolchain newlib x86.
172 'win7-toolchain_x86': 'buildbot\\buildbot_toolchain_win.bat',
173 'mac-toolchain_x86': bash + ' buildbot/buildbot_toolchain.sh mac',
174 'precise64-toolchain_x86': bash + ' buildbot/buildbot_toolchain.sh linux',
175 # Toolchain newlib arm.
176 'win7-toolchain_arm':
178 ' buildbot/buildbot_toolchain_build.py'
183 ' buildbot/buildbot_toolchain_build.py'
186 'precise64-toolchain_arm':
188 ' buildbot/buildbot_toolchain_build.py'
190 ' --test_toolchain nacl_arm_newlib'
193 # BIONIC toolchain builders.
194 'precise64-toolchain_bionic':
196 ' buildbot/buildbot_toolchain_build.py'
198 ' toolchain_build_bionic',
200 # Pnacl toolchain builders.
201 'linux-pnacl-x86_32':
203 ' buildbot/buildbot_pnacl_toolchain.py --buildbot --tests-arch x86-32',
204 'linux-pnacl-x86_64':
206 ' buildbot/buildbot_pnacl_toolchain.py --buildbot --tests-arch x86-64',
209 ' buildbot/buildbot_pnacl_toolchain.py --buildbot',
212 ' buildbot/buildbot_pnacl_toolchain.py --buildbot',
214 # Pnacl toolchain testers
215 'linux-pnacl-x86_64-tests-x86_64':
216 bash + ' buildbot/buildbot_pnacl_toolchain_tests.sh tc-test-bot x86-64',
217 'linux-pnacl-x86_64-tests-x86_32':
218 bash + ' buildbot/buildbot_pnacl_toolchain_tests.sh tc-test-bot x86-32',
219 'linux-pnacl-x86_64-tests-arm':
220 bash + ' buildbot/buildbot_pnacl_toolchain_tests.sh tc-test-bot arm',
222 # MIPS toolchain buildbot.
223 'linux-pnacl-x86_32-tests-mips':
224 bash + ' buildbot/buildbot_toolchain_mips_trusted.sh',
227 'nacl-toolchain-precise64-newlib':
228 bash + ' buildbot/buildbot_toolchain.sh linux',
229 'nacl-toolchain-mac-newlib': bash + ' buildbot/buildbot_toolchain.sh mac',
230 'nacl-toolchain-win7-newlib': 'buildbot\\buildbot_toolchain_win.bat',
231 'nacl-toolchain-precise64-newlib-arm':
233 ' buildbot/buildbot_toolchain_build.py'
235 ' --test_toolchain nacl_arm_newlib'
237 'nacl-toolchain-mac-newlib-arm':
239 ' buildbot/buildbot_toolchain_build.py'
242 'nacl-toolchain-win7-newlib-arm':
244 ' buildbot/buildbot_toolchain_build.py'
247 'nacl-toolchain-precise64-glibc':
248 bash + ' buildbot/buildbot_linux-glibc-makefile.sh',
249 'nacl-toolchain-mac-glibc':
250 bash + ' buildbot/buildbot_mac-glibc-makefile.sh',
251 'nacl-toolchain-win7-glibc':
252 'buildbot\\buildbot_windows-glibc-makefile.bat',
254 # Pnacl toolchain trybots.
255 'nacl-toolchain-linux-pnacl-x86_32':
257 ' buildbot/buildbot_pnacl_toolchain.py --trybot --tests-arch x86-32',
258 'nacl-toolchain-linux-pnacl-x86_64':
260 ' buildbot/buildbot_pnacl_toolchain.py --trybot --tests-arch x86-64',
261 'nacl-toolchain-linux-pnacl-mips': echo + ' "TODO(mseaborn)"',
262 'nacl-toolchain-mac-pnacl-x86_32':
263 python + ' buildbot/buildbot_pnacl_toolchain.py --trybot',
264 'nacl-toolchain-win7-pnacl-x86_64':
265 python + ' buildbot/buildbot_pnacl_toolchain.py --trybot',
278 'vista', 'win7', 'win8', 'win',
279 'mac10.6', 'mac10.7', 'mac10.8',
280 'lucid', 'precise'] + special_for_arm:
281 if platform in special_for_arm:
282 arch_variants = ['arm']
284 arch_variants = ['', '32', '64', 'arm']
285 for arch in arch_variants:
288 arch_part = '-' + arch
289 # Disable GYP build for win32 bots and arm cross-builders. In this case
290 # "win" means Windows XP, not Vista, Windows 7, etc.
292 # Building via GYP always builds all toolchains by default, but the win32
293 # XP pnacl builds are pathologically slow (e.g. ~38 seconds per compile on
294 # the nacl-win32_glibc_opt trybot). There are other builders that test
295 # Windows builds via gyp, so the reduced test coverage should be slight.
296 if arch == 'arm' or (platform == 'win' and arch == '32'):
297 arch_flags += ' --no-gyp'
298 if platform == 'win7' and arch == '32':
299 arch_flags += ' --no-goma'
303 # Test with Breakpad tools only on basic Linux builds.
304 if sys.platform.startswith('linux'):
305 arch_flags += ' --use-breakpad-tools'
306 for mode in ['dbg', 'opt']:
307 for libc in ['newlib', 'glibc']:
309 for bare in ['', '-bare']:
310 name = platform + arch_part + bare + '-' + libc + '-' + mode
311 assert name not in BOT_ASSIGNMENT, name
312 BOT_ASSIGNMENT[name] = (
313 python + ' buildbot/buildbot_standard.py ' +
314 mode + ' ' + real_arch + ' ' + libc + arch_flags)
316 for arch_sep in ['', '-', '_']:
317 name = 'nacl-' + platform + arch_sep + arch + '_' + libc + '_' + mode
318 assert name not in BOT_ASSIGNMENT, name
319 BOT_ASSIGNMENT[name] = (
320 python + ' buildbot/buildbot_standard.py ' +
321 mode + ' ' + real_arch + ' ' + libc + arch_flags)
324 def EscapeJson(data):
325 return '"' + json.dumps(data).replace('"', r'\"') + '"'
329 builder = os.environ.get('BUILDBOT_BUILDERNAME')
330 build_number = os.environ.get('BUILDBOT_BUILDNUMBER')
331 build_revision = os.environ.get('BUILDBOT_GOT_REVISION',
332 os.environ.get('BUILDBOT_REVISION'))
333 slave_type = os.environ.get('BUILDBOT_SLAVE_TYPE')
334 cmd = BOT_ASSIGNMENT.get(builder)
336 sys.stderr.write('ERROR - unset/invalid builder name\n')
339 env = os.environ.copy()
341 # Don't write out .pyc files because in cases in which files move around or
342 # the PYTHONPATH / sys.path change, old .pyc files can be mistakenly used.
343 # This avoids the need for admin changes on the bots in this case.
344 env['PYTHONDONTWRITEBYTECODE'] = '1'
346 # Use .boto file from home-dir instead of buildbot supplied one.
347 if 'AWS_CREDENTIAL_FILE' in env:
348 del env['AWS_CREDENTIAL_FILE']
349 alt_boto = os.path.expanduser('~/.boto')
350 if os.path.exists(alt_boto):
351 env['BOTO_CONFIG'] = alt_boto
352 cwd_drive = os.path.splitdrive(os.getcwd())[0]
353 env['GSUTIL'] = cwd_drive + '/b/build/third_party/gsutil/gsutil'
355 # When running from cygwin, we sometimes want to use a native python.
356 # The native python will use the depot_tools version by invoking python.bat.
357 if pynacl.platform.IsWindows():
358 env['NATIVE_PYTHON'] = 'python.bat'
360 env['NATIVE_PYTHON'] = 'python'
362 if sys.platform == 'win32':
363 # If the temp directory is not on the same drive as the working directory,
364 # there can be random failures when cleaning up temp directories, so use
365 # a directory on the current drive. Use __file__ here instead of os.getcwd()
366 # because toolchain_main picks its working directories relative to __file__
367 filedrive, _ = os.path.splitdrive(__file__)
368 tempdrive, _ = os.path.splitdrive(env['TEMP'])
369 if tempdrive != filedrive:
370 env['TEMP'] = filedrive + '\\temp'
371 env['TMP'] = env['TEMP']
372 if not os.path.exists(env['TEMP']):
373 os.mkdir(env['TEMP'])
375 # Run through runtest.py to get upload of perf data.
377 'buildername': builder,
378 'mastername': 'client.nacl',
379 'buildnumber': str(build_number),
381 factory_properties = {
383 'show_perf_results': True,
384 'step_name': 'naclperf', # Seems unused, but is required.
385 'test_name': 'naclperf', # Really "Test Suite"
387 # Locate the buildbot build directory by relative path, as it's absolute
388 # location varies by platform and configuration.
389 buildbot_build_dir = os.path.join(* [os.pardir] * 4)
390 runtest = os.path.join(buildbot_build_dir, 'scripts', 'slave', 'runtest.py')
391 # For builds with an actual build number, require that the script is present
392 # (i.e. that we're run from an actual buildbot).
393 if build_number is not None and not os.path.exists(runtest):
394 raise Exception('runtest.py script not found at: %s\n' % runtest)
395 cmd_exe = cmd.split(' ')[0]
396 cmd_exe_ext = os.path.splitext(cmd_exe)[1]
397 # Do not wrap these types of builds with runtest.py:
399 # - commands beginning with 'echo '
402 if not (slave_type == 'Trybot' or
404 cmd_exe_ext == '.bat' or
406 # Perf dashboards are now generated by output scraping that occurs in the
407 # script runtest.py, which lives in the buildbot repository.
408 # Non-trybot builds should be run through runtest, allowing it to upload
409 # perf data if relevant.
412 '--revision=' + build_revision,
413 '--build-dir=src/out',
414 '--results-url=https://chromeperf.appspot.com',
415 '--annotate=graphing',
416 '--no-xvfb', # We provide our own xvfb invocation.
417 '--factory-properties', EscapeJson(factory_properties),
418 '--build-properties', EscapeJson(build_properties),
422 print "%s runs: %s\n" % (builder, cmd)
423 retcode = subprocess.call(cmd, env=env, shell=True)
427 if __name__ == '__main__':