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

command-not-found fails to suggest correct output to install #56576

Closed
domenkozar opened this issue Mar 1, 2019 · 9 comments
Closed

command-not-found fails to suggest correct output to install #56576

domenkozar opened this issue Mar 1, 2019 · 9 comments
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md

Comments

@domenkozar
Copy link
Member

domenkozar commented Mar 1, 2019

$ dig
The program ‘dig’ is currently not installed. You can install it by typing:
  nix-env -iA nixos.bind

$ nix-shell -p bind --run "dig"
/tmp/nix-shell-31821-0/rc: line 1: dig: command not found

The problem is that dig binary is in dnsutils output.

Now, this can be fixed two ways:

a) teach command-not-found about outputs

This would possibly need to extend narindex with information from what output are files coming from, so that it can suggest what output to use.

b) restrict stdenv to contain bin/ only in $out or $bin outputs

Pros/Cons

  • (b) might mean we have to fix many derivations to comply
  • if any of the packages need to exclude enforcement in (b) - for example due to closure size, they would again break command-not-found
  • (b) does make things more consistent and predictable for humans
@domenkozar
Copy link
Member Author

nix-index doesn't seem to have this bug as it indexes all files: https://github.com/bennofs/nix-index#a-files-database-for-nixpkgs

@vcunat
Copy link
Member

vcunat commented Mar 1, 2019

(b) seems too restrictive, for example in this particular dig case. EDIT: I mean, in this case we have the dnsutils alias if you use it directly, but that apparently gets filtered as a duplicate of bind.

@chreekat
Copy link
Contributor

How many commands does this affect besides dig?

Why does bind have split outputs?

@danbst
Copy link
Contributor

danbst commented Mar 18, 2020

still not resolved

@wmertens
Copy link
Contributor

I prefer a), and since nix-index already handles it correctly and also ships a command-not-found replacement, I vote to make nix-index the default.

@stale
Copy link

stale bot commented Dec 27, 2020

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 Dec 27, 2020
@wmertens
Copy link
Contributor

This would be fixed by #39789

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

stale bot commented Jun 28, 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 Jun 28, 2021
@Majiir
Copy link
Contributor

Majiir commented Aug 23, 2022

Closing in favor of a more recently active duplicate: #129713

@Majiir Majiir closed this as not planned Won't fix, can't repro, duplicate, stale Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
Projects
None yet
Development

No branches or pull requests

6 participants