OLD | NEW |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2013 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2013 The Native Client 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 logging | 7 import logging |
8 import os | 8 import os |
9 import platform | 9 import platform |
10 import subprocess | 10 import subprocess |
(...skipping 10 matching lines...) Expand all Loading... | |
21 NACL_DIR = os.path.dirname(SCRIPT_DIR) | 21 NACL_DIR = os.path.dirname(SCRIPT_DIR) |
22 TOOLCHAIN_BUILD_DIR = os.path.join(NACL_DIR, 'toolchain_build') | 22 TOOLCHAIN_BUILD_DIR = os.path.join(NACL_DIR, 'toolchain_build') |
23 TOOLCHAIN_BUILD_OUT_DIR = os.path.join(TOOLCHAIN_BUILD_DIR, 'out') | 23 TOOLCHAIN_BUILD_OUT_DIR = os.path.join(TOOLCHAIN_BUILD_DIR, 'out') |
24 | 24 |
25 TEMP_PACKAGES_FILE = os.path.join(TOOLCHAIN_BUILD_OUT_DIR, 'packages.txt') | 25 TEMP_PACKAGES_FILE = os.path.join(TOOLCHAIN_BUILD_OUT_DIR, 'packages.txt') |
26 | 26 |
27 BUILD_DIR = os.path.join(NACL_DIR, 'build') | 27 BUILD_DIR = os.path.join(NACL_DIR, 'build') |
28 PACKAGE_VERSION_DIR = os.path.join(BUILD_DIR, 'package_version') | 28 PACKAGE_VERSION_DIR = os.path.join(BUILD_DIR, 'package_version') |
29 PACKAGE_VERSION_SCRIPT = os.path.join(PACKAGE_VERSION_DIR, 'package_version.py') | 29 PACKAGE_VERSION_SCRIPT = os.path.join(PACKAGE_VERSION_DIR, 'package_version.py') |
30 | 30 |
31 GOMA_PATH = '/b/build/goma' | 31 GOMA_DEFAULT_PATH = '/b/build/goma' |
32 GOMA_PATH = os.environ.get('GOMA_DIR', GOMA_DEFAULT_PATH) | |
32 GOMA_CTL = os.path.join(GOMA_PATH, 'goma_ctl.py') | 33 GOMA_CTL = os.path.join(GOMA_PATH, 'goma_ctl.py') |
34 start_goma = not os.environ.get('NOSTART_GOMA') | |
ukai
2016/11/10 08:01:07
this will be used to let goma start/stop in caller
Yoshisato Yanagisawa
2016/11/10 08:32:38
Done.
| |
33 | 35 |
34 # As this is a buildbot script, we want verbose logging. Note however, that | 36 # As this is a buildbot script, we want verbose logging. Note however, that |
35 # toolchain_build has its own log settings, controlled by its CLI flags. | 37 # toolchain_build has its own log settings, controlled by its CLI flags. |
36 logging.getLogger().setLevel(logging.DEBUG) | 38 logging.getLogger().setLevel(logging.DEBUG) |
37 | 39 |
38 parser = argparse.ArgumentParser(description='PNaCl toolchain buildbot script') | 40 parser = argparse.ArgumentParser(description='PNaCl toolchain buildbot script') |
39 group = parser.add_mutually_exclusive_group() | 41 group = parser.add_mutually_exclusive_group() |
40 group.add_argument('--buildbot', action='store_true', | 42 group.add_argument('--buildbot', action='store_true', |
41 help='Buildbot mode (build and archive the toolchain)') | 43 help='Buildbot mode (build and archive the toolchain)') |
42 group.add_argument('--trybot', action='store_true', | 44 group.add_argument('--trybot', action='store_true', |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 | 136 |
135 | 137 |
136 if host_os != 'win': | 138 if host_os != 'win': |
137 with buildbot_lib.Step('update clang', status): | 139 with buildbot_lib.Step('update clang', status): |
138 buildbot_lib.Command( | 140 buildbot_lib.Command( |
139 context, | 141 context, |
140 [sys.executable, | 142 [sys.executable, |
141 os.path.join( | 143 os.path.join( |
142 NACL_DIR, '..', 'tools', 'clang', 'scripts', 'update.py')]) | 144 NACL_DIR, '..', 'tools', 'clang', 'scripts', 'update.py')]) |
143 | 145 |
144 if use_goma: | 146 if use_goma and start_goma: |
145 buildbot_lib.Command(context, cmd=[sys.executable, GOMA_CTL, 'restart']) | 147 buildbot_lib.Command(context, cmd=[sys.executable, GOMA_CTL, 'restart']) |
146 | 148 |
147 # toolchain_build outputs its own buildbot annotations, so don't use | 149 # toolchain_build outputs its own buildbot annotations, so don't use |
148 # buildbot_lib.Step to run it here. | 150 # buildbot_lib.Step to run it here. |
149 | 151 |
150 # The package_version tools don't have a way to distinguish canonical packages | 152 # The package_version tools don't have a way to distinguish canonical packages |
151 # (i.e. those we want to upload) from non-canonical ones; they only know how to | 153 # (i.e. those we want to upload) from non-canonical ones; they only know how to |
152 # process all the archives that are present. We can't just leave out the | 154 # process all the archives that are present. We can't just leave out the |
153 # the non-canonical packages entirely because they are extracted by the | 155 # the non-canonical packages entirely because they are extracted by the |
154 # package_version tool. | 156 # package_version tool. |
155 # First build only the packages that will be uploaded, and upload them. | 157 # First build only the packages that will be uploaded, and upload them. |
156 RunWithLog(ToolchainBuildCmd(sync=True, extra_flags=['--canonical-only'])) | 158 RunWithLog(ToolchainBuildCmd(sync=True, extra_flags=['--canonical-only'])) |
157 | 159 |
158 if use_goma: | 160 if use_goma and start_goma: |
159 buildbot_lib.Command(context, cmd=[sys.executable, GOMA_CTL, 'stop']) | 161 buildbot_lib.Command(context, cmd=[sys.executable, GOMA_CTL, 'stop']) |
160 | 162 |
161 if args.skip_tests: | 163 if args.skip_tests: |
162 sys.exit(0) | 164 sys.exit(0) |
163 | 165 |
164 if args.buildbot or args.trybot: | 166 if args.buildbot or args.trybot: |
165 # Don't upload packages from the 32-bit linux bot to avoid racing on | 167 # Don't upload packages from the 32-bit linux bot to avoid racing on |
166 # uploading the same packages as the 64-bit linux bot | 168 # uploading the same packages as the 64-bit linux bot |
167 if host_os != 'linux' or pynacl.platform.IsArch64Bit(): | 169 if host_os != 'linux' or pynacl.platform.IsArch64Bit(): |
168 packages.UploadPackages(TEMP_PACKAGES_FILE, args.trybot, args.sanitize) | 170 packages.UploadPackages(TEMP_PACKAGES_FILE, args.trybot, args.sanitize) |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
240 | 242 |
241 if args.buildbot: | 243 if args.buildbot: |
242 trybot_mode = 'false' | 244 trybot_mode = 'false' |
243 else: | 245 else: |
244 trybot_mode = 'true' | 246 trybot_mode = 'true' |
245 | 247 |
246 platform_arg = 'mode-buildbot-tc-' + arch + '-linux' | 248 platform_arg = 'mode-buildbot-tc-' + arch + '-linux' |
247 | 249 |
248 command = ['bash', buildbot_shell, platform_arg, trybot_mode] | 250 command = ['bash', buildbot_shell, platform_arg, trybot_mode] |
249 RunWithLog(command) | 251 RunWithLog(command) |
OLD | NEW |