about summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-10-24T12·24+0200
committerEelco Dolstra <edolstra@gmail.com>2017-10-24T12·24+0200
commitbe220702a75427b80258a92d1ed8c4573c1478fa (patch)
treefa1535bf1b682db5f9a508f0cb393f8f235b16f0 /src/libstore
parentf8624762aca7df05cfb405f5e79065d61b1a8d4b (diff)
Progress indicator: Show on what machine we're building
E.g.

  $ nix build nixpkgs.hello --builders 'root@wendy'
  [1/0/1 built] building hello-2.10 on ssh://root@wendy: checking for minix/config.h... no
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/build.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 6e3d0a3ebb22..dcc48bef770b 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -852,6 +852,9 @@ private:
 
     std::map<ActivityId, Activity> builderActivities;
 
+    /* The remote machine on which we're building. */
+    std::string machineName;
+
 public:
     DerivationGoal(const Path & drvPath, const StringSet & wantedOutputs,
         Worker & worker, BuildMode buildMode = bmNormal);
@@ -1400,7 +1403,8 @@ void DerivationGoal::tryToBuild()
 
     auto started = [&]() {
         act = std::make_unique<Activity>(*logger, lvlInfo, actBuild,
-            fmt("building '%s'", drvPath), Logger::Fields{drvPath});
+            fmt("building '%s'", drvPath),
+            Logger::Fields{drvPath, hook ? machineName : ""});
         mcRunningBuilds = std::make_unique<MaintainCount<uint64_t>>(worker.runningBuilds);
         worker.updateProgress();
     };
@@ -1691,10 +1695,10 @@ HookReply DerivationGoal::tryBuildHook()
             throw;
     }
 
-    printMsg(lvlTalkative, format("using hook to build path(s) %1%") % showPaths(missingPaths));
-
     hook = std::move(worker.hook);
 
+    machineName = readLine(hook->fromHook.readSide.get());
+
     /* Tell the hook all the inputs that have to be copied to the
        remote system. */
     hook->sink << inputPaths;