[Buildbot-devel] can't get my subclass to work!

Ed Hartnett ed at unidata.ucar.edu
Wed Jan 21 22:36:38 UTC 2004


Howdy all!

I am trying to get buildbot to get a tagged release from CVS, instead
of the tip.

Here's a class I came up with:

# This is subclass to allow me to build tagged versions from the CVS
# tree.

# Ed Hartnett, 1/19/4

# From Brian Warner, a.k.a. Mr. BuildBot:

# You'll need to subclass ConfigurableBuildFactory and arrange for the
# self.steps it creates to include something like:
#  (ShellCommand, {'workdir': ".", 'command': "rm -rf %s" % workdir})
# and then
#  (ShellCommand, {'workdir': ".", 'command': "cvs -d blah co -r FOO blah"})


from buildbot.process.base import ConfigurableBuildFactory, CVS, \
     Configure, Compile, Test, ShellCommand
  
class TaggedBuildFactory(ConfigurableBuildFactory):
    def __init__(self, cvsroot, cvsmodule, tag, configure="configure", configureEnv={}, compile="make all",
                 test="make check", workdir="."):
        steps = []
#        steps.append((ShellCommand, {'workdir': ".",
#                                     'command': "rm -rf %s" % workdir}))
        steps.append((ShellCommand, {'workdir': ".",
                                     'command': "cvs -d "+cvsroot+" co -r "+tag+" "+cvsmodule}))
        steps.append((Configure, {'workdir': workdir,
                                  'command': configure,
                                  'env': configureEnv}))
        steps.append((Compile, {'workdir': workdir,
                                'command': compile}))
        steps.append((Test, {'workdir': workdir,
                             'command': test}))
        self.steps = steps

Some questions and problems:

1 - If I have two shell commands, (i.e. a rm and a cvs co), I get an
error. That's why the first one is commented out above. How do I give
them different names?

2004/01/21 15:15 MST [-] Traceback (most recent call last):
	  File "/usr/lib/python2.2/site-packages/twisted/scripts/twistd.py", line 165, in startApplication
	    app.startApplication(application, not config['no_save'])
	  File "/usr/lib/python2.2/site-packages/twisted/application/app.py", line 220, in startApplication
	    service.IService(application).startService()
	  File "/usr/lib/python2.2/site-packages/twisted/application/service.py", line 194, in startService
	    service.startService()
	  File "/usr/lib/python2.2/site-packages/buildbot/master.py", line 378, in startService
	    self.loadTheConfigFile()
	--- <exception caught here> ---
	  File "/usr/lib/python2.2/site-packages/buildbot/master.py", line 397, in loadTheConfigFile
	    self.loadConfig(f)
	  File "/usr/lib/python2.2/site-packages/buildbot/master.py", line 490, in loadConfig
	    self.loadConfig_Builders(builders)
	  File "/usr/lib/python2.2/site-packages/buildbot/master.py", line 581, in loadConfig_Builders
	    builder = Builder(name, slave, builddir, factory, statusbag)
	  File "/usr/lib/python2.2/site-packages/buildbot/process/base.py", line 362, in __init__
	    self.waiting = self.newBuild()
	  File "/usr/lib/python2.2/site-packages/buildbot/process/base.py", line 387, in newBuild
	    b = self.buildFactory.newBuild()
	  File "/usr/lib/python2.2/site-packages/buildbot/process/base.py", line 762, in newBuild
	    b.setSteps(self.steps)
	  File "/usr/lib/python2.2/site-packages/buildbot/process/base.py", line 647, in setSteps
	    raise RuntimeError("duplicate step '%s'" % step.name)
	exceptions.RuntimeError: duplicate step 'shell'
	


2 - When I run this bot from the webpage, the configure step doesn't
work:



command './configure' in dir '.'

Upon execvpe ./configure ['./configure'] in environment id 141045236:
Traceback (most recent call last):
  File "/usr/lib/python2.2/site-packages/twisted/internet/process.py", line 502, in __init__
    os.execvpe(command, args, environment)
  File "/usr/src/build/317580-i386/install/usr/lib/python2.2/os.py", line 308, in execvpe
    _execvpe(file, args, env)
  File "/usr/src/build/317580-i386/install/usr/lib/python2.2/os.py", line 325, in _execvpe
    apply(func, (file,) + argrest)
OSError: [Errno 2] No such file or directory
program finished with exit code 1

What the heck?

Any suggestions would be helpful. Thanks!

Ed





More information about the devel mailing list