nix --version 2>/dev/null
prints out extra context that is not printed when running nix --version
#620
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
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
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#620
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?
So, running
nix --version
outputs abbreviated version information. I thought this was on purpose, and it is weird thatnix-store --version
or so will output extra useful diagnostic information, and I meant to file a bug to makenix --version
do it too since it's nice.However, I had the following interaction with lix today, and it is surely a bug:
That is, whether the extra information is printed depends on interactivity status or something because piping stderr to /dev/null causes the additional data to appear. What?!
This should be fixed to always show it. See also: #230
Allô ! 👋
I made
--version
spit some debug infos.When you don't pipe
stderr
to/dev/null
you get the following:And when you pipe
stderr
to/dev/null
, you get the following:In
lix/libutil/logging.cc:121
, the default verbosity level seems to be defined aslvlInfo
, and in theprintVersion
function there's the following check:My first idea would be to simply remove the log level check in
printVersion
, because I don't think it's bad to have this information even if the log level is set tolvlError
.For the root cause, it seems to be due to the following lines in
lix/nix/main.cc
:But if I comment those lines, it breaks
functional/flakes/show.sh:113
test related tonix flake show
, and I'm not experience / skilled enough with flake and lix development / tests to quickly fix this.#230 related maybe to the debug info in --version
Here's the reasons that we haven't removed that logging stuff pending more work being done to actually fix it:
I think the practical thing to do is to delete the verbosity check in
--version
itself and do the other bits separately since that stuff is already printed innix-env --version
and similar. Let me check if nixpkgs is misusing it somewhere that might cause regressions.alright there's no obvious foolish stuff in nixpkgs, and besides, the only place they appear to do call it at all is without a tty attached, which won't have a behaviour change anyway. should be ok.
This issue was mentioned on Gerrit on the following CLs:
nix --version
")