[Buildbot-devel] Using a Factory with Another Factory
Razvan Lupusoru
lupusoru at cse.ohio-state.edu
Thu Dec 4 22:40:16 UTC 2008
Hello,
I am trying to load a factory within another factory. This is done like
this:
####
factory_gcc_EM64T = factory.BuildFactory()
factory_gcc_EM64T.addStep(ShellCommand(command=["/bin/env"],
env={'NOWINSTALLPATH':
'gen2-gcc-em64t'}))
factory_gcc_EM64T.addStep(compileAndBuildFactory) # Add compilation
abilities
compileAndBuildFactory= factory.BuildFactory()
compileAndBuildFactory.addStep(SVN(mode='update', baseURL=SVN_URL,
defaultBranch='trunk'))
####
The reason I am doing this is because I need my first factory to set
some environment variables which will be used by compileAndBuildFactory
so that it stays a generic factory that I can reuse. The configuration
file passes the buildbot checkconfig option. However, whenever I start a
build, I get the error: SetupBuild Exception
This is from the twisted.log file:
####
2008/12/04 16:40 EST [Broker,0,192.168.103.1] <Build
Gen2-GCC-EMT64>.startBuild
2008/12/04 16:40 EST [Broker,0,192.168.103.1] error while creating step,
factory=<buildbot.process.factory.BuildFactory insta
nce at 0x2b7b36c80d88>, args={}
2008/12/04 16:40 EST [Broker,0,192.168.103.1] Build.setupBuild failed
2008/12/04 16:40 EST [Broker,0,192.168.103.1] Traceback (most recent
call last):
File
"/usr/lib64/python2.4/site-packages/twisted/internet/defer.py", line
229, in callback
self._startRunCallbacks(result)
File
"/usr/lib64/python2.4/site-packages/twisted/internet/defer.py", line
294, in _startRunCallbacks
self._runCallbacks()
File
"/usr/lib64/python2.4/site-packages/twisted/internet/defer.py", line
307, in _runCallbacks
self.result = callback(self.result, *args, **kw)
File
"/usr/lib/python2.4/site-packages/buildbot/process/builder.py", line
635, in _startBuild_2
d = build.startBuild(bs, self.expectations, sb)
--- <exception caught here> ---
File
"/usr/lib/python2.4/site-packages/buildbot/process/base.py", line 300,
in startBuild
self.setupBuild(expectations) # create .steps
File
"/usr/lib/python2.4/site-packages/buildbot/process/base.py", line 351,
in setupBuild
step = factory(**args)
exceptions.AttributeError: BuildFactory instance has no __call__
method
####
Is my syntax for loading a factory within a factory wrong? Is there any
better way to set some environment variables based on what which builder
is called and then do some generic steps?
Thank you,
More information about the devel
mailing list