[Buildbot-devel] Unexpected clobbering

Brian Warner warner-buildbot at lothar.com
Wed Jul 4 05:41:37 UTC 2007


> The .buildbot-sourcedata file appears to be present and correct but I still
> get clobbered.
> Please could you explain to me every situation under which the CVS step
> decides to do an non explicit clobber.

Take a look in buildbot/slave/commands.py at around line 1151
(SourceBase.start). There's a clause that says:

        # do we need to clobber anything?
        if self.mode in ("copy", "clobber", "export"):
            d.addCallback(self.doClobber, self.workdir)
        if not (self.sourcedirIsUpdateable() and self.sourcedataMatches()):
            # the directory cannot be updated, so we have to clobber it.
            # Perhaps the master just changed modes from 'export' to
            # 'update'.
            d.addCallback(self.doClobber, self.srcdir)

Each VC subclass implements sourcedirIsUpdateable() and sourcedataMatches() a
bit differently, but in general:

 sourcedirIsUpdateable() returns False if the previous build used a patch, or
 if the previous build did a 'cvs export' instead of a regular checkout.

 sourcedataMatches() returns False if the current build is using a different
 branch than the previous build (or a different CVSROOT or CVSMODULE)

In addition, if something goes wrong during the cvs update, the code will
fallback to doing a clobber and clean checkout. It does this because CVS (and
other tools) don't deal well with things like replacing a version-controlled
file with a directory, or vice versa, and the only way to continue is to blow
away the workspace and start again.

> This is causing me a problem because the rm will fail on one of my modules
> due to permissions.

Is this because a file has been chmod'ed to be non-writable, or because a
file has been created by a user other than the buildslave? (i.e. does it take
chmod or chown to fix it?). I just committed a patch (ticket #29 on
buildbot.net) to chmod everything before doing the clobber, so if that's the
problem then it should be taken care of in trunk.


In general, you want to make sure your build process works equally well with
a fresh checkout or an update from an earlier build. But of course, there are
always weird reasons why that can be difficult.

hope that helps,
 -Brian





More information about the devel mailing list