OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Set of utilities to add commands to a buildbot factory (BuildFactory). | 5 """Set of utilities to add commands to a buildbot factory (BuildFactory). |
6 | 6 |
7 All the utility functions to add steps to a build factory here are not | 7 All the utility functions to add steps to a build factory here are not |
8 project-specific. See the other *_commands.py for project-specific commands. | 8 project-specific. See the other *_commands.py for project-specific commands. |
9 """ | 9 """ |
10 | 10 |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 # the start of a build. But the kill_processes (taskkill) step has to use | 337 # the start of a build. But the kill_processes (taskkill) step has to use |
338 # the original python.exe, or it kills itself. | 338 # the original python.exe, or it kills itself. |
339 self._python = 'python_slave' | 339 self._python = 'python_slave' |
340 else: | 340 else: |
341 self._python = 'python' | 341 self._python = 'python' |
342 | 342 |
343 self.working_dir = 'build' | 343 self.working_dir = 'build' |
344 self._repository_root = repository_root | 344 self._repository_root = repository_root |
345 | 345 |
346 self._kill_tool = self.PathJoin(self._script_dir, 'kill_processes.py') | 346 self._kill_tool = self.PathJoin(self._script_dir, 'kill_processes.py') |
| 347 self._runhooks_tool = self.PathJoin(self._script_dir, 'runhooks_wrapper.py') |
347 self._compile_tool = self.PathJoin(self._script_dir, 'compile.py') | 348 self._compile_tool = self.PathJoin(self._script_dir, 'compile.py') |
348 self._test_tool = self.PathJoin(self._script_dir, 'runtest.py') | 349 self._test_tool = self.PathJoin(self._script_dir, 'runtest.py') |
349 self._zip_tool = self.PathJoin(self._script_dir, 'zip_build.py') | 350 self._zip_tool = self.PathJoin(self._script_dir, 'zip_build.py') |
350 self._extract_tool = self.PathJoin(self._script_dir, 'extract_build.py') | 351 self._extract_tool = self.PathJoin(self._script_dir, 'extract_build.py') |
351 self._cleanup_temp_tool = self.PathJoin(self._script_dir, 'cleanup_temp.py') | 352 self._cleanup_temp_tool = self.PathJoin(self._script_dir, 'cleanup_temp.py') |
352 self._bot_update_tool = self.PathJoin(self._script_dir, 'bot_update.py') | 353 self._bot_update_tool = self.PathJoin(self._script_dir, 'bot_update.py') |
353 self._resource_sizes_tool = self.PathJoin(self._script_dir, | 354 self._resource_sizes_tool = self.PathJoin(self._script_dir, |
354 'resource_sizes.py') | 355 'resource_sizes.py') |
355 self._gclient_safe_revert_tool = self.PathJoin(self._script_dir, | 356 self._gclient_safe_revert_tool = self.PathJoin(self._script_dir, |
356 'gclient_safe_revert.py') | 357 'gclient_safe_revert.py') |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 chromium_step.AnnotatedCommand, | 958 chromium_step.AnnotatedCommand, |
958 name='bot_update', | 959 name='bot_update', |
959 description='bot_update', | 960 description='bot_update', |
960 haltOnFailure=True, | 961 haltOnFailure=True, |
961 flunkOnFailure=True, | 962 flunkOnFailure=True, |
962 timeout=600, | 963 timeout=600, |
963 workdir=self.working_dir, | 964 workdir=self.working_dir, |
964 command=cmd) | 965 command=cmd) |
965 | 966 |
966 | 967 |
967 def AddRunHooksStep(self, env=None, timeout=None): | 968 def AddRunHooksStep(self, env=None, timeout=None, options=None): |
968 """Adds a step to the factory to run the gclient hooks.""" | 969 """Adds a step to the factory to run the gclient hooks.""" |
969 env = env or {} | 970 env = env or {} |
970 env['LANDMINES_VERBOSE'] = '1' | 971 env['LANDMINES_VERBOSE'] = '1' |
971 env['DEPOT_TOOLS_UPDATE'] = '0' | 972 env['DEPOT_TOOLS_UPDATE'] = '0' |
972 env['CHROMIUM_GYP_SYNTAX_CHECK'] = '1' | 973 env['CHROMIUM_GYP_SYNTAX_CHECK'] = '1' |
973 if timeout is None: | 974 if timeout is None: |
974 timeout = 60*10 | 975 timeout = 60*10 |
| 976 cmd = [self._python, self._runhooks_tool] |
| 977 |
| 978 options = options or {} |
| 979 if ('--compiler=goma' in options or '--compiler=goma-clang' in options or |
| 980 '--compiler=jsonclang' in options): |
| 981 cmd.append('--use-goma') |
| 982 |
975 self._factory.addStep( | 983 self._factory.addStep( |
976 RunHooksShell, | 984 RunHooksShell, |
977 haltOnFailure=True, | 985 haltOnFailure=True, |
978 name='runhooks', | 986 name='runhooks', |
979 description='gclient hooks', | 987 description='gclient hooks', |
980 env=env, | 988 env=env, |
981 locks=[self.slave_exclusive_lock], | 989 locks=[self.slave_exclusive_lock], |
982 timeout=timeout, | 990 timeout=timeout, |
983 command=['gclient', 'runhooks']) | 991 command=cmd) |
984 | 992 |
985 def AddClobberTreeStep(self, gclient_spec, env=None, timeout=None, | 993 def AddClobberTreeStep(self, gclient_spec, env=None, timeout=None, |
986 gclient_deps=None, gclient_nohooks=False, | 994 gclient_deps=None, gclient_nohooks=False, |
987 no_gclient_branch=None): | 995 no_gclient_branch=None): |
988 """This is not for pressing 'clobber' on the waterfall UI page. This is | 996 """This is not for pressing 'clobber' on the waterfall UI page. This is |
989 for clobbering all the sources. Using mode='clobber' causes the entire | 997 for clobbering all the sources. Using mode='clobber' causes the entire |
990 working directory to get moved aside (to build.dead) --OR-- if | 998 working directory to get moved aside (to build.dead) --OR-- if |
991 build.dead already exists, it deletes build.dead. Strange, but true. | 999 build.dead already exists, it deletes build.dead. Strange, but true. |
992 See GClient.doClobber() (for move vs. delete logic) or Gclient.start() | 1000 See GClient.doClobber() (for move vs. delete logic) or Gclient.start() |
993 (for mode='clobber' trigger) in chromium_commands.py. | 1001 (for mode='clobber' trigger) in chromium_commands.py. |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1291 | 1299 |
1292 def commandComplete(self, cmd): | 1300 def commandComplete(self, cmd): |
1293 out = cmd.logs['stdio'].getText() | 1301 out = cmd.logs['stdio'].getText() |
1294 build_properties = re.findall('BUILD_PROPERTY ([^=]*)=(.*)', out) | 1302 build_properties = re.findall('BUILD_PROPERTY ([^=]*)=(.*)', out) |
1295 for propname, value in build_properties: | 1303 for propname, value in build_properties: |
1296 # findall can return strings containing CR characters, remove with strip. | 1304 # findall can return strings containing CR characters, remove with strip. |
1297 self.build.setProperty(propname, value.strip(), 'Step') | 1305 self.build.setProperty(propname, value.strip(), 'Step') |
1298 | 1306 |
1299 def getText(self, cmd, results): | 1307 def getText(self, cmd, results): |
1300 return self.describe(True) + self.messages | 1308 return self.describe(True) + self.messages |
OLD | NEW |