[Buildbot-devel] 0.8.0rc2 force build doesn't work..

Bill Deegan bill at baddogconsulting.com
Mon May 3 18:46:29 UTC 2010

Here's the fix.

So in __init__, the p4base wasn't being saved on the object, and then
it was being referred to in setBuild(self,build)
        self.args['p4base'] = self.computeRepositoryURL(p4base)
So I've changed init to save self.p4base=p4base
And then in setBuild(self,build) changed it to refer to self.p4base.
Seems to work.


class P4(Source):
    """ P4 is a class for accessing perforce revision control"""
    name = "p4"

    def __init__(self, p4base=None, defaultBranch=None, p4port=None,
                 p4passwd=None, p4extra_views=[],
                 p4client='buildbot_%(slave)s_%(builder)s', **kwargs):
        @type  p4base: string
        @param p4base: A view into a perforce depot, typically

        @type  defaultBranch: string
        @param defaultBranch: Identify a branch to build by default. Perforce
                              is a view based branching system. So, the branch
                              is normally the name after the base. For example,
                              branch=1.0 is view=//depot/proj/1.0/...
                              branch=1.1 is view=//depot/proj/1.1/...

        @type  p4port: string
        @param p4port: Specify the perforce server to connection in the format
                       <host>:<port>. Example "perforce.example.com:1666"

        @type  p4user: string
        @param p4user: The perforce user to run the command as.

        @type  p4passwd: string
        @param p4passwd: The password for the perforce user.

        @type  p4extra_views: list of tuples
        @param p4extra_views: Extra views to be added to
                              the client that is being used.

        @type  p4client: string
        @param p4client: The perforce client to use for this buildslave.

        self.branch = defaultBranch
        Source.__init__(self, **kwargs)
        self.args['p4port'] = p4port
        self.args['p4user'] = p4user
        self.args['p4passwd'] = p4passwd
        self.args['p4extra_views'] = p4extra_views
        self.p4base = p4base
        self.p4client = p4client

    def setBuild(self, build):
        Source.setBuild(self, build)
        self.args['p4base'] = self.computeRepositoryURL(self.p4base)
        self.args['p4client'] = self.p4client % {
            'slave': build.slavename,
            'builder': build.builder.name,

On Mon, May 3, 2010 at 11:29 AM, Bill Deegan <bill at baddogconsulting.com> wrote:
> Greetings,
> Just updated to 0.8.0RC2 and the force build button doesn't work.
> It indicates that one is scheduled
> http://buildbot/builders/abc
> Requested build via the force build button.
> I see:
> No current builds
> Pending builds:
>    * (May 03 11:27:49, waiting 0 secs)
>      no changes specified
> To cancel this build, fill out the following fields and push the 'Cancel' button
> To cancel individual builds, click the 'Cancel' buttons above.
> But when I go back to the waterfall or then back to the build page,
> the pending build is gone.
> Looks like something broke in the p4 code.
> 2010-05-03 11:29:17-0700 [Broker,1,] Build.setupBuild failed
> 2010-05-03 11:29:17-0700 [Broker,1,] Unhandled Error
>        Traceback (most recent call last):
>          File "/tools/linux-ia32/python/python/2.5.4/lib/python2.5/site-packages/Twisted-8.2.0-py2.5-linux-i686.egg/twisted/internet/defer.py",
> line 243, in callback
>            self._startRunCallbacks(result)
>          File "/tools/linux-ia32/python/python/2.5.4/lib/python2.5/site-packages/Twisted-8.2.0-py2.5-linux-i686.egg/twisted/internet/defer.py",
> line 312, in _startRunCallbacks
>            self._runCallbacks()
>          File "/tools/linux-ia32/python/python/2.5.4/lib/python2.5/site-packages/Twisted-8.2.0-py2.5-linux-i686.egg/twisted/internet/defer.py",
> line 328, in _runCallbacks
>            self.result = callback(self.result, *args, **kw)
>          File "/tools/linux-ia32/python/python/2.5.4/lib/python2.5/site-packages/buildbot-0.8.0rc2-py2.5.egg/buildbot/process/builder.py",
> line 839, in _startBuild_2
>            d = build.startBuild(bs, self.expectations, sb)
>        --- <exception caught here> ---
>          File "/tools/linux-ia32/python/python/2.5.4/lib/python2.5/site-packages/buildbot-0.8.0rc2-py2.5.egg/buildbot/process/base.py",
> line 214, in startBuild
>            self.setupBuild(expectations) # create .steps
>          File "/tools/linux-ia32/python/python/2.5.4/lib/python2.5/site-packages/buildbot-0.8.0rc2-py2.5.egg/buildbot/process/base.py",
> line 270, in setupBuild
>            step.setBuild(self)
>          File "/tools/linux-ia32/python/python/2.5.4/lib/python2.5/site-packages/buildbot-0.8.0rc2-py2.5.egg/buildbot/steps/source.py",
> line 1222, in setBuild
>            self.args['p4base'] = self.computeRepositoryURL(p4base)
>        exceptions.NameError: global name 'p4base' is not defined
> -Bill

More information about the devel mailing list