diff --git a/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm b/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm
index bb668242..e9e32d19 100644
--- a/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm
+++ b/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm
@@ -301,20 +301,18 @@ sub build :Local {
sub log :Local {
- my ( $self, $c, $id, $logPhase ) = @_;
+ my ( $self, $c, $id ) = @_;
my $build = getBuild($c, $id);
- return error($c, "Build with ID $id doesn't exist.") if !defined $build;
+ return error($c, "Build $id doesn't exist.") if !defined $build;
+
+ return error($c, "Build $id didn't produce a log.") if !defined $build->resultInfo->logfile;
- my $log = $build->buildlogs->find({logphase => $logPhase});
- return error($c, "Build $id doesn't have a log phase named $logPhase.") if !defined $log;
-
$c->stash->{template} = 'log.tt';
- $c->stash->{id} = $id;
- $c->stash->{log} = $log;
+ $c->stash->{build} = $build;
# !!! should be done in the view (as a TT plugin).
- $c->stash->{logtext} = loadLog($log->path);
+ $c->stash->{logtext} = loadLog($build->resultInfo->logfile);
}
@@ -341,6 +339,8 @@ sub nixlog :Local {
sub loadLog {
my ($path) = @_;
+ die unless defined $path;
+
# !!! quick hack
my $pipeline = ($path =~ /.bz2$/ ? "cat $path | bzip2 -d" : "cat $path")
. " | nix-log2xml | xsltproc xsl/mark-errors.xsl - | xsltproc xsl/log2html.xsl - | tail -n +2";
diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema.pm b/src/HydraFrontend/lib/HydraFrontend/Schema.pm
index 293ffb87..1f1aeb28 100644
--- a/src/HydraFrontend/lib/HydraFrontend/Schema.pm
+++ b/src/HydraFrontend/lib/HydraFrontend/Schema.pm
@@ -8,8 +8,8 @@ use base 'DBIx::Class::Schema';
__PACKAGE__->load_classes;
-# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 17:09:46
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uZCNqZeWS46Z2RdysLEDaA
+# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-24 17:46:46
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rS2THZrlrDHnIAWmvduE1g
# You can replace this text with custom content, and it will be preserved on regeneration
diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildinputs.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildinputs.pm
index f9bffe5a..f2c3ced6 100644
--- a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildinputs.pm
+++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildinputs.pm
@@ -29,7 +29,7 @@ __PACKAGE__->add_columns(
"path",
{ data_type => "text", is_nullable => 0, size => undef },
"sha256hash",
- { data_type => "VARCHAR", is_nullable => 0, size => undef },
+ { data_type => "text", is_nullable => 0, size => undef },
);
__PACKAGE__->set_primary_key("id");
__PACKAGE__->belongs_to("build", "HydraFrontend::Schema::Builds", { id => "build" });
@@ -40,8 +40,8 @@ __PACKAGE__->belongs_to(
);
-# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 17:09:46
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:96p2HKZ/6kk0zZKq3JuvDg
+# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-24 17:46:46
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9u9ep3Cq/SginPyhrzXlTA
# You can replace this text with custom content, and it will be preserved on regeneration
diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildlogs.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildlogs.pm
deleted file mode 100644
index 96df0cb8..00000000
--- a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildlogs.pm
+++ /dev/null
@@ -1,29 +0,0 @@
-package HydraFrontend::Schema::Buildlogs;
-
-use strict;
-use warnings;
-
-use base 'DBIx::Class';
-
-__PACKAGE__->load_components("Core");
-__PACKAGE__->table("BuildLogs");
-__PACKAGE__->add_columns(
- "build",
- { data_type => "integer", is_nullable => 0, size => undef },
- "logphase",
- { data_type => "text", is_nullable => 0, size => undef },
- "path",
- { data_type => "text", is_nullable => 0, size => undef },
- "type",
- { data_type => "text", is_nullable => 0, size => undef },
-);
-__PACKAGE__->set_primary_key("build", "logphase");
-__PACKAGE__->belongs_to("build", "HydraFrontend::Schema::Builds", { id => "build" });
-
-
-# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 17:09:46
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zWuDHHMl7eWUWU238D5MWg
-
-
-# You can replace this text with custom content, and it will be preserved on regeneration
-1;
diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildproducts.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildproducts.pm
index 429b348e..3b082c45 100644
--- a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildproducts.pm
+++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildproducts.pm
@@ -33,8 +33,8 @@ __PACKAGE__->set_primary_key("build", "productnr");
__PACKAGE__->belongs_to("build", "HydraFrontend::Schema::Builds", { id => "build" });
-# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 17:09:46
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kiP5lQxpuaZUZiqHigHYxQ
+# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-24 17:46:46
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:d85fCxlq/WDfQa20zXYuzw
# You can replace this text with custom content, and it will be preserved on regeneration
diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildresultinfo.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildresultinfo.pm
index 2f6cf7de..0b74373d 100644
--- a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildresultinfo.pm
+++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildresultinfo.pm
@@ -20,13 +20,15 @@ __PACKAGE__->add_columns(
{ data_type => "integer", is_nullable => 0, size => undef },
"stoptime",
{ data_type => "integer", is_nullable => 0, size => undef },
+ "logfile",
+ { data_type => "text", is_nullable => 0, size => undef },
);
__PACKAGE__->set_primary_key("id");
__PACKAGE__->belongs_to("id", "HydraFrontend::Schema::Builds", { id => "id" });
-# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 17:09:46
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:MqQ972Qn6sjoWbbbzmE1cg
+# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-24 17:46:46
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:c2KXbqA8Xan4Lgf7AlK2EA
# You can replace this text with custom content, and it will be preserved on regeneration
diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Builds.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Builds.pm
index 45322303..621c0771 100644
--- a/src/HydraFrontend/lib/HydraFrontend/Schema/Builds.pm
+++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Builds.pm
@@ -72,15 +72,10 @@ __PACKAGE__->has_many(
"HydraFrontend::Schema::Buildproducts",
{ "foreign.build" => "self.id" },
);
-__PACKAGE__->has_many(
- "buildlogs",
- "HydraFrontend::Schema::Buildlogs",
- { "foreign.build" => "self.id" },
-);
-# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 17:09:46
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:yYcxVJ1KnjD3KKWt4XQFMg
+# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-24 17:46:46
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/Iabv2HeyAsubLe+yPc/6Q
__PACKAGE__->has_many(dependents => 'HydraFrontend::Schema::Buildinputs', 'dependency');
diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildschedulinginfo.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildschedulinginfo.pm
index fdb72a93..1185fc00 100644
--- a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildschedulinginfo.pm
+++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildschedulinginfo.pm
@@ -23,8 +23,8 @@ __PACKAGE__->set_primary_key("id");
__PACKAGE__->belongs_to("id", "HydraFrontend::Schema::Builds", { id => "id" });
-# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 17:09:46
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uAs9z69gMZRAQSzvOGsqEQ
+# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-24 17:46:46
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vqJ7HEML5YNn5VIXEhZbnw
# You can replace this text with custom content, and it will be preserved on regeneration
diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildsteps.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildsteps.pm
index 63275c67..152f4e97 100644
--- a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildsteps.pm
+++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildsteps.pm
@@ -35,8 +35,8 @@ __PACKAGE__->set_primary_key("id", "stepnr");
__PACKAGE__->belongs_to("id", "HydraFrontend::Schema::Builds", { id => "id" });
-# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 17:09:46
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mM/rt5x2l2wMZn+EnctifQ
+# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-24 17:46:46
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BuZp6PHq9l/9xyA/x7TOVQ
# You can replace this text with custom content, and it will be preserved on regeneration
diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsetinputalts.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsetinputalts.pm
index 233437b6..bf244336 100644
--- a/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsetinputalts.pm
+++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsetinputalts.pm
@@ -31,8 +31,8 @@ __PACKAGE__->belongs_to(
);
-# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 17:09:46
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xj0LojYsbdSMWCv+KUH8sw
+# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-24 17:46:46
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:x7OCv8YzB2L4H+RxEfwjbg
# You can replace this text with custom content, and it will be preserved on regeneration
diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsetinputs.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsetinputs.pm
index e238f358..143a0228 100644
--- a/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsetinputs.pm
+++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsetinputs.pm
@@ -43,8 +43,8 @@ __PACKAGE__->has_many(
);
-# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 17:09:46
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:VO/SU4tv5UxNAmiwsqn6UA
+# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-24 17:46:46
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SKU48+1LqxIcuVY5gaDHCg
# You can replace this text with custom content, and it will be preserved on regeneration
diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsets.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsets.pm
index ff423bba..0cccd860 100644
--- a/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsets.pm
+++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsets.pm
@@ -48,8 +48,8 @@ __PACKAGE__->has_many(
);
-# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 17:09:46
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jZ0kG9EzEJn5mJFSp2WFpw
+# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-24 17:46:46
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:F3WF5YS/Yas12dK2Gyekpg
# You can replace this text with custom content, and it will be preserved on regeneration
diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Projects.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Projects.pm
index b392e2f2..787c1a29 100644
--- a/src/HydraFrontend/lib/HydraFrontend/Schema/Projects.pm
+++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Projects.pm
@@ -13,7 +13,7 @@ __PACKAGE__->add_columns(
"displayname",
{ data_type => "text", is_nullable => 0, size => undef },
"description",
- { data_type => "VARCHAR", is_nullable => 0, size => undef },
+ { data_type => "text", is_nullable => 0, size => undef },
"enabled",
{ data_type => "integer", is_nullable => 0, size => undef },
);
@@ -30,8 +30,8 @@ __PACKAGE__->has_many(
);
-# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 17:09:46
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:XkQtF1ABmLxvxND62rBlCw
+# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-24 17:46:46
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:M+HA5YEL1oKKTQlLvhb6dw
# You can replace this text with custom content, and it will be preserved on regeneration
diff --git a/src/HydraFrontend/root/build.tt b/src/HydraFrontend/root/build.tt
index d65fc0fb..9c1dadec 100644
--- a/src/HydraFrontend/root/build.tt
+++ b/src/HydraFrontend/root/build.tt
@@ -36,10 +36,14 @@
Success
[% ELSIF build.resultInfo.buildstatus == 1 %]
- Build returned a non-zero exit code
+ Build returned a non-zero exit code
+ [% ELSIF build.resultInfo.buildstatus == 2 %]
+
+ A dependency of the build failed
[% ELSE %]
- Build failed
+ Build failed
+ (see below)
[% END %]
[% ELSIF build.schedulingInfo.busy %]
Build in progress
@@ -99,6 +103,14 @@
[% END %]
+ [% IF build.resultInfo.logfile %]
+
[% IF step.busy == 1 %]
- Building
+ [% IF build.finished %]
+ Aborted
+ [% ELSE %]
+ Building
+ [% END %]
[% ELSIF step.status == 0 %]
Succeeded
[% ELSE %]
- Failed: [% step.errormsg %]
+ Failed: [% HTML.escape(step.errormsg) %]
[% END %]
[% IF step.logfile %]
(log)
@@ -190,6 +210,17 @@
[% IF build.finished %]
+[% IF build.resultInfo.errormsg %]
+
+Nix error output+ ++[% HTML.escape(build.resultInfo.errormsg) -%] ++ +[% END %] + + [% IF build.buildproducts %] @@ -299,26 +330,6 @@ [% END %] -[% IF build.buildlogs %] - -
-
-
-
-[% END %]
-
-
[% IF build.dependents %]
Logs- -
Used by@@ -349,9 +360,8 @@Log--[% logtext -%] +[% HTML.escape(logtext) -%]diff --git a/src/HydraFrontend/root/log.tt b/src/HydraFrontend/root/log.tt index a226b6f7..4c491054 100644 --- a/src/HydraFrontend/root/log.tt +++ b/src/HydraFrontend/root/log.tt @@ -1,6 +1,6 @@ [% WRAPPER layout.tt title="Hydra Overview" %] - Build log [% IF step %] of step [% step.stepnr %] [% ELSE %][% log.logphase %][% END %] of build ID [% id %]+Logfile for [% build.project.name %]:[% build.attrname %] build [% build.id %]
[% logtext -%]
diff --git a/src/HydraFrontend/root/static/css/hydra.css b/src/HydraFrontend/root/static/css/hydra.css
index ce7925c2..91e828d2 100644
--- a/src/HydraFrontend/root/static/css/hydra.css
+++ b/src/HydraFrontend/root/static/css/hydra.css
@@ -153,6 +153,11 @@ td.buildfarmMainColumn {
white-space: pre;
}
+.error {
+ color: red;
+ font-weight: bold;
+}
+
pre.buildlog {
border: 1px solid black;
padding: 0.3em;
diff --git a/src/HydraFrontend/root/static/css/logfile.css b/src/HydraFrontend/root/static/css/logfile.css
index 091662dd..fce99070 100644
--- a/src/HydraFrontend/root/static/css/logfile.css
+++ b/src/HydraFrontend/root/static/css/logfile.css
@@ -75,7 +75,7 @@ em.storeref:hover span.popup {
font-size: larger;
}
-.error {
+.errorLine {
color: #ff0000;
font-weight: bold;
}
diff --git a/src/HydraFrontend/xsl/log2html.xsl b/src/HydraFrontend/xsl/log2html.xsl
index beb3eaf3..9979dc64 100644
--- a/src/HydraFrontend/xsl/log2html.xsl
+++ b/src/HydraFrontend/xsl/log2html.xsl
@@ -63,7 +63,7 @@
diff --git a/src/build.pl b/src/build.pl
index b61419e5..cd23aa60 100644
--- a/src/build.pl
+++ b/src/build.pl
@@ -27,12 +27,19 @@ sub doBuild {
my $outputCreated = 1; # i.e., the Nix build succeeded (but it could be a positive failure)
my $startTime = 0;
my $stopTime = 0;
+
+ my $buildStatus = 0; # = succeeded
+
+ my $errormsg = undef;
if (!isValidPath($outPath)) {
$isCachedBuild = 0;
$startTime = time();
+ my $thisBuildFailed = 0;
+ my $someBuildFailed = 0;
+
# Run Nix to perform the build, and monitor the stderr output
# to get notifications about specific build steps, the
# associated log files, etc.
@@ -44,6 +51,8 @@ sub doBuild {
open OUT, "$cmd |" or die;
while (
|