[Buildbot-devel] New User & odd/different source requirements

Brian Warner warner at lothar.com
Wed Sep 15 18:23:37 UTC 2004


>   cleartool startview myview
>   cd /view/myview/vobs/myvob/path/to/src
>   make

That sounds like a good plan. You'd want a BuildFactory set up like this:
(0.5.0 syntax):
========================================
from buildbot.process import base, step

def s(steptype, **kwargs):
    # convenience function for master.cfg files, to create step
    # specification tuples
    return (steptype, kwargs)

steps = [s(step.ShellCommand, command=["ct", "startview", "myview"],
           haltOnFailure=True),
         s(step.Compile, command="cd /view/myview/etc && make"),
        ]
f = base.ConfigurableBuildFactory(steps)
========================================

As a preview, the next release will use some different names:
========================================
from buildbot.process import factory, step
s = factory.s

steps = [s(step.ShellCommand, command=["ct", "startview", "myview"],
           haltOnFailure=True),
         s(step.Compile, command="cd /view/myview/etc && make"),
        ]
f = factory.BuildFactory(steps)
========================================

We could probably change the way workdirs are used to allow absolute paths,
which would enable a step definition like this:

         s(step.Compile, workdir="/view/myview/etc", command=["make"])

Does this seem generally useful? I've been preaching the idea that the
workdir is always a subdirectory of the buildslave's basedir, but it seems
like there are some use cases that aren't handled well by this approach. If
that seems like a good idea, I'll add a check to the slave so that if the
workdir looks like an absolute path, it won't try to prepend the basedir on
to it.

As a side note, we're moving towards list-based command expressions in
general, because of the usual avoid-quoting issues (you can express arguments
with spaces or quotes in them without second-guessing what the shell is going
to do with it). String-based commands are still valid (since there are some
things you just can't do with an argv array). If the ShellCommand sees that
you have a string, it turns it into ["/bin/sh", "-c", command], which should
let you do things like &&-chaining and pipes and miscellaneous >redirects, at
least as long as the shell on your buildslave obeys such things.

> It does rely on your Makefiles using relative paths rather than absolute
> paths (/vobs/myvob, etc.). If you can fix up your Makefiles, this should be
> a go-er.

Yeah, Buildbot is really designed around projects which can be defined by
their tarball of source files, rather than specifics about the build platform
or where that tarball happens to be dropped. (remember that the buildslaves
are nominally coming from volunteers who have access to more platform types
than you do). Makefiles which depend upon absolute paths are going to cause
you other problems anyways, like having more than one tree per developer.

> PS: Hi Brian - long time no mail! I've been meaning to try out buildbot
> here, but I haven't got round to it yet, beyond a toy "Hello World"
> project.

Howdy! Glad you're still around, even if it's mostly in "lurk" mode :).

 -Brian




More information about the devel mailing list