nix store optimise and nix store gc (and possibly other progress reporting commands) drop output #774
Labels
No labels
Affects/CppNix
Affects/Nightly
Affects/Only nightly
Affects/Stable
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/lix ci
Area/nix-eval-jobs
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/repl/debugger
Area/store
awaiting
author
awaiting
contributors
bug
Context
contributors
Context
drive-by
Context
maintainers
Context
RFD
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
Feature/S3
imported
Language/Bash
Language/C++
Language/NixLang
Language/Python
Language/Rust
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
Topic/Large Scale Installations
ux
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lix-project/lix#774
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Describe the bug
There seems to be an issue with progress reporting nix3 commands in that if they print a final message after they complete, sometimes that message gets eaten. This clearly shouldn't happen as these commands are often long-running and when the user returns to the CLI they will not see what was completed.
Steps To Reproduce
nix store optimiseornix store gcExpected behavior
The final output messages (which for both are already specified in the code) should actually be displayed.
nix --versionoutputnix (Lix, like Nix) 2.93.0-dev(rev:f270d3ebe)does this only happen with the default logging or also with other logging formats?
I can confirm this happens with all logging formats.
I think the reason for this issue is this block of code in
lix/nix/main.cc:Since
nix store optimiseandnix store gcuseprintInfoto show the output likeXXMib freed by hard-linking y files(link) ordeleting garbage...(link), setting the verbosity level tolvlNoticewill hide these messages.However, removing this block of code causes issues #362 and #367 to reappear.
The way I see it, we have a few options:
printInfocalls toprintNoticeor similar for the more important messages (like the results).logger->cout()likenix searchdoes. Personally, I don't think this is a good solution.main.ccthat changes the log level. If we do this, we should reevaluate some of the logged messages. For instance, if we want to keep thenix store optimisemessages at the info still, we will need to change the level of some messages innix searchto the talkative level or something similar.I think option 3 would be the best, especially if we go through and enforce log levels. Say, for instance, result messages should be at the notice level, less verbose progress messages like
deleting garbage...should be at the info level and any more verbose progress messages should be at the talkative or lower level. The major downside to this that I can foresee is that a change like this would be pretty large, since we would likely want to do this to a lot of the nix 3 commands.