Try harder to find build logs
Due to the fixed-output derivation hashing scheme, there can be multiple derivations of the same output path. But build logs are indexed by derivation path. Thus, we may not be able to find the log of a build or build step using its derivation. So as a fallback, Hydra now looks for other derivations with the same output paths.
This commit is contained in:
@ -8,7 +8,7 @@ __PACKAGE__->config(
|
||||
TEMPLATE_EXTENSION => '.tt',
|
||||
PRE_CHOMP => 1,
|
||||
POST_CHOMP => 1,
|
||||
expose_methods => [qw/log_exists ellipsize/]);
|
||||
expose_methods => [qw/log_exists buildLogExists buildStepLogExists/]);
|
||||
|
||||
sub log_exists {
|
||||
my ($self, $c, $drvPath) = @_;
|
||||
@ -16,9 +16,16 @@ sub log_exists {
|
||||
return defined $x;
|
||||
}
|
||||
|
||||
sub ellipsize {
|
||||
my ($self, $c, $s, $n) = @_;
|
||||
return length $s <= $n ? $s : substr($s, 0, $n - 3) . "...";
|
||||
sub buildLogExists {
|
||||
my ($self, $c, $build) = @_;
|
||||
my @outPaths = map { $_->path } $build->buildoutputs->all;
|
||||
return defined findLog($c, $build->drvpath, @outPaths);
|
||||
}
|
||||
|
||||
sub buildStepLogExists {
|
||||
my ($self, $c, $step) = @_;
|
||||
my @outPaths = map { $_->path } $step->buildstepoutputs->all;
|
||||
return defined findLog($c, $step->drvpath, @outPaths);
|
||||
}
|
||||
|
||||
1;
|
||||
|
Reference in New Issue
Block a user