[Buildbot-devel] mercurial builds
Oleg Smolsky
oleg at smolsky.net
Tue Jul 31 17:04:33 UTC 2012
Hey Georges,
On 2012-07-31 03:38, Georges Racinet wrote:
>
>
>>
>> Here is the change coming in:
>> 2012-07-30 19:30:21-0700 [Broker,3,127.0.0.1] perspective_addChange
>> called
>> 2012-07-30 19:30:21-0700 [Broker,3,127.0.0.1] checking for User
>> Object from hg Change for: Oleg Smolsky <oleg at xxxxx.xxx>
>> 2012-07-30 19:30:21-0700 [-] added change
>> Change(revision=u'1a2242c644fcf08728ee5524af0c6be9a03b6c5d',
>> who=u'Oleg Smolsky <oleg at xxxxx.xxx>', branch=u'default',
>> comments=u"cblock: fixed an 'order' warning", when=1343701821,
>> category=None, project=u'', repository=u'http://hg.lan.colo/core') to
>> database
>>
>> A new build is initiated but the code dies in an assertion:
>> 2012-07-30 19:31:22-0700 [-] BuildStep.failed; traceback follows
>> Traceback (most recent call last):
>> File
>> "/opt/buildbot/sandbox/local/lib/python2.7/site-packages/buildbot-0.8.6p1-py2.7.egg/buildbot/process/buildstep.py",
>> line 545, in _startStep_2
>> doStep.addCallback(self._startStep_3)
>> File
>> "/opt/buildbot/sandbox/local/lib/python2.7/site-packages/Twisted-12.1.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py",
>> line 301, in addCallback
>> callbackKeywords=kw)
>> File
>> "/opt/buildbot/sandbox/local/lib/python2.7/site-packages/Twisted-12.1.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py",
>> line 290, in addCallbacks
>> self._runCallbacks()
>> File
>> "/opt/buildbot/sandbox/local/lib/python2.7/site-packages/Twisted-12.1.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py",
>> line 551, in _runCallbacks
>> current.result = callback(current.result, *args, **kw)
>> --- <exception caught here> ---
>> File
>> "/opt/buildbot/sandbox/local/lib/python2.7/site-packages/buildbot-0.8.6p1-py2.7.egg/buildbot/process/buildstep.py",
>> line 551, in _startStep_3
>> if self.start() == SKIPPED:
>> File
>> "/opt/buildbot/sandbox/local/lib/python2.7/site-packages/buildbot-0.8.6p1-py2.7.egg/buildbot/steps/source/oldsource.py",
>> line 291, in start
>> self.startVC(branch, revision, patch)
>> File
>> "/opt/buildbot/sandbox/local/lib/python2.7/site-packages/buildbot-0.8.6p1-py2.7.egg/buildbot/steps/source/oldsource.py",
>> line 1206, in startVC
>> assert self.branchType == 'inrepo' or not branch
>> exceptions.AssertionError:
>
> Are you using the older "slave-side" Mercurial step
> (http://buildbot.net/buildbot/docs/latest/manual/cfg-buildsteps.html#module-buildbot.steps.source,
> "Caution" paragraph)
Indeed, I was. Just upgraded to the new goodness.
>
>>
>> I have "branchtype" set to "inrepo", but that makes no difference -
>> the branch is correctly set to "default" anyway...
>> [hgbuildbot]
>> master = localhost:8000
>> branchtype = inrepo
>
> That's the hook config. I'd guess you set branch='default' in the
> Mercurial step definition, and forgot to add branchtype='inrepo'
Yes, that is correct. I didn't know about that additional spec.
>
>>
>> So, I hacked the assertion out and the build actually succeeds:
>> root at gate:/opt/buildbot/sandbox/lib/python2.7/site-packages/buildbot-0.8.6p1-py2.7.egg/buildbot/steps/source#
>> diff oldsource.py.orig oldsource.py
>> 1206c1206
>> < assert self.branchType == 'inrepo' or not branch
>> ---
>> > #assert self.branchType == 'inrepo' or not branch
>> 1208,1209c1208,1209
>> < if branch:
>> < self.args['branch'] = branch
>> ---
>> > #if branch:
>> > # self.args['branch'] = branch
>>
>> Could somebody clarify how this is really supposed to work please?
>
> That would probably not have worked with another branch than 'default'.
> Here's a working config with the master-side source step, on 0.8.6p1 :
>
> from buildbot.steps.source.mercurial import Mercurial
> factory.addStep(Mercurial(
> repourl= "https://example.com/repos/core"
> mode='full',
> method='fresh',
> branchType='inrepo',
> haltOnFailure=True,
> description='hg:core',
> workdir='build/calculs.core',
> ))
Ah, I see. I was missing the "branchType" piece. This change alone fixed
the issue and I was able to undo the hack. The newer Mercurial piece is
nicer too - it logs clearly what is being pull'd and how the working dir
is updated.
Thank you very much for the quick response!
Oleg.
More information about the devel
mailing list