[llvm-commits] [zorg] r143030 - in /zorg/trunk/zorg/buildbot/builders: ClangBuilder.py LLDBBuilder.py
Peter Collingbourne
peter at pcc.me.uk
Wed Oct 26 09:40:18 PDT 2011
Author: pcc
Date: Wed Oct 26 11:40:17 2011
New Revision: 143030
URL: http://llvm.org/viewvc/llvm-project?rev=143030&view=rev
Log:
LLDB builder: clean LLVM only if its revision number changed since
the last build. Otherwise, only clean LLDB.
Modified:
zorg/trunk/zorg/buildbot/builders/ClangBuilder.py
zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py
Modified: zorg/trunk/zorg/buildbot/builders/ClangBuilder.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/ClangBuilder.py?rev=143030&r1=143029&r2=143030&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/ClangBuilder.py (original)
+++ zorg/trunk/zorg/buildbot/builders/ClangBuilder.py Wed Oct 26 11:40:17 2011
@@ -36,6 +36,7 @@
use_pty_in_tests=False,
trunk_revision=None,
force_checkout=False,
+ extra_clean_step=None,
checkout_compiler_rt=False):
# Prepare environmental variables. Set here all env we want everywhere.
merged_env = {
@@ -158,8 +159,12 @@
description="cleaning llvm",
descriptionDone="clean llvm",
workdir=llvm_1_objdir,
+ doStepIf=clean,
env=merged_env))
+ if extra_clean_step:
+ f.addStep(extra_clean_step)
+
f.addStep(WarningCountingShellCommand(name="compile",
command=['nice', '-n', '10',
make, WithProperties("-j%s" % jobs)],
Modified: zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py?rev=143030&r1=143029&r2=143030&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py (original)
+++ zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py Wed Oct 26 11:40:17 2011
@@ -3,11 +3,24 @@
import buildbot
import buildbot.process.factory
from buildbot.steps.source import SVN
-from buildbot.steps.shell import SetProperty, ShellCommand
+from buildbot.steps.shell import SetProperty, ShellCommand, WarningCountingShellCommand
from buildbot.process.properties import WithProperties
import ClangBuilder
+def isNewLLVMRevision(build_status):
+ if build_status.getNumber() == 0:
+ return true
+
+ current_llvmrev = build_status.getProperty('llvmrev')
+ try:
+ prev_build_no = build_status.getNumber()-1
+ prev_build_status = build_status.getBuilder().getBuild(prev_build_no)
+ prev_llvmrev = prev_build_status.getProperty('llvmrev')
+ return prev_llvmrev != current_llvmrev
+ except IndexError:
+ return true
+
def getLLDBBuildFactory(triple, outOfDir=False, useTwoStage=False,
always_install=False, extra_configure_args=[],
*args, **kwargs):
@@ -38,6 +51,20 @@
property='llvmrev',
workdir='%s/tools/lldb' % llvm_srcdir))
+ same_llvmrev = lambda step: not isNewLLVMRevision(step.build.getStatus())
+ new_llvmrev = lambda step: isNewLLVMRevision(step.build.getStatus())
+
+ # Clean LLVM only if its revision number changed since the last build.
+ # Otherwise, only clean LLDB.
+ clean_lldb = \
+ WarningCountingShellCommand(name="clean-lldb",
+ command=['make', "clean"],
+ haltOnFailure=True,
+ description="cleaning lldb",
+ descriptionDone="clean lldb",
+ workdir='%s/tools/lldb' % llvm_1_objdir,
+ doStepIf=same_llvmrev)
+
# We use force_checkout to ensure the initial checkout is not aborted due to
# the presence of the tools/lldb directory
clangf = ClangBuilder.getClangBuildFactory(triple, test=False,
@@ -49,6 +76,8 @@
['--enable-targets=host'],
trunk_revision='%(llvmrev)s',
force_checkout=True,
+ clean=new_llvmrev,
+ extra_clean_step=clean_lldb,
*args, **kwargs)
f.steps += clangf.steps
More information about the llvm-commits
mailing list