Open lilyball opened 5 years ago
..it doesn't show version info? It does here! :/
Hmm: a) I'm seeing version info-- what version of nix are you using? b) #2312 . c) #2658 FWIW.
- system: `"x86_64-darwin"`
- host os: `Darwin 18.5.0, macOS 10.14.4`
- multi-user?: `no`
- sandbox: `no`
- version: `nix-env (Nix) 2.2`
- channels(eridius): `"nixpkgs-19.09pre175347.02bb5e35eae"`
- nixpkgs: `/Users/eridius/.nix-defexpr/channels/nixpkgs`
Sample output:
> nix search ffsend
* nixpkgs.ffsend (ffsend)
Easily and securely share files from the command line. A fully featured Firefox Send client
The --verbose
flag isn't doing anything either:
> nix search --verbose ffsend
* nixpkgs.ffsend (ffsend)
Easily and securely share files from the command line. A fully featured Firefox Send client
I figured it out. It omits the version number when the search term matches the package name, but includes it when the search term doesn't match on the package name.
> nix search libgnurl
warning: using cached results; pass '-u' to update the cache
* nixpkgs.libgnurl (libgnurl)
A fork of libcurl used by GNUnet
> nix search nixpkgs.libgnurl
warning: using cached results; pass '-u' to update the cache
* nixpkgs.libgnurl (libgnurl-7.64.0)
A fork of libcurl used by GNUnet
This line is the bug:
wrap("\e[0;2m", hilite(name, nameMatch, "\e[0;2m")),
That should just be
wrap("\e[0;2m", name),
since name
already includes the appropriate highlighting. This line is buggy because name
includes the version, but nameMatch.suffix()
doesn't, so if nameMatch
isn't empty then it'll skip the version.
I'm tempted to submit a patch myself but I've never built Nix before. If it's not too hard I might try.
I confirm this is still a problem with nix-2.3.7
in 20.09:
$ nix search neovim-qt
warning: using cached results; pass '-u' to update the cache
* nixpkgs.neovim-qt (neovim-qt)
Neovim client library and GUI, in Qt5
* unstable.neovim-qt (neovim-qt)
Neovim client library and GUI, in Qt5
And when matching the full attribute path it does show the version:
$ nix search pkgs.neovim-qt
warning: using cached results; pass '-u' to update the cache
* nixpkgs.neovim-qt (neovim-qt-0.2.15)
Neovim client library and GUI, in Qt5
Can PR #3055 be considered to fix this? It is quite annoying not being able to see the version for the most common search case of matching the package name.
I don't think this problem exists anymore on master:
$ nix search nixpkgs neovim-qt
* legacyPackages.x86_64-linux.neovim-qt (0.2.16.1)
Neovim client library and GUI, in Qt5
Weird, now it's dropping the name entirely.
It calculates the name highlight (name2
) and then does nothing at all with it. See how @edolstra's output says
* legacyPackages.x86_64-linux.neovim-qt (0.2.16.1)
Neovim client library and GUI, in Qt5
instead of the expected
* legacyPackages.x86_64-linux.neovim-qt (neovim-qt-0.2.16.1)
Neovim client library and GUI, in Qt5
Looks like dead code from when we did show the name
.
Is there a reason we aren't showing name
anymore? Especially since it's part of what's being searched. Without showing name
, we can end up showing a result with no highlighting because the only match was in the name.
The version is still not displayed on some packages:
nix search duf
warning: using cached results; pass '-u' to update the cache
* nixos.duf (duf)
Disk Usage/Free Utility
* nixos.duff (duff)
Quickly find duplicate files
* nixos.ocamlPackages.duff (ocaml4.12.0-duff)
Pure OCaml implementation of libXdiff (Rabin’s fingerprint)
* nixos.python38Packages.dufte (python3.8-dufte)
Clean matplotlib plots
* nixos.python39Packages.dufte (python3.9-dufte)
Clean matplotlib plots
* nixpkgs-1903.duff (duff)
Quickly find duplicate files
* nixpkgs.duf (duf)
Disk Usage/Free Utility
* nixpkgs.duff (duff)
Quickly find duplicate files
* nixpkgs.ocamlPackages.duff (ocaml4.12.0-duff)
Pure OCaml implementation of libXdiff (Rabin’s fingerprint)
* nixpkgs.python38Packages.dufte (python3.8-dufte)
Clean matplotlib plots
* nixpkgs.python39Packages.dufte (python3.9-dufte)
Clean matplotlib plots
If add nixpkgs attribute, then the version is displayed:
nix search nixpkgs.duf
warning: using cached results; pass '-u' to update the cache
* nixpkgs.duf (duf-0.6.2)
Disk Usage/Free Utility
* nixpkgs.duff (duff-2014-07-03)
Quickly find duplicate files
The version is still not displayed on some packages
It’s working on Nix master:
$ nix search nixpkgs duf
* legacyPackages.x86_64-linux.duf (0.6.2)
Disk Usage/Free Utility
* legacyPackages.x86_64-linux.duff (2014-07-03)
Quickly find duplicate files
* legacyPackages.x86_64-linux.ocamlPackages.duff (0.4)
Pure OCaml implementation of libXdiff (Rabin’s fingerprint)
* legacyPackages.x86_64-linux.python38Packages.dufte (0.2.12)
Clean matplotlib plots
* legacyPackages.x86_64-linux.python39Packages.dufte (0.2.12)
Clean matplotlib plots
When will these changes be in the stable version?
came here to report that this is till an issue on nixos-21.05
I marked this as stale due to inactivity. → More info
not stale. Still an issue
When the
nix search
search term matches on the package name, thenix search
output drops the version from the name. If the term doesn't match on the name but instead matches on the attribute path or description, it displays the version.For example:
I'm assuming this is a consequence of using a different code path when emitting highlighting for the match in the package name.
nix (Nix) 2.2.2