When builds are cancelled, large work directories are left behind and with the limited storage on our SSDs, this is problematic. we either need: a) to find a way to query buildbot, "is this build directory actively being used?" and then remove any build/build/ directory that isn't active -or- b) find a way to have a cancelled build cleanup hook that runs when a build is cancelled
This is where interrupting a build step is implemented: http://docs.buildbot.net/current/developer/cls-buildsteps.html#buildbot.process.buildstep.BuildStep.interrupt Next is to check how it's implemented, and whether it is extensible or sub-classable etc.
--- a/builders.py +++ b/builders.py @@ -128,11 +128,12 @@ def create_builder_factory(): f.addStep(RunConfigCheckSteps(posttrigger=False)) - # If the build was successful, clean up the build directory + # If the build was successful or cancelled, clean up the build directory f.addStep(steps.ShellCommand( command=[clob, util.Interpolate("%(prop:builddir)s/")], - doStepIf=lambda step: step.build.results == SUCCESS, + doStepIf=lambda step: step.build.results in (SUCCESS, CANCELLED), haltOnFailure=False, + alwaysRun=True, name="Clobber build dir")) return f This needs to be tested, as I'm not completely sure that alwaysRun will run the step also when the previous one was interrupted by the stop button.
Created attachment 4975 [details] proposed patch (untested)
The patch seems to be working: https://autobuilder.yoctoproject.org/typhoon/#/builders/37/builds/7793 https://git.yoctoproject.org/yocto-autobuilder2/commit/?id=adcf9d6143451c6700aa1ca3763155b3bb986e47