[cig-commits] r6993 - cs/buildbot/trunk/buildbot

leif at geodynamics.org leif at geodynamics.org
Tue May 29 17:13:12 PDT 2007


Author: leif
Date: 2007-05-29 17:13:12 -0700 (Tue, 29 May 2007)
New Revision: 6993

Modified:
   cs/buildbot/trunk/buildbot/bs.py
   cs/buildbot/trunk/buildbot/lines.py
Log:
Allow projects to build & test multiple configurations in sequence.
For example, both CitcomS and the SPECFEM codes can be configured as
either Pyrized and non-Pyrized; this allows BuildBot to test both.


Modified: cs/buildbot/trunk/buildbot/bs.py
===================================================================
--- cs/buildbot/trunk/buildbot/bs.py	2007-05-30 00:03:15 UTC (rev 6992)
+++ cs/buildbot/trunk/buildbot/bs.py	2007-05-30 00:13:12 UTC (rev 6993)
@@ -6,13 +6,13 @@
 
 class BuildSystem(object): # BuildFactory?
 
-    def buildSteps(self, buildEnv, config, env, workdir, line):
+    def buildSteps(self, buildEnv, buildConfig, env, workdir, configureArgs, line):
         raise NotImplementedError()
 
-    def configureArgs(self, buildEnv, config, env, line):
+    def configureArgs(self, buildEnv, buildConfig, env, configureArgs, line):
         args = (
-            buildEnv.getConfigureArgs(self, env, config) +
-            line.configureArgs +
+            buildEnv.getConfigureArgs(self, env, buildConfig) +
+            configureArgs +
             line.project.configureArgs[self]
             )
         return args
@@ -21,7 +21,7 @@
 class Make(BuildSystem):
     """simply runs 'make'"""
 
-    def buildSteps(self, buildEnv, config, env, workdir, line):
+    def buildSteps(self, buildEnv, buildConfig, env, workdir, configureArgs, line):
         steps = [
             s(step.Compile,
               command="make all",
@@ -35,9 +35,9 @@
 class GNUBuildSystem(BuildSystem): # a.k.a. Autotools
 
 
-    def buildSteps(self, buildEnv, config, env, workdir, line):
+    def buildSteps(self, buildEnv, buildConfig, env, workdir, configureArgs, line):
         
-        configureArgs = self.configureArgs(buildEnv, config, env, line)
+        configureArgs = self.configureArgs(buildEnv, buildConfig, env, configureArgs, line)
         
         steps = [
             s(step.ShellCommand,
@@ -92,9 +92,9 @@
 class SCons(BuildSystem):
 
 
-    def buildSteps(self, buildEnv, config, env, workdir, line):
+    def buildSteps(self, buildEnv, buildConfig, env, workdir, configureArgs, line):
         
-        configureArgs = self.configureArgs(buildEnv, config, env, line)
+        configureArgs = self.configureArgs(buildEnv, buildConfig, env, configureArgs, line)
         
         steps = [
             s(step.ShellCommand,
@@ -116,7 +116,7 @@
 
 class Distutils(BuildSystem):
 
-    def buildSteps(self, buildEnv, config, env, workdir, line):
+    def buildSteps(self, buildEnv, buildConfig, env, workdir, configureArgs, line):
         steps = [
             s(step.Compile,
               command=["./setup.py", "build"],
@@ -131,9 +131,9 @@
 class ASEBuildSystem(BuildSystem):
     """ANL SIDL Environment (ASE) BuildSystem (used by PETSc)"""
 
-    def buildSteps(self, buildEnv, config, env, workdir, line):
+    def buildSteps(self, buildEnv, buildConfig, env, workdir, configureArgs, line):
 
-        configureArgs = self.configureArgs(buildEnv, config, env, line)
+        configureArgs = self.configureArgs(buildEnv, buildConfig, env, configureArgs, line)
         
         steps = [
             s(step.ShellCommand,
@@ -168,7 +168,7 @@
 class DebugBuildSystem(BuildSystem):
     """for debugging BuildBot"""
 
-    def buildSteps(self, buildEnv, config, env, workdir, line):
+    def buildSteps(self, buildEnv, buildConfig, env, workdir, configureArgs, line):
         steps = [
             s(step.Compile,
               command=["./setup.py", "build"],

Modified: cs/buildbot/trunk/buildbot/lines.py
===================================================================
--- cs/buildbot/trunk/buildbot/lines.py	2007-05-30 00:03:15 UTC (rev 6992)
+++ cs/buildbot/trunk/buildbot/lines.py	2007-05-30 00:13:12 UTC (rev 6993)
@@ -11,11 +11,13 @@
     def __init__(self, name, location, project):
         self.name = name
         self.location = location
-        
+
+        # weakref causes a problem with pickling:
         ## cPickle.UnpickleableError: Cannot pickle <type 'weakproxy'> objects
-        self.project = weakref.proxy(project)
+        # now pickling is disabled, but weakref also breaks Categories...
+        self.project = project #weakref.proxy(project)
         
-        self.configureArgs = []
+        self.configs = {}
         
         self.dependencies = []
         self.scheduler = None
@@ -25,10 +27,10 @@
         return
 
 
-    def newBuilder(self, buildEnv, config, env):
-        buildFactory = self.newBuildFactory(buildEnv, config, env)
+    def newBuilder(self, buildEnv, buildConfig, env):
+        buildFactory = self.newBuildFactory(buildEnv, buildConfig, env)
         builder = {
-            'name'       : self.builderName(buildEnv, config),
+            'name'       : self.builderName(buildEnv, buildConfig),
             'builddir'   : env['BUILDDIR'],
             'factory'    : buildFactory,
             'category'   : Category(project = self.project,
@@ -38,12 +40,30 @@
         return builder
 
 
-    def builderName(self, buildEnv, config):
-        return self.project.name + " " + self.name + " " + buildEnv.configName(config)
+    def builderName(self, buildEnv, buildConfig):
+        return self.project.name + " " + self.name + " " + buildEnv.configName(buildConfig)
 
 
-    def newBuildFactory(self, buildEnv, config, env):
-        steps = self.buildSteps(buildEnv, config, env)
+    def newBuildFactory(self, buildEnv, buildConfig, env):
+        
+        steps = []
+        
+        if self.configs:
+            configs = self.configs
+        else:
+            configs = {"default": []}
+        
+        for config, configureArgs in configs.iteritems():
+            workdir = config
+            steps.append(
+                self.sourceStep(
+                    workdir = workdir,
+                    mode = 'copy', # 'clobber', 'copy', 'update'
+                    )
+                )
+            steps += self.buildSteps(buildEnv, buildConfig, env,
+                                     workdir, configureArgs)
+        
         return BuildFactory(steps)
 
 
@@ -62,28 +82,15 @@
         self._buildSystem = bs
 
 
-    def buildSteps(self, buildEnv, config, env):
-        from buildbot.process import step
-        from buildbot.process.factory import s
-
-        workdir = "build"
-        
-        sourceStep = self.sourceStep(
-            workdir = workdir,
-            mode = 'copy', # 'clobber', 'copy', 'update'
-            )
-
+    def buildSteps(self, buildEnv, buildConfig, env, workdir, configureArgs):
         buildSystem = self.buildSystem()
         buildSteps = buildSystem.buildSteps(
-            buildEnv, config, env,
-            workdir, self
+            buildEnv, buildConfig, env,
+            workdir, configureArgs, self
             )
+        return buildSteps
 
-        steps = [sourceStep] + buildSteps
-            
-        return steps
 
-
     def fullName(self):
         return self.project.name + " " + self.name
 



More information about the cig-commits mailing list