[zorg] r176290 - Patch by Dmitri Gribenko!

Galina Kistanova gkistanova at gmail.com
Thu Feb 28 11:25:21 PST 2013


Author: gkistanova
Date: Thu Feb 28 13:25:21 2013
New Revision: 176290

URL: http://llvm.org/viewvc/llvm-project?rev=176290&view=rev
Log:
Patch by Dmitri Gribenko!
Added new builder ClangAndLLDBuilder.py ("llvm-clang-lld-x86_64-debian-fast").

Added:
    zorg/trunk/zorg/buildbot/builders/ClangAndLLDBuilder.py
Modified:
    zorg/trunk/buildbot/osuosl/master/config/builders.py

Modified: zorg/trunk/buildbot/osuosl/master/config/builders.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/buildbot/osuosl/master/config/builders.py?rev=176290&r1=176289&r2=176290&view=diff
==============================================================================
--- zorg/trunk/buildbot/osuosl/master/config/builders.py (original)
+++ zorg/trunk/buildbot/osuosl/master/config/builders.py Thu Feb 28 13:25:21 2013
@@ -38,6 +38,10 @@ from zorg.buildbot.builders import LLDBu
 reload(LLDBBuilder)
 from zorg.buildbot.builders import LLDBuilder
 
+from zorg.buildbot.builders import ClangAndLLDBuilder
+reload(ClangAndLLDBuilder)
+from zorg.buildbot.builders import ClangAndLLDBuilder
+
 from buildbot.steps.source import SVN
 
 # Plain LLVM builders.
@@ -148,10 +152,18 @@ def _get_clang_fast_builders():
         {'name': "clang-x86_64-debian-fast",
          'slavenames':["gribozavr1"],
          'builddir':"clang-x86_64-debian-fast",
-         'factory': ClangBuilder.getClangBuildFactory(env={'PATH':'/home/llvmbb/bin/clang-latest/bin:/home/llvmbb/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games'},
-                                                      stage1_config='Release+Asserts',
-                                                      checkout_compiler_rt=True,
-                                                      outOfDir=True)},
+         'factory': ClangBuilder.getClangBuildFactory(
+                    env={'PATH':'/home/llvmbb/bin/clang-latest/bin:/home/llvmbb/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games'},
+                    stage1_config='Release+Asserts',
+                    checkout_compiler_rt=True,
+                    outOfDir=True)},
+
+        {'name': "llvm-clang-lld-x86_64-debian-fast",
+         'slavenames':["gribozavr1"],
+         'builddir':"llvm-clang-lld-x86_64-debian-fast",
+         'factory': ClangAndLLDBuilder.getClangAndLLDBuildFactory(
+                    env={'PATH':'/home/llvmbb/bin/clang-latest/bin:/home/llvmbb/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games'})},
+
         ]
 
 # Clang builders.

Added: zorg/trunk/zorg/buildbot/builders/ClangAndLLDBuilder.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/ClangAndLLDBuilder.py?rev=176290&view=auto
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/ClangAndLLDBuilder.py (added)
+++ zorg/trunk/zorg/buildbot/builders/ClangAndLLDBuilder.py Thu Feb 28 13:25:21 2013
@@ -0,0 +1,105 @@
+import os
+
+import buildbot
+import buildbot.process.factory
+from buildbot.steps.source import SVN, Git
+from buildbot.steps.shell import Configure, ShellCommand
+from buildbot.steps.shell import WarningCountingShellCommand
+from buildbot.process.properties import WithProperties
+from zorg.buildbot.commands.LitTestCommand import LitTestCommand
+
+def getClangAndLLDBuildFactory(
+           clean=True,
+           env=None):
+
+    llvm_srcdir = "llvm.src"
+    llvm_objdir = "llvm.obj"
+
+    # Prepare environmental variables. Set here all env we want everywhere.
+    merged_env = {
+        'TERM' : 'dumb' # Make sure Clang doesn't use color escape sequences.
+                 }
+    if env is not None:
+        # Overwrite pre-set items with the given ones, so user can set anything.
+        merged_env.update(env)
+
+    f = buildbot.process.factory.BuildFactory()
+
+    # Determine the build directory.
+    f.addStep(buildbot.steps.shell.SetProperty(name="get_builddir",
+                                               command=["pwd"],
+                                               property="builddir",
+                                               description="set build dir",
+                                               workdir=".",
+                                               env=merged_env))
+    # Get LLVM, Clang and LLD.
+    f.addStep(SVN(name='svn-llvm',
+                  mode='update',
+                  baseURL='http://llvm.org/svn/llvm-project/llvm/',
+                  defaultBranch='trunk',
+                  workdir=llvm_srcdir))
+    f.addStep(SVN(name='svn-clang',
+                  mode='update',
+                  baseURL='http://llvm.org/svn/llvm-project/cfe/',
+                  defaultBranch='trunk',
+                  workdir='%s/tools/clang' % llvm_srcdir))
+    f.addStep(SVN(name='svn-clang-tools-extra',
+                  mode='update',
+                  baseURL='http://llvm.org/svn/llvm-project/clang-tools-extra/',
+                  defaultBranch='trunk',
+                  workdir='%s/tools/clang/tools/extra' % llvm_srcdir))
+    f.addStep(SVN(name='svn-lld',
+                  mode='update',
+                  baseURL='http://llvm.org/svn/llvm-project/lld/',
+                  defaultBranch='trunk',
+                  workdir='%s/tools/lld' % llvm_srcdir))
+
+    # Clean directory, if requested.
+    if clean:
+        f.addStep(ShellCommand(name="rm-llvm_objdir",
+                               command=["rm", "-rf", llvm_objdir],
+                               haltOnFailure=True,
+                               description=["rm build dir", "llvm"],
+                               workdir=".",
+                               env=merged_env))
+
+    # Create configuration files with cmake.
+    f.addStep(ShellCommand(name="create-build-dir",
+                               command=["mkdir", "-p", llvm_objdir],
+                               haltOnFailure=False,
+                               description=["create build dir"],
+                               workdir=".",
+                               env=merged_env))
+    cmakeCommand = [
+        "cmake",
+        "-DCMAKE_BUILD_TYPE=Release",
+        "-DLLVM_ENABLE_ASSERTIONS=ON",
+        "-DCMAKE_CXX_FLAGS=\"-std=c++11\"",
+        "-G", "Ninja",
+        "../%s" % llvm_srcdir]
+    # Note: ShellCommand does not pass the params with special symbols right.
+    # The " ".join is a workaround for this bug.
+    f.addStep(ShellCommand(name="cmake-configure",
+                               description=["cmake configure"],
+                               haltOnFailure=True,
+                               command=WithProperties(" ".join(cmakeCommand)),
+                               workdir=llvm_objdir,
+                               env=merged_env))
+
+    # Build everything.
+    f.addStep(WarningCountingShellCommand(name="build",
+                                          command=["nice", "-n", "10", "ninja"],
+                                          haltOnFailure=True,
+                                          description=["build"],
+                                          workdir=llvm_objdir,
+                                          env=merged_env))
+
+    # Test everything.
+    f.addStep(LitTestCommand(name="test",
+                             command=["nice", "-n", "10", "ninja", "check-all"],
+                             haltOnFailure=True,
+                             description=["test"],
+                             workdir=llvm_objdir,
+                             env=merged_env))
+
+    return f





More information about the llvm-commits mailing list