[zorg] r229534 - Refine getLLDBUbuntuCMakeBuildFactory function based on code review feedback

Ying Chen chying at google.com
Tue Feb 17 12:28:45 PST 2015


Author: chying
Date: Tue Feb 17 14:28:44 2015
New Revision: 229534

URL: http://llvm.org/viewvc/llvm-project?rev=229534&view=rev
Log:
Refine getLLDBUbuntuCMakeBuildFactory function based on code review feedback
Change signature of caller function to match
Summary:
Format with PEP8 rules
Correct get source procedure
Changed arguments to accept both of gcc and clang

Test Plan:
Bring up buildbot master on local workstation
Create slave and connect to loacl master
Monitor build status

Reviewers: sivachandra, ovyalov, chaoren

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D7599

Modified:
    zorg/trunk/buildbot/osuosl/master/config/builders.py
    zorg/trunk/zorg/buildbot/builders/LLDBBuilder.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=229534&r1=229533&r2=229534&view=diff
==============================================================================
--- zorg/trunk/buildbot/osuosl/master/config/builders.py (original)
+++ zorg/trunk/buildbot/osuosl/master/config/builders.py Tue Feb 17 14:28:44 2015
@@ -678,12 +678,13 @@ def _get_lldb_builders():
                         '--enable-optimized',
                         '--enable-assertions'],
                     env={'SHELL':"/bin/bash"})},
-        {'name': "lldb-x86_64-ubuntu-14.04",
+        {'name': "lldb-x86_64-ubuntu-14.04-cmake",
          'slavenames': ["lldb-build1-ubuntu-1404"],
          'builddir': "buildWorkingDir",
          'factory': LLDBBuilder.getLLDBUbuntuCMakeBuildFactory(
-                    triple=None,
-                    extra_configure_args=[],
+                    build_compiler="clang",
+                    test_compiler="clang",
+                    build_type="Debug",
                     env={'SHELL':"/bin/bash"})},
        ]
 

Modified: zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py?rev=229534&r1=229533&r2=229534&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py (original)
+++ zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py Tue Feb 17 14:28:44 2015
@@ -251,91 +251,59 @@ def getLLDBBuildFactory(
 #Cmake bulids on Ubuntu
 #Build command sequnce - cmake, ninja, ninja check-lldb
 def getLLDBUbuntuCMakeBuildFactory(
-            triple,
-            outOfDir=True,
+            build_compiler,
+            test_compiler,
+            build_type,
             jobs='%(jobs)s',
-            extra_configure_args=[],
-            env={},
+            env=None,
             *args,
             **kwargs):
 
-    if outOfDir:
-        llvm_srcdir = "llvm"
-        llvm_builddir = "build"
-    else:
-        llvm_srcdir = "llvm"
-        llvm_objdir = "llvm"
+    if env is None:
+        env={}
+
+    llvm_srcdir = "llvm"
+    llvm_builddir = "build"
 
     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
+                          command=["pwd"],
+                          property="builddir",
+                          description="set build dir",
+                          workdir="."))
+    # Get source code
+    f = getLLDBSource(f,llvm_srcdir)
+
+    # Construct cmake
+    cmake_args = ["cmake", "-GNinja"]
+    if build_compiler == "clang":
+        cmake_args.append("-DCMAKE_C_COMPILER=clang")
+        cmake_args.append("-DCMAKE_CXX_COMPILER=clang++")
+    elif build_compiler == "gcc":
+        cmake_args.append("-DCMAKE_C_COMPILER=gcc")
+        cmake_args.append("-DCMAKE_CXX_COMPILER=g++")
+
+    if test_compiler == "clang":
+        cmake_args.append("-DLLDB_TEST_COMPILER=clang")
+    elif test_compiler == "gcc":
+        cmake_args.append("-DLLDB_TEST_COMPILER=gcc")
+
+    cmake_args.append(WithProperties("-DCMAKE_BUILD_TYPE=%s" % build_type))
+    cmake_args.append(WithProperties("../%s" % llvm_srcdir))
 
     # Clean Build Folder
     f.addStep(ShellCommand(name="clean",
-                             command="rm -rf *",
-                             description="clear build folder",
-                             env=env,
-                             workdir='%s' % llvm_builddir))
-
+                           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))
+                        command=cmake_args,
+                        env=env,
+                        workdir=llvm_builddir))
     # Compile
     f.addStep(WarningCountingShellCommand(name="compile/ninja",
                                           command=['nice', '-n', '10',
@@ -343,8 +311,7 @@ def getLLDBUbuntuCMakeBuildFactory(
                                           env=env,
                                           haltOnFailure=True,
                                           workdir=llvm_builddir))
-
-    # Test.
+    # Test
     f.addStep(LitTestCommand(name="test lldb",
                              command=['nice', '-n', '10',
                                       'ninja',
@@ -352,7 +319,6 @@ def getLLDBUbuntuCMakeBuildFactory(
                              description="test lldb",
                              env=env,
                              workdir='%s' % llvm_builddir))
-
     return f
 
 def getLLDBxcodebuildFactory(use_cc=None):





More information about the llvm-commits mailing list