about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-07-24T10·43+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-07-24T10·43+0200
commit62309a2c56206821370b87285fcacacba1cb3566 (patch)
treed76d238a2a0d25c52d8fb90e300e639c34af10e1
parent56131a2709d76a1e52bada83a083bd2cfee2f716 (diff)
build-remote.pl: Be less verbose on failing builds
-rwxr-xr-xscripts/build-remote.pl.in3
-rw-r--r--src/nix-store/nix-store.cc8
2 files changed, 6 insertions, 5 deletions
diff --git a/scripts/build-remote.pl.in b/scripts/build-remote.pl.in
index c2f1fecd875a..337374c214b5 100755
--- a/scripts/build-remote.pl.in
+++ b/scripts/build-remote.pl.in
@@ -263,7 +263,8 @@ if ($res != 0) {
     # or a temporary Nix problem).  We propagate this to the caller to
     # allow it to distinguish between transient and permanent
     # failures.
-    print STDERR "build of `$drvPath' on `$hostName' failed with exit code $res\n";
+    my $msg = readString($from);
+    print STDERR "error: $msg (on `$hostName')\n";
     exit $res;
 }
 
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index 42012f2e73ab..f874ffeadc3e 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -1013,15 +1013,15 @@ static void opServe(Strings opFlags, Strings opArgs)
                 settings.maxSilentTime = readInt(in);
                 settings.buildTimeout = readInt(in);
 
-                int res = 0;
                 try {
                     MonitorFdHup monitor(in.fd);
                     store->buildPaths(paths);
+                    writeInt(0, out);
                 } catch (Error & e) {
-                    printMsg(lvlError, format("error: %1%") % e.msg());
-                    res = e.status;
+                    assert(e.status);
+                    writeInt(e.status, out);
+                    writeString(e.msg(), out);
                 }
-                writeInt(res, out);
                 break;
             }