From 243c0f18dae2a08ea0e46f7ff33277c63f7506d7 Mon Sep 17 00:00:00 2001 From: Alois Wohlschlager Date: Wed, 8 May 2024 18:28:22 +0200 Subject: [PATCH] repl: show a progress bar while performing builds In commit 946fc12e4e6d7e097c5b6ed4f6bc4d516b10b901, the progress bar in the repl was disabled again because it was observed to erase incremental output from attrset evaluations from the terminal. Let's try adding the progress bar again, this time showing up only when a build is initiated, which does not have incremental output that could be destroyed to begin with. While this does mean that we won't have a progress bar for eval-time fetching or IFD, it's still better than nothing. Change-Id: If4eb1035cd0c876f5b4ff1e2434b9baf99f150ac --- src/libcmd/repl.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/libcmd/repl.cc b/src/libcmd/repl.cc index 9811ea30c..696bb3c12 100644 --- a/src/libcmd/repl.cc +++ b/src/libcmd/repl.cc @@ -605,6 +605,14 @@ ProcessLineResult NixRepl::processLine(std::string line) Path drvPathRaw = state->store->printStorePath(drvPath); if (command == ":b" || command == ":bl") { + // TODO: this only shows a progress bar for explicitly initiated builds, + // not eval-time fetching or builds performed for IFD. + // But we can't just show it everywhere, since that would erase partial output from evaluation. + startProgressBar(); + Finally stopLogger([&]() { + stopProgressBar(); + }); + state->store->buildPaths({ DerivedPath::Built { .drvPath = makeConstantStorePathRef(drvPath),