[Buildbot-devel] Skip some build steps if one of the build slaves fails a given step.

Brian Warner warner-buildbot at lothar.com
Tue May 15 08:44:37 UTC 2007


"Tsuna" <tsuna at lrde.epita.fr> writes:

> Would it be possible to skip a step if one of the build slaves fails a
> given step?
>
> I'd like to do this because I'm cross-compiling several projects and
> cross-compiled binaries cannot run `make check' (for obvious reasons). 

Do you know ahead of time which builders are doing cross-compilation and
which are capable of doing 'make check'?

If so, you could set the 'haltOnFailure' flag to True for the native-compile
builders, and set both haltOnFailure and flunkOnFailure to False for the
cross-compile builders. That way, a failure in 'make check' on the native
build will skip all remaining steps (i.e. skip your upload step), but
failures in the 'make check' on the cross-compile builds will be logged and
ignored (and the remaining upload step will continue as normal).

You could also construct the list of steps such that the cross-compile builds
just don't do the 'make check' step at all.

> I'd like to skip the upload step of all build slaves if at least one of
> them failed its `make check'.

Ah, you want a control flow that makes some piece of all the builds dependent
upon each other, something vaguely like:

 A compile -- test ----\            /--> upload
 B compile -- test -----+--> AND --+--> upload
 C compile -- test ----/            \--> upload

Hmm, that's trickier. We have "Dependent Schedulers" to allow a *single*
build to be triggered when a number of other "upstream" builds all succeed,
but in this case you want a single piece of *each* build to be conditioned
upon the state of the other builds.

I don't think we have anything that will directly enable this. Builds are,
for the most part, pretty independent, so getting access to one build from a
separate one (in a separate Builder) is non-trivial. You should take a look
at the Builder, Build, and BuildStep classes.. it might be possible (with a
lot of hacking) to make a specialized BuildStep that says "now I'm going to
reach out and find any current builds running in these other Builders, wait
until they enter in to the same step as I am, look at their earlier status,
and then decide how to proceed". I suspect that getting the locking and
waiting right will be pretty difficult, though.

You might also be able to accomplish this by creating two Builders for each
platform: one to do the compile and 'make check', and a second to do the
upload. Use a DependentScheduler to watch the first set and only trigger the
second set when all members of the first set succeed. The only trick is that
you'll have to futz with the workdir= settings to allow the second Builder to
find the generated binaries from the first, but that's probably a lot easier
than writing a lot of custom code.

hope that helps,
 -Brian




More information about the devel mailing list