Skip to content

Commit

Permalink
[buildbot] Annotated builder tweaks
Browse files Browse the repository at this point in the history
* Allow bypassing source code checkouts.
  Cloning complete LLVM tree takes 2-3 minutes and not all bots need
  it (e.g. some CUDA bots just need to run tests built somewhere else)

* Allow using out-of-tree annotated scripts.
  This is useful for tinkering with bot operations without having
  to update buildmaster.

Differential Revision: https://reviews.llvm.org/D83503
  • Loading branch information
Artem-B committed Jul 22, 2020
1 parent ec561d2 commit 521b2ce
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions zorg/buildbot/builders/AnnotatedBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ def getAnnotatedBuildFactory(
env=None,
extra_args=None,
timeout=1200,
is_legacy_mode=False):
is_legacy_mode=False,
checkout_llvm_sources=True):
"""
Returns a new build factory that uses AnnotatedCommand, which
allows the build to be run by version-controlled scripts that do
Expand Down Expand Up @@ -76,19 +77,22 @@ def getAnnotatedBuildFactory(
src_dir='llvm-zorg',
alwaysUseLatest=True)

f.addGetSourcecodeSteps()

if checkout_llvm_sources:
f.addGetSourcecodeSteps()

extra_args_with_props = [WithProperties(arg) for arg in extra_args]
# Explicitly use '/' as separator, because it works on *nix and Windows.
script_path = "../llvm-zorg/zorg/buildbot/builders/annotated/%s" % (script)
if script.startswith('/'):
command = [script]
else:
script_path = "../llvm-zorg/zorg/buildbot/builders/annotated/%s" % (script)
command = ["python", script_path, WithProperties("--jobs=%(jobs:-)s")]
command += extra_args_with_props

f.addStep(AnnotatedCommand(name="annotate",
description="annotate",
timeout=timeout,
haltOnFailure=True,
command=["python",
script_path,
WithProperties("--jobs=%(jobs:-)s")]
+ extra_args_with_props,
command=command,
env=merged_env))
return f

0 comments on commit 521b2ce

Please sign in to comment.