[zorg] r178745 - Added option to the phasedClangBuilder to make the build incremental and added support to builderconstruction to support said build.
Michael Gottesman
mgottesman at apple.com
Wed Apr 3 23:52:05 PDT 2013
Author: mgottesman
Date: Thu Apr 4 01:52:04 2013
New Revision: 178745
URL: http://llvm.org/viewvc/llvm-project?rev=178745&view=rev
Log:
Added option to the phasedClangBuilder to make the build incremental and added support to builderconstruction to support said build.
Modified:
zorg/trunk/buildbot/llvmlab/master/config/builderconstruction.py
zorg/trunk/zorg/buildbot/builders/ClangBuilder.py
zorg/trunk/zorg/buildbot/builders/Util.py
Modified: zorg/trunk/buildbot/llvmlab/master/config/builderconstruction.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/buildbot/llvmlab/master/config/builderconstruction.py?rev=178745&r1=178744&r2=178745&view=diff
==============================================================================
--- zorg/trunk/buildbot/llvmlab/master/config/builderconstruction.py (original)
+++ zorg/trunk/buildbot/llvmlab/master/config/builderconstruction.py Thu Apr 4 01:52:04 2013
@@ -31,8 +31,8 @@ def construct(name):
kind,subname = 'compile',name
if 'lto' in name:
kind += '-lto'
- elif name.startswith('apple-clang'):
- kind,subname = 'buildit',name
+ elif 'incremental' in name:
+ kind += '-incremental'
else:
if '_' not in name:
raise ValueError, "invalid builder name: %r" % name
@@ -66,7 +66,9 @@ def construct(name):
return builder
-def construct_compiler_builder_from_name(name, use_lto=False):
+def construct_compiler_builder_from_name(name, use_lto=False,
+ incremental=False):
+
# Compiler builds are named following:
# <compiler>-<host arch>-<host os>-[<build cc>-]<build style>.
# if <build cc> is unspecified, then the most recent validated build
@@ -113,15 +115,15 @@ def construct_compiler_builder_from_name
config_options = ['--build=%s' % target_triple,
'--host=%s' % target_triple]
- if build_style == 'DA' or build_style == 'DAlto':
+ if build_style in ['DA', 'DAlto', 'DAincremental']:
build_config = "Debug+Asserts"
config_options.extend(['--disable-optimized'])
config_options.extend(['--enable-assertions'])
- elif build_style == 'RA' or build_style == 'RAlto':
+ elif build_style in ['RA', 'RAlto', 'RAincremental']:
build_config = "Release+Asserts"
config_options.extend(['--enable-optimized'])
config_options.extend(['--enable-assertions'])
- elif build_style == 'R' or build_style == 'Rlto':
+ elif build_style in ['R', 'Rlto', 'Rincremental']:
build_config = "Release"
config_options.extend(['--enable-optimized'])
config_options.extend(['--disable-assertions'])
@@ -134,8 +136,9 @@ def construct_compiler_builder_from_name
# build_cc must be set for a bootstrapped compiler
if compiler == 'clang':
return { 'factory' : phasedClang(config_options,
- is_bootstrap = (build_cc is None),
- use_lto=use_lto) }
+ is_bootstrap=(build_cc is None),
+ use_lto=use_lto,
+ incremental=incremental) }
elif compiler == 'llvm-gcc':
# Currently, llvm-gcc builders do their own two-stage build,
# they don't use any prebuilt artifacts.
@@ -230,6 +233,9 @@ def construct_lldb_builder_from_name(nam
def construct_lto_compiler_builder_from_name(name):
return construct_compiler_builder_from_name(name, use_lto=True)
+def construct_incremental_compiler_build_from_name(name):
+ return construct_compiler_builder_from_name(name, incremental=True)
+
def construct_libcxx_builder_from_name(name):
# libcxx builds are named following:
# libcxx_<compiler under test>
@@ -242,6 +248,8 @@ def construct_libcxx_builder_from_name(n
builder_kinds = {
'compile' : construct_compiler_builder_from_name,
'compile-lto' : construct_lto_compiler_builder_from_name,
+ 'compile-incremental' :
+ construct_incremental_compiler_build_from_name,
'lnt' : construct_lnt_builder_from_name,
'lldb' : construct_lldb_builder_from_name,
'libcxx' : construct_libcxx_builder_from_name }
Modified: zorg/trunk/zorg/buildbot/builders/ClangBuilder.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/ClangBuilder.py?rev=178745&r1=178744&r2=178745&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/ClangBuilder.py (original)
+++ zorg/trunk/zorg/buildbot/builders/ClangBuilder.py Thu Apr 4 01:52:04 2013
@@ -632,9 +632,11 @@ def getClangTestsIgnoresFromPath(path, k
return ignores
from zorg.buildbot.PhasedBuilderUtils import getBuildDir, setProperty
+from zorg.buildbot.builders.Util import _did_last_build_fail
from buildbot.steps.source.svn import SVN as HostSVN
-def phasedClang(config_options, is_bootstrap=True, use_lto=False):
+def phasedClang(config_options, is_bootstrap=True, use_lto=False,
+ incremental=False):
# Create an instance of the Builder.
f = buildbot.process.factory.BuildFactory()
# Determine the build directory.
@@ -646,10 +648,18 @@ def phasedClang(config_options, is_boots
workdir=WithProperties('%(builddir)s')))
# Clean the build directory.
clang_build_dir = 'clang-build'
- f.addStep(buildbot.steps.shell.ShellCommand(
- name='rm.clang-build', command=['rm', '-rfv', clang_build_dir],
- haltOnFailure=False, description=['rm dir', clang_build_dir],
- workdir=WithProperties('%(builddir)s')))
+ if incremental:
+ f.addStep(buildbot.steps.shell.ShellCommand(
+ name='rm.clang-build', command=['rm', '-rfv', clang_build_dir],
+ haltOnFailure=False, description=['rm dir', clang_build_dir],
+ workdir=WithProperties('%(builddir)s'),
+ doStepIf=_did_last_build_fail))
+ else:
+ f.addStep(buildbot.steps.shell.ShellCommand(
+ name='rm.clang-build', command=['rm', '-rfv', clang_build_dir],
+ haltOnFailure=False, description=['rm dir', clang_build_dir],
+ workdir=WithProperties('%(builddir)s')))
+
# Cleanup the clang link, which buildbot's SVN always_purge does not know
# (in 8.5 this changed to method='fresh')
# how to remove correctly. If we don't do this, the LLVM update steps will
Modified: zorg/trunk/zorg/buildbot/builders/Util.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/Util.py?rev=178745&r1=178744&r2=178745&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/Util.py (original)
+++ zorg/trunk/zorg/buildbot/builders/Util.py Thu Apr 4 01:52:04 2013
@@ -1,3 +1,6 @@
+
+import buildbot.status.results
+
def getConfigArgs(origname):
name = origname
args = []
@@ -26,3 +29,24 @@ def getConfigArgs(origname):
raise ValueError,'Unknown config name: %r' % origname
return args
+
+def _did_last_build_fail(buildstep):
+ # Grab the build number for the current build.
+ build_number = buildstep.build.build_status.number
+ # If build number is 0, there is no previous build to fail and the build
+ # directory *SHOULD* be clean. So dont clean.
+ if build_number == 0:
+ return False
+
+ # Lookup the status of the last build from the master.
+ builder = buildstep.build.builder
+ previous_build = builder.master.status.getBuilder(builder.name)\
+ .getLastFinishedBuild()
+
+ # If the previous build is None, do a clean build.
+ if previous_build is None:
+ return True
+
+ # If the previous builder did not succeed, do a clean build.
+ return previous_build.getResults() != buildbot.status.results.SUCCESS
+
More information about the llvm-commits
mailing list