about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-10-24T13·05+0200
committerEelco Dolstra <edolstra@gmail.com>2017-10-24T13·32+0200
commit3460e4cf007017e89096b4fad083692666b87a20 (patch)
treef095fe9ebbcd1b46ad022fb5b30179f7de3c2dd0
parent96051dd057d46d5953b2fbe3de67269d175306dc (diff)
More progress indicator improvements
In particular, don't show superfluous "fetching path" and "building
path(s)" messages, and show the current round (with --repeat).
-rw-r--r--src/libstore/build.cc22
-rw-r--r--src/nix/progress-bar.cc4
-rw-r--r--tests/binary-cache.sh2
3 files changed, 14 insertions, 14 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 681879c6aa..856d516d2b 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -1402,9 +1402,15 @@ void DerivationGoal::tryToBuild()
     bool buildLocally = buildMode != bmNormal || drv->willBuildLocally();
 
     auto started = [&]() {
-        act = std::make_unique<Activity>(*logger, lvlInfo, actBuild,
-            hook ? fmt("building '%s' on '%s'", drvPath, machineName) : fmt("building '%s'", drvPath),
-            Logger::Fields{drvPath, hook ? machineName : ""});
+        auto msg = fmt(
+            buildMode == bmRepair ? "repairing outputs of '%s'" :
+            buildMode == bmCheck ? "checking outputs of '%s'" :
+            nrRounds > 1 ? "building '%s' (round %d/%d)" :
+            "building '%s'", drvPath, curRound, nrRounds);
+        fmt("building '%s'", drvPath);
+        if (hook) msg += fmt(" on '%s'", machineName);
+        act = std::make_unique<Activity>(*logger, lvlInfo, actBuild, msg,
+            Logger::Fields{drvPath, hook ? machineName : "", curRound, nrRounds});
         mcRunningBuilds = std::make_unique<MaintainCount<uint64_t>>(worker.runningBuilds);
         worker.updateProgress();
     };
@@ -1738,14 +1744,6 @@ int childEntry(void * arg)
 
 void DerivationGoal::startBuilder()
 {
-    auto f = format(
-        buildMode == bmRepair ? "repairing path(s) %1%" :
-        buildMode == bmCheck ? "checking path(s) %1%" :
-        nrRounds > 1 ? "building path(s) %1% (round %2%/%3%)" :
-        "building path(s) %1%");
-    f.exceptions(boost::io::all_error_bits ^ boost::io::too_many_args_bit);
-    printInfo(f % showPaths(missingPaths) % curRound % nrRounds);
-
     /* Right platform? */
     if (!drv->canBuildLocally()) {
         throw Error(
@@ -3601,8 +3599,6 @@ void SubstitutionGoal::tryToRun()
         return;
     }
 
-    printInfo(format("fetching path '%1%'...") % storePath);
-
     maintainRunningSubstitutions = std::make_unique<MaintainCount<uint64_t>>(worker.runningSubstitutions);
     worker.updateProgress();
 
diff --git a/src/nix/progress-bar.cc b/src/nix/progress-bar.cc
index a33ea34238..fb9955190b 100644
--- a/src/nix/progress-bar.cc
+++ b/src/nix/progress-bar.cc
@@ -159,6 +159,10 @@ public:
             auto machineName = getS(fields, 1);
             if (machineName != "")
                 i->s += fmt(" on " ANSI_BOLD "%s" ANSI_NORMAL, machineName);
+            auto curRound = getI(fields, 2);
+            auto nrRounds = getI(fields, 3);
+            if (nrRounds != 1)
+                i->s += fmt(" (round %d/%d)", curRound, nrRounds);
         }
 
         if (type == actSubstitute) {
diff --git a/tests/binary-cache.sh b/tests/binary-cache.sh
index 30d7cc6ba8..2a044d2edc 100644
--- a/tests/binary-cache.sh
+++ b/tests/binary-cache.sh
@@ -100,7 +100,7 @@ clearStore
 rm $(grep -l "StorePath:.*dependencies-input-2" $cacheDir/*.narinfo)
 
 nix-build --option binary-caches "file://$cacheDir" --option signed-binary-caches '' dependencies.nix -o $TEST_ROOT/result 2>&1 | tee $TEST_ROOT/log
-grep -q "fetching path" $TEST_ROOT/log
+grep -q "copying path" $TEST_ROOT/log
 
 
 if [ -n "$HAVE_SODIUM" ]; then