Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated aliases should be annotated somehow to be obvious in nix search output #66731

Open
lilyball opened this issue Aug 16, 2019 · 8 comments
Labels
0.kind: enhancement 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md

Comments

@lilyball
Copy link
Member

Describe the bug
nixpkgs has a bunch of deprecated aliases for packages. These are alternative paths that contain the exact same derivation as a normal path.

This can be rather confusing when searching for packages with nix search as the aliases aren't marked in any fashion, leading to output like

* nixpkgs.youtube-dl (youtube-dl)
  Command-line tool to download videos from YouTube.com and other sites

* nixpkgs.youtubeDL (youtube-dl)
  Command-line tool to download videos from YouTube.com and other sites

There's no way to tell from this output which path you should use.

This issue was motivated by my friend who just installed Nix and one of his very first questions was "why are there duplicate packages?"

To Reproduce
Steps to reproduce the behavior:

  1. nix search 'youtube-?dl'

Expected behavior
It should include nixpkgs.youtube-dl, but it either shouldn't include nixpkgs.youtubeDL, or it should include it but marked as a deprecated alias.

Additional context
An obvious way we could handle this in nixpkgs is to modify the deprecated aliases such that the meta.description is prefixed with something like (Deprecated alias) .

In a more ideal world, these packages would be annotated specifically as aliases and nix search would be modified to do something with these, such as hide them by default but include a command-line flag to show aliases (perhaps even including a footer like "(12 deprecated compatibility aliases hidden; use --show-aliases to show)").

Or we could just hide them from nix search outright; if you know the attribute path for an alias you could find it with nix-env -qaA but if you're not already using the alias then you shouldn't start. This would require some way for nixpkgs to know that we're building the cache for nix search so it can skip them, which could possibly be accomplished by having nix search set a particular env var (NIX_SEARCH=1) and using builtins.getEnv to read it.

Metadata

  • system: "x86_64-darwin"
  • host os: Darwin 18.7.0, macOS 10.14.6
  • multi-user?: no
  • sandbox: no
  • version: nix-env (Nix) 2.2.2
  • channels(eridius): "nixpkgs-19.09pre186574.88d9f776091"
  • nixpkgs: /Users/eridius/.nix-defexpr/channels/nixpkgs
@matthewbauer
Copy link
Member

Ideally we could just hide the aliases completely, see NixOS/nix#2113

@stale

This comment has been minimized.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 2, 2020
@lilyball
Copy link
Member Author

lilyball commented Jun 3, 2020

I still care about this.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 3, 2020
@stale

This comment has been minimized.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 30, 2020
@lilyball
Copy link
Member Author

I still care about this.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 30, 2020
@stale
Copy link

stale bot commented Sep 21, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Sep 21, 2021
@lilyball
Copy link
Member Author

lilyball commented Sep 21, 2021

I still care about this. Also, I suspect this should be labeled as 0.kind: enhancement instead.

Edit: Oh neat, I have permissions to change labels.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Sep 21, 2021
@stale
Copy link

stale bot commented Apr 19, 2022

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: enhancement 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
Projects
None yet
Development

No branches or pull requests

2 participants