Show progress while nh clean collects garbage - #209
Draft
samestep wants to merge 2 commits into
Draft
Conversation
`nh clean` shells out to `nix store gc`, which prints one line per store path it deletes. The new Nix CLI drops its verbosity to `lvlNotice` whenever stderr is a terminal, so those lines are filtered out before any logger sees them and the command sits silent for minutes: https://github.com/NixOS/nix/blob/master/src/nix/main.cc#L435-L441 Nix has no progress reporting for garbage collection to fall back on; `gc.cc` creates no activities at all, which NixOS/nix#15603 is open to fix. Until then, wrap `nh` so that `clean` runs with a pipe on its stdout, which is enough to bring the per-path lines back, and collapse them into a single status line that redraws in place. Everything else execs `nh` directly, as does `clean` itself when `--ask` needs a terminal for its prompt or when stdout is redirected and the whole log is more useful than a status line. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.