aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd/repl.cc
diff options
context:
space:
mode:
authorAlois Wohlschlager <alois1@gmx-topmail.de>2024-05-08 18:28:22 +0200
committerAlois Wohlschlager <alois1@gmx-topmail.de>2024-05-08 20:54:41 +0200
commit243c0f18dae2a08ea0e46f7ff33277c63f7506d7 (patch)
tree39546647d62753fc9ffc16673048e52a0ada94cf /src/libcmd/repl.cc
parent8822fd7dd5254e781660704858f2eca386bdf5a2 (diff)
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
Diffstat (limited to 'src/libcmd/repl.cc')
-rw-r--r--src/libcmd/repl.cc8
1 files changed, 8 insertions, 0 deletions
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),