From c174998a0c3e29190d7dd35e1edb9e0264580ecc Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Wed, 11 Aug 2010 06:43:59 +0000 Subject: [PATCH] hydra: when restarting a build, remove possible failed dependencies from the failed-cache. --- src/lib/Hydra/Controller/Build.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/Hydra/Controller/Build.pm b/src/lib/Hydra/Controller/Build.pm index 7e69b79b..5c62b0ad 100644 --- a/src/lib/Hydra/Controller/Build.pm +++ b/src/lib/Hydra/Controller/Build.pm @@ -360,9 +360,13 @@ sub restart : Chained('build') PathPart Args(0) { requireProjectOwner($c, $build->project); txn_do($c->model('DB')->schema, sub { + my $drvpath = $build->drvpath ; error($c, "This build cannot be restarted.") - unless $build->finished; + unless $build->finished && -f $drvpath ; + my $cmd = "`nix-store -qR $drvpath`"; + my $r = `nix-store --clear-failed-paths $cmd`; + $build->update({finished => 0, timestamp => time}); $build->resultInfo->delete;