lix/src/libcmd
alois31 0dd1d8ca1c
tree-wide: unify progress bar inactive and paused states
Previously, the progress bar had two subtly different states in which the bar
would not actually render, both with their own shortcomings: inactive (which
was irreversible) and paused (reversible, but swallowing logs). Furthermore,
there was no way of resetting the statistics, so a very bad solution was
implemented (243c0f18da) that would create a new
logger for each line of the repl, leaking the previous one and discarding the
value of printBuildLogs. Finally, if stderr was not attached to a TTY, the
update thread was started even though the logger was not active, violating the
invariant required by the destructor (which is not observed because the logger
is leaked).

In this commit, the two aforementioned states are unified into a single one,
which can be exited again, correctly upholds the invariant that the update
thread is only running while the progress bar is active, and does not swallow
logs. The latter change in behavior is not expected to be a problems in the
rare cases where the paused state was used before, since other loggers (like
the simple one) don't exhibit it anyway. The startProgressBar/stopProgressBar
API is removed due to being a footgun, and a new method for properly resetting
the progress is added.

Co-Authored-By: Qyriad <qyriad@qyriad.me>
Change-Id: I2b7c3eb17d439cd0c16f7b896cfb61239ac7ff3a
2024-07-01 18:19:34 +02:00
..
built-path.cc Merge pull request #9582 from pennae/misc-opts 2024-03-04 07:32:31 +01:00
built-path.hh pragma once and ///@file everything missing it 2024-04-08 15:40:12 -07:00
cmd-profiles.cc nix3-profile: remove check "name" attr in manifests 2024-05-02 12:59:15 -06:00
cmd-profiles.hh nix3-profile: make element names stable 2024-05-02 12:59:15 -06:00
command.cc Merge pull request #9289 from edolstra/fix-warnings 2024-03-04 05:27:35 +01:00
command.hh refactor some nix-env and profile code to libcmd 2024-04-29 01:19:21 +00:00
common-eval-args.cc chore: rebrand Nix to Lix when it makes sense 2024-06-01 20:31:24 +02:00
common-eval-args.hh add docstring to lookupFileArg 2024-05-23 14:11:10 -06:00
editor-for.cc util.hh: Delete remaining file and clean up headers 2024-05-29 12:38:51 +02:00
editor-for.hh Merge pull request #9634 from 9999years/combine-abstract-pos-and-pos 2024-03-05 23:46:18 -07:00
installable-attr-path.cc util.hh: Delete remaining file and clean up headers 2024-05-29 12:38:51 +02:00
installable-attr-path.hh util.hh: Delete remaining file and clean up headers 2024-05-29 12:38:51 +02:00
installable-derived-path.cc Fixing #7479 2023-08-18 11:44:00 -04:00
installable-derived-path.hh Ensure all headers have #pragma once and are in API docs 2023-03-31 23:19:44 -04:00
installable-flake.cc util.hh: Delete remaining file and clean up headers 2024-05-29 12:38:51 +02:00
installable-flake.hh Rename 'resolvedRef' to 'lockedRef' 2023-07-03 12:23:57 +02:00
installable-value.cc Merge pull request #9634 from 9999years/combine-abstract-pos-and-pos 2024-03-05 23:46:18 -07:00
installable-value.hh Make more string values work as installables 2023-05-15 09:03:38 -04:00
installables.cc Merge pull request #10570 from layus/shared_caches 2024-06-19 18:39:11 +00:00
installables.hh util.hh: Delete remaining file and clean up headers 2024-05-29 12:38:51 +02:00
legacy.cc Move command plugin interface to libnixcmd 2021-01-26 06:22:24 -05:00
legacy.hh Ensure all headers have #pragma once and are in API docs 2023-03-31 23:19:44 -04:00
lix-cmd.pc.in packaging: rename nixexpr -> lixexpr and so on 2024-05-23 16:45:23 -06:00
markdown.cc util.hh: Delete remaining file and clean up headers 2024-05-29 12:38:51 +02:00
markdown.hh Ensure all headers have #pragma once and are in API docs 2023-03-31 23:19:44 -04:00
meson.build remove InstallableValueCommand class 2024-06-20 17:00:06 +00:00
repl-interacter.cc util.hh: Delete remaining file and clean up headers 2024-05-29 12:38:51 +02:00
repl-interacter.hh repl: log errors writing to history file 2024-05-23 18:10:23 +00:00
repl-overlays.nix format repl-overlays.nix to fix pre-commit checks 2024-04-09 02:21:26 -06:00
repl.cc tree-wide: unify progress bar inactive and paused states 2024-07-01 18:19:34 +02:00
repl.hh refactor: move readline stuff into its own file 2024-03-11 01:04:52 -07:00