[zorg] r228599 - Add new build procedure for Ubuntu CMake/ninja llvm-lldb project.

Ying Chen chying at google.com
Mon Feb 9 12:11:59 PST 2015


Author: chying
Date: Mon Feb  9 14:11:59 2015
New Revision: 228599

URL: http://llvm.org/viewvc/llvm-project?rev=228599&view=rev
Log:
Add new build procedure for Ubuntu CMake/ninja llvm-lldb project.

Modified:
    zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py

Modified: zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py?rev=228599&r1=228598&r2=228599&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py (original)
+++ zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py Mon Feb  9 14:11:59 2015
@@ -248,6 +248,113 @@ def getLLDBBuildFactory(
 
     return f
 
+#Cmake bulids on Ubuntu
+#Build command sequnce - cmake, ninja, ninja check-lldb
+def getLLDBUbuntuCMakeBuildFactory(
+            triple,
+            outOfDir=True,
+            jobs='%(jobs)s',
+            extra_configure_args=[],
+            env={},
+            *args,
+            **kwargs):
+
+    if outOfDir:
+        llvm_srcdir = "llvm"
+        llvm_builddir = "build"
+    else:
+        llvm_srcdir = "llvm"
+        llvm_objdir = "llvm"
+
+    f = buildbot.process.factory.BuildFactory()
+
+    # Determine the build directory.
+    f.addStep(SetProperty(name="get_builddir",
+              command=["pwd"],
+              property="builddir",
+              description="set build dir",
+              workdir="."))
+
+    # Find out what version of llvm and clang are needed to build this version
+    # of lldb. Right now we will assume they use the same version.
+    # XXX - could this be done directly on the master instead of the slave?
+    f.addStep(SetProperty(command='svn cat http://llvm.org/svn/llvm-project/lldb/trunk/scripts/build-llvm.pl | grep ^our.*llvm_revision | cut -d \\" -f 2',
+                          property='llvmrev'))
+
+    # The SVN build step provides no mechanism to check out a specific revision
+    # based on a property, so just run the commands directly here.
+
+    svn_co = ['svn', 'checkout', '--force']
+    svn_co += ['--revision', WithProperties('%(llvmrev)s')]
+
+    # build llvm svn checkout command
+    svn_co_llvm = svn_co + \
+     [WithProperties('http://llvm.org/svn/llvm-project/llvm/trunk@%(llvmrev)s'),
+                     llvm_srcdir]
+    # build clang svn checkout command
+    svn_co_clang = svn_co + \
+     [WithProperties('http://llvm.org/svn/llvm-project/cfe/trunk@%(llvmrev)s'),
+                     '%s/tools/clang' % llvm_srcdir]
+
+    f.addStep(ShellCommand(name='svn-llvm',
+                           command=svn_co_llvm,
+                           haltOnFailure=True,
+                           workdir='.'))
+    f.addStep(ShellCommand(name='svn-clang',
+                           command=svn_co_clang,
+                           haltOnFailure=True,
+                           workdir='.'))
+
+    f.addStep(SVN(name='svn-lldb',
+                  mode='update',
+                  baseURL='http://llvm.org/svn/llvm-project/lldb/',
+                  defaultBranch='trunk',
+                  always_purge=True,
+                  workdir='%s/tools/lldb' % llvm_srcdir))
+
+    # Run configure
+    config_args = ["cmake",
+ 		   "-GNinja",
+		   "-DCMAKE_C_COMPILER=clang",
+		   "-DCMAKE_CXX_COMPILER=clang++",
+  		   "-DCMAKE_BUILD_TYPE=Debug",
+                   WithProperties("../%s" %llvm_srcdir),
+                  ]
+    if triple:
+        config_args += ['--build=%s' % triple]
+    config_args += extra_configure_args
+    
+    # Clean Build Folder
+    f.addStep(ShellCommand(name="clean",
+                             command="rm -rf *",
+                             description="clear build folder",
+                             env=env,
+                             workdir='%s' % llvm_builddir))
+    
+    # Configure
+    f.addStep(Configure(name='configure/cmake',
+        command=config_args,
+        env=env,
+        workdir=llvm_builddir))
+    # Compile
+    f.addStep(WarningCountingShellCommand(name="compile/ninja",
+                                          command=['nice', '-n', '10',
+                                                   'ninja', WithProperties("-j%s" % jobs)],
+                                          env=env,
+                                          haltOnFailure=True,
+                                          workdir=llvm_builddir))
+
+    # Test.
+    f.addStep(LitTestCommand(name="test lldb",
+                             command=['nice', '-n', '10',
+                                      'ninja',
+                                      'check-lldb'],
+                             description="test lldb",
+                             env=env,
+                             workdir='%s' % llvm_builddir))
+
+    return f
+
 def getLLDBxcodebuildFactory(use_cc=None):
     f = buildbot.process.factory.BuildFactory()
     f.addStep(SetProperty(name='get_builddir',





More information about the llvm-commits mailing list