[llvm-commits] [zorg] r86518 - in /zorg/trunk: buildbot/smooshlab/master/master.cfg zorg/buildbot/builders/LLVMGCCBuilder.py

Daniel Dunbar daniel at zuster.org
Sun Nov 8 21:36:42 PST 2009


Author: ddunbar
Date: Sun Nov  8 23:36:42 2009
New Revision: 86518

URL: http://llvm.org/viewvc/llvm-project?rev=86518&view=rev
Log:
Update LLVMGCC builder to support two stage build.

Modified:
    zorg/trunk/buildbot/smooshlab/master/master.cfg
    zorg/trunk/zorg/buildbot/builders/LLVMGCCBuilder.py

Modified: zorg/trunk/buildbot/smooshlab/master/master.cfg
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/buildbot/smooshlab/master/master.cfg?rev=86518&r1=86517&r2=86518&view=diff

==============================================================================
--- zorg/trunk/buildbot/smooshlab/master/master.cfg (original)
+++ zorg/trunk/buildbot/smooshlab/master/master.cfg Sun Nov  8 23:36:42 2009
@@ -4,8 +4,15 @@
 Top level build bot configuration file.
 """
 
-# We can't use the sys.path trick here because this gets run in a
-# sandbox. Require the user to set PYTHONPATH.
+# Expect llvm_zorg to be checked out at the top level.
+import os, sys
+path = os.path.join(os.environ.get('HOME'), 'llvm_zorg', 'buildbot')
+if path not in sys.path:
+  sys.path.append(path)
+path = os.path.join(os.environ.get('HOME'), 'llvm_zorg')
+if path not in sys.path:
+  sys.path.append(path)
+
 import zorg
 import zorg.buildbot
 import smooshlab
@@ -20,7 +27,7 @@
 
 ####### BUILDSLAVES
 
-# the 'slaves' list defines the set of allowable buildslaves. Each element is
+# The 'slaves' list defines the set of allowable buildslaves. Each element is
 # a tuple of bot-name and bot-password. These correspond to values given to
 # the buildslave's mktap invocation.
 from buildbot.buildslave import BuildSlave
@@ -81,9 +88,19 @@
                        'factory' : ClangBuilder.getClangBuildFactory('x86_64-apple-darwin10')})
 
 c['builders'].append({ 'slavenames' : ['giles'],
-                       'name' : "llvmgcc",
-                       'builddir' : "llvmgcc",
-                       'factory' : LLVMGCCBuilder.getLLVMGCCBuildFactory()})
+                       'name' : "llvmgcc-i686-darwin10",
+                       'builddir' : "llvmgcc-i686-darwin10",
+                       'factory' : LLVMGCCBuilder.getLLVMGCCBuildFactory(16,
+                                                                         triple='i686-apple-darwin10',
+                                                                         gxxincludedir='/usr/include/c++/4.2.1',
+                                                                         useTwoStage=False)})
+
+c['builders'].append({ 'slavenames' : ['giles'],
+                       'name' : "llvmgcc-x86_64-darwin10-selfhost",
+                       'builddir' : "llvmgcc-x86_64-darwin10-selfhost",
+                       'factory' : LLVMGCCBuilder.getLLVMGCCBuildFactory(16,
+                                                                         triple='x86_64-apple-darwin10',
+                                                                         gxxincludedir='/usr/include/c++/4.2.1')})
 
 c['builders'].append({ 'slavenames' : ['giles'],
                        'name' : "nnt",

Modified: zorg/trunk/zorg/buildbot/builders/LLVMGCCBuilder.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/LLVMGCCBuilder.py?rev=86518&r1=86517&r2=86518&view=diff

==============================================================================
--- zorg/trunk/zorg/buildbot/builders/LLVMGCCBuilder.py (original)
+++ zorg/trunk/zorg/buildbot/builders/LLVMGCCBuilder.py Sun Nov  8 23:36:42 2009
@@ -4,161 +4,224 @@
 from buildbot.steps.shell import ShellCommand, SetProperty
 from buildbot.process.properties import WithProperties
 
-from zorg.buildbot.commands.DejaGNUCommand import DejaGNUCommand
-from zorg.buildbot.commands.GTestCommand import GTestCommand
+from zorg.buildbot.commands.ClangTestCommand import ClangTestCommand
 
-def getLLVMGCCBuildFactory(checkoutLLVMTest=False):
+def getLLVMGCCBuildFactory(jobs=1, update=True, clean=True,
+                           gxxincludedir=None, triple=None,
+                           useTwoStage=True):
   f = buildbot.process.factory.BuildFactory()
 
   # Determine the build directory.
-  f.addStep(SetProperty(name="get_builddir", command=["pwd"], property="builddir",
-                        description="set build dir",
-                        workdir="."))
-
-  # Clean up.
-  if True:
-    f.addStep(ShellCommand(name="remove llvm build",
+  f.addStep(buildbot.steps.shell.SetProperty(name="get_builddir",
+                                             command=["pwd"],
+                                             property="builddir",
+                                             description="set build dir",
+                                             workdir="."))
+
+  # Get the sources.
+  if update:
+    f.addStep(SVN(name='svn-llvm',
+                  mode='update', baseURL='http://llvm.org/svn/llvm-project/llvm/',
+                  defaultBranch='trunk',
+                  workdir="llvm.src"))
+    f.addStep(SVN(name='svn-llvm-gcc',
+                  mode='update', baseURL='http://llvm.org/svn/llvm-project/llvm-gcc-4.2/',
+                  defaultBranch='trunk',
+                  workdir="llvm-gcc.src"))
+
+  # Clean up llvm (stage 1).
+  if clean:
+    f.addStep(ShellCommand(name="rm-llvm.obj.stage1",
                            command=["rm", "-rf", "llvm.obj"],
                            haltOnFailure=True,
-                           description="rm llvm build dir",
+                           description=["rm build dir",
+                                        "llvm",
+                                        "(stage 1)"],
                            workdir="."))
-    f.addStep(ShellCommand(name="remove llvm install",
-                           command=["rm", "-rf", "llvm.install"],
-                           haltOnFailure=True,
-                           description="rm llvm install dir",
-                           workdir="."))
-    f.addStep(ShellCommand(name="remove llvm-gcc build",
+
+  # Configure llvm (stage 1).
+  base_llvm_configure_args = [WithProperties("%(builddir)s/llvm.src/configure")]
+  if triple:
+    base_llvm_configure_args.append('--build=' + triple)
+    base_llvm_configure_args.append('--host=' + triple)
+    base_llvm_configure_args.append('--target=' + triple)
+  f.addStep(Configure(name='configure.llvm.stage1',
+                      command=base_llvm_configure_args + 
+                              ["--without-llvmgcc",
+                               "--without-llvmgxx"],
+                      description=["configure",
+                                   "llvm",
+                                   "(stage 1)"],
+                      workdir="llvm.obj"))
+
+  # Build llvm (stage 1).
+  f.addStep(WarningCountingShellCommand(name = "compile.llvm.stage1",
+                                        command = "nice -n 10 make -j%d" % jobs,
+                                        haltOnFailure = True,
+                                        description=["compile",
+                                                     "llvm",
+                                                     "(stage 1)",
+                                                     "Debug"],
+                                        workdir="llvm.obj"))
+
+  # Run LLVM tests (stage 1).
+  f.addStep(ClangTestCommand(name = 'test.llvm.stage1',
+                             command = ["make", "check-lit", "VERBOSE=1"],
+                             description = ["testing", "llvm"],
+                             descriptionDone = ["test", "llvm"],
+                             workdir = 'llvm.obj'))
+
+  # Clean up llvm-gcc.
+  if clean:
+    f.addStep(ShellCommand(name="rm-llvm-gcc.obj.stage1",
                            command=["rm", "-rf", "llvm-gcc.obj"],
-                           haltOnFailure=True,
-                           description="rm llvm-gcc build dir",
+                           haltOnFailure = True,
+                           description=["rm build dir",
+                                        "llvm-gcc"],
                            workdir="."))
-    f.addStep(ShellCommand(name="remove llvm-gcc install",
+
+  # Configure llvm-gcc.
+  base_llvmgcc_configure_args = ["../llvm-gcc.src/configure",
+                                 "--enable-languages=c,c++"]
+  if gxxincludedir:
+    base_llvmgcc_configure_args.append('--with-gxx-include-dir=' + gxxincludedir)
+  if triple:
+    base_llvmgcc_configure_args.append('--build=' + triple)
+    base_llvmgcc_configure_args.append('--host=' + triple)
+    base_llvmgcc_configure_args.append('--target=' + triple)
+  f.addStep(Configure(name='configure.llvm-gcc.stage1',
+                      command=(base_llvmgcc_configure_args +
+                               ["--program-prefix=llvm-",
+                                WithProperties("--prefix=%(builddir)s/llvm-gcc.install"),                      
+                                WithProperties("--enable-llvm=%(builddir)s/llvm.obj")]),
+                      haltOnFailure = True,
+                      description=["configure",
+                                   "llvm-gcc",
+                                   "(stage 1)"],
+                      workdir="llvm-gcc.obj"))
+
+  # Build llvm-gcc.
+  f.addStep(WarningCountingShellCommand(name="compile.llvm-gcc.stage1",
+                                        command="nice -n 10 make -j%d" % jobs,
+                                        haltOnFailure=True,
+                                        description=["compile",
+                                                     "llvm-gcc"],
+                                        workdir="llvm-gcc.obj"))
+
+  # Clean up llvm-gcc install.
+  if clean:
+    f.addStep(ShellCommand(name="rm-llvm-gcc.install.stage1",
                            command=["rm", "-rf", "llvm-gcc.install"],
-                           haltOnFailure=True,
-                           description="rm llvm-gcc install dir",
+                           haltOnFailure = True,
+                           description=["rm install dir",
+                                        "llvm-gcc"],
                            workdir="."))
 
-  # Reset svn directories.
-  f.addStep(ShellCommand(name="revert llvm",
-                         command=["svn", "revert", "-R", "llvm.src"],
-                         haltOnFailure=False,
-                         description="revert llvm src dir",
-                         workdir="."))
-  f.addStep(ShellCommand(name="revert llvm-gcc",
-                         command=["svn", "revert", "-R", "llvm-gcc.src"],
-                         haltOnFailure=False,
-                         description="revert llvm-gcc src dir",
-                         workdir="."))
-  if checkoutLLVMTest:
-    f.addStep(ShellCommand(name="revert llvm-test",
-                           command=["svn", "revert", "-R", "llvm.src/projects/llvm-test"],
-                           haltOnFailure=False,
-                           description="revert llvm-gcc src dir",
+  # Install llvm-gcc.
+  f.addStep(WarningCountingShellCommand(name="install.llvm-gcc.stage1",
+                                        command="nice -n 10 make install",
+                                        haltOnFailure=True,
+                                        description=["install",
+                                                     "llvm-gcc"],
+                                        workdir="llvm-gcc.obj"))
+
+  # We are done if not doing a two-stage build.
+  if not useTwoStage:
+    return f
+
+  # Clean up llvm (stage 2).
+  if clean:
+    f.addStep(ShellCommand(name="rm-llvm.obj.stage2",
+                           command=["rm", "-rf", "llvm.obj.2"],
+                           haltOnFailure=True,
+                           description=["rm build dir",
+                                        "llvm",
+                                        "(stage 2)"],
                            workdir="."))
-  
-  # Get the sources.
-  f.addStep(SVN(name='svn-llvm',
-                mode='update', baseURL='http://llvm.org/svn/llvm-project/llvm/', 
-                defaultBranch='trunk',
-                workdir="llvm.src"))
-  f.addStep(SVN(name='svn-llvm-gcc',
-                mode='update', baseURL='http://llvm.org/svn/llvm-project/llvm-gcc-4.2/', 
-                defaultBranch='trunk',
-                workdir="llvm-gcc.src"))
-  if checkoutLLVMTest:
-    f.addStep(SVN(name='svn-llvm-test',
-                  mode='update', baseURL='http://llvm.org/svn/llvm-project/test-suite/', 
-                  defaultBranch='trunk',
-                  workdir="llvm.src/projects/llvm-test"))
 
-  # Configure, build, and install LLVM.
-  f.addStep(Configure(name="configure llvm",
-                      command=[WithProperties("%(builddir)s/llvm.src/configure"),
-                               WithProperties("--prefix=%(builddir)s/llvm.install"),
-                               "--enable-optimized"],
-                      haltOnFailure=True,
-                      workdir="llvm.obj",
-                      description=['configuring llvm', 'Release'],
-                      descriptionDone=['configure llvm', 'Release']))
-  f.addStep(WarningCountingShellCommand(name="compile llvm", 
-                                        command=WithProperties("make -j%(jobs)d"), 
-                                        haltOnFailure=True, 
-                                        description="compiling(llvm)", 
-                                        descriptionDone="compile(llvm)",
-                                        workdir=WithProperties("%(builddir)s/llvm.obj")))
-  f.addStep(ShellCommand(name="install llvm", 
-                         command=WithProperties("make -j%(jobs)d install"), 
-                         haltOnFailure=True, 
-                         description="installing(llvm)", 
-                         descriptionDone="install(llvm)",
-                         workdir=WithProperties("%(builddir)s/llvm.obj")))
-
-  # Configure, build, and install llvm-gcc.
-  f.addStep(Configure(name="configure llvm-gcc",
-                      command=[WithProperties("%(builddir)s/llvm-gcc.src/configure"),
-                               WithProperties("--prefix=%(builddir)s/llvm-gcc.install"),
-                               "--enable-optimized",
-                               WithProperties("--enable-llvm=%(builddir)s/llvm.obj"),
-                               "--enable-languages=c,c++,objc,obj-c++"],
-                      haltOnFailure=True,
-                      workdir=WithProperties("%(builddir)s/llvm-gcc.obj"),
-                      description=['configuring llvm-gcc'],
-                      descriptionDone=['configure llvm-gcc']))
-  f.addStep(WarningCountingShellCommand(name="compile llvm-gcc", 
-                                        command=WithProperties("make -j%(jobs)d VERBOSE=1"), 
-                                        haltOnFailure=True, 
-                                        description="compiling(llvm-gcc)", 
-                                        descriptionDone="compile(llvm-gcc)",
-                                        workdir=WithProperties("%(builddir)s/llvm-gcc.obj")))
-  f.addStep(ShellCommand(name="install llvm-gcc", 
-                         command=WithProperties("make install"), 
-                         haltOnFailure=True, 
-                         description="installing(llvm-gcc)", 
-                         descriptionDone="install(llvm-gcc)",
-                         workdir=WithProperties("%(builddir)s/llvm-gcc.obj")))
-
-  # Symlink for libstdc++.
-  f.addStep(ShellCommand(name="ln-stdc++", 
-                         command=["ln", "-sf",
-                                  WithProperties("/usr/lib/libstdc++.6.dylib"),
-                                  WithProperties("%(builddir)s/llvm-gcc.install/lib/")],
-                         haltOnFailure=True,
-                         workdir="."))
-  f.addStep(ShellCommand(name="ln-gcc", 
-                         command=["ln", "-sf",
-                                  WithProperties("%(builddir)s/llvm-gcc.install/bin/gcc"),
-                                  WithProperties("%(builddir)s/llvm-gcc.install/bin/llvm-gcc")],
-                         haltOnFailure=True,
-                         workdir="."))
-  f.addStep(ShellCommand(name="ln-g++", 
-                         command=["ln", "-sf",
-                                  WithProperties("%(builddir)s/llvm-gcc.install/bin/g++"),
-                                  WithProperties("%(builddir)s/llvm-gcc.install/bin/llvm-g++")],
-                         haltOnFailure=True,
-                         workdir="."))
-
-  # Reconfigure to pick up our fresh llvm-gcc.
-  f.addStep(Configure(name="reconfigure llvm",
-                      command=[WithProperties("%(builddir)s/llvm.src/configure"),
-                               WithProperties("--prefix=%(builddir)s/llvm.install"),
-                               "--enable-optimized",
-                               WithProperties("--with-llvmgccdir=%(builddir)s/llvm-gcc.install")],
+  # Configure llvm (stage 2).
+  f.addStep(Configure(name="configure.llvm.stage2",
+                      command=base_llvm_configure_args + 
+                              ["--enable-optimized",
+                               WithProperties("--with-llvmgcc=%(builddir)s/llvm-gcc.install/bin/llvm-gcc"),
+                               WithProperties("--with-llvmgxx=%(builddir)s/llvm-gcc.install/bin/llvm-g++")],
+                      env={'CC' : WithProperties("%(builddir)s/llvm-gcc.install/bin/llvm-gcc"),
+                           'CXX' :  WithProperties("%(builddir)s/llvm-gcc.install/bin/llvm-g++"),},
                       haltOnFailure=True,
-                      workdir=WithProperties("%(builddir)s/llvm.obj"),
-                      description=['reconfiguring llvm', 'Release'],
-                      descriptionDone=['reconfigure llvm', 'Release']))
-
-  # FIXME: These includes are machine specific, should be a parameter.
-  f.addStep(DejaGNUCommand(name='test-llvm',
-                           command=["make", "check",
-                                    "EXTRA_OPTIONS=-fstrict-aliasing -Wstrict-aliasing -I/usr/include/c++/4.0.0/i686-apple-darwin9 -I/usr/include/c++/4.0.0",
-                                    "IGNORE_TESTS=ocaml.exp llvm2cpp.exp llvmc.exp"],
-                           description="dejagnu (llvm)", 
-                           workdir='llvm.obj'))
-
-  f.addStep(GTestCommand(name="unittest-llvm", 
-                         command=["make", "unittests"],
-                         description="unittests (llvm)", 
-                         workdir="llvm.obj"))
+                      workdir="llvm.obj.2",
+                      description=["configure",
+                                   "llvm",
+                                   "(stage 2)",
+                                   "Release"]))
+
+  # Build LLVM (stage 2).
+  f.addStep(WarningCountingShellCommand(name = "compile.llvm.stage2",
+                                        command = "nice -n 10 make -j%d" % jobs,
+                                        haltOnFailure = True,
+                                        description=["compile",
+                                                     "llvm",
+                                                     "(stage 2)",
+                                                     "Release"],
+                                        workdir="llvm.obj.2"))
+
+  # Run LLVM tests (stage 2).
+  f.addStep(ClangTestCommand(name = 'test.llvm.stage2',
+                             command = ["make", "check-lit", "VERBOSE=1"],
+                             description = ["testing", "llvm", "(stage 2)"],
+                             descriptionDone = ["test", "llvm", "(stage 2)"],
+                             workdir = 'llvm.obj.2'))
+
+  # Clean up llvm-gcc (stage 2).
+  if clean:
+    f.addStep(ShellCommand(name="rm-llvm-gcc.obj.stage2",
+                           command=["rm", "-rf", "llvm-gcc.obj.2"],
+                           haltOnFailure = True,
+                           description=["rm build dir",
+                                        "llvm-gcc",
+                                        "(stage 2)"],
+                           workdir="."))
+
+  # Configure llvm-gcc (stage 2).
+  f.addStep(Configure(name = 'configure.llvm-gcc.stage2',
+                      command=base_llvmgcc_configure_args + [
+                               "--program-prefix=llvm.2-",
+                               WithProperties("--prefix=%(builddir)s/llvm-gcc.install.2"),
+                               WithProperties("--enable-llvm=%(builddir)s/llvm.obj.2")],
+                      env={'CC' : WithProperties("%(builddir)s/llvm-gcc.install/bin/llvm-gcc"),
+                           'CXX' :  WithProperties("%(builddir)s/llvm-gcc.install/bin/llvm-g++"),},
+                      haltOnFailure = True,
+                      description=["configure",
+                                   "llvm-gcc",
+                                   "(stage 2)"],
+                      workdir="llvm-gcc.obj.2"))
+
+  # Build llvm-gcc (stage 2).
+  f.addStep(WarningCountingShellCommand(name="compile.llvm-gcc.stage2",
+                                        command="nice -n 10 make -j%d" % jobs,
+                                        haltOnFailure=True,
+                                        description=["compile",
+                                                     "llvm-gcc",
+                                                     "(stage 2)"],
+                                        workdir="llvm-gcc.obj.2"))
+
+  # Clean up llvm-gcc install (stage 2).
+  if clean:
+    f.addStep(ShellCommand(name="rm-llvm-gcc.install.stage2",
+                           command=["rm", "-rf", "llvm-gcc.install.2"],
+                           haltOnFailure = True,
+                           description=["rm install dir",
+                                        "llvm-gcc",
+                                        "(stage 2)"],
+                           workdir="."))
+
+  # Install llvm-gcc.
+  f.addStep(WarningCountingShellCommand(name="install.llvm-gcc.stage2",
+                                        command="nice -n 10 make",
+                                        haltOnFailure=True,
+                                        description=["install",
+                                                     "llvm-gcc",
+                                                     "(stage 2)"],
+                                        workdir="llvm-gcc.obj.2"))
+
   return f
 





More information about the llvm-commits mailing list