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.
6 """Main entry point for toolchain_build buildbots.
8 Passes its arguments to toolchain_build.py.
17 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
18 NACL_DIR = os.path.dirname(SCRIPT_DIR)
19 BUILD_DIR = os.path.join(NACL_DIR, 'build')
20 TOOLCHAIN_BUILD_DIR = os.path.join(NACL_DIR, 'toolchain_build')
21 TOOLCHAIN_BUILD_OUT_DIR = os.path.join(TOOLCHAIN_BUILD_DIR, 'out')
23 TEMP_PACKAGES_FILE = os.path.join(TOOLCHAIN_BUILD_OUT_DIR, 'packages.txt')
25 build_name = sys.argv[1]
26 bot_type = sys.argv[2]
28 build_script = os.path.join(NACL_DIR, 'toolchain_build', build_name + '.py')
29 if not os.path.isfile(build_script):
30 print 'Error - Unknown build script: %s' % build_script
33 if sys.platform == 'win32':
34 print '@@@BUILD_STEP install mingw@@@'
36 subprocess.check_call([os.path.join(NACL_DIR, 'buildbot', 'mingw_env.bat')])
38 print '@@@BUILD_STEP run_pynacl_tests.py@@@'
40 subprocess.check_call([
41 sys.executable, os.path.join(NACL_DIR, 'pynacl', 'run_pynacl_tests.py')])
43 # Toolchain build emits its own annotator stages.
45 subprocess.check_call([sys.executable,
47 '--packages-file', TEMP_PACKAGES_FILE]
50 if bot_type == '--buildbot' or bot_type == '--trybot':
51 packages.UploadPackages(TEMP_PACKAGES_FILE, bot_type == '--trybot')