Repository navigation
Conversation
drupol
left a comment
There was a problem hiding this comment.
Hello,
Thanks for the PR.
Can you make sure there's only one commit in this PR ? Please don't close it and don't recreate a new one, you can safely force push in this branch.
Thanks!
I've made the changes you requested! |
|
Hi, any update on this? |
|
Can you ping the maintainer of fish for a second review ? |
|
The reason this happens is because While in zsh and bash this needs to be explicitly enabled, and we add prefacing scripting to check for the existence of the database. Furthermore, the database generally won't exist if a system has been setup using flakes, as this tool relies on nix-channels for the database, so perhaps we should disable this tool by default - new users won't know about this tool if they use flakes and any other shell, which I believe is the general case. Otherwise, we could move the database check within the perl shell script and simplify this module. |
|
I'm not sure if it relies on nix-channels, from what I tested it relies on nix-index to be enabled. I thought of handling the missing file in command-not-found explicitly but opted against it as it would not be good for a tool to fail silently and we must return 127 if the command is not available. |
nix-index by default generates a database at While
Perhaps you are using the nixpkgs/pkgs/tools/package-management/nix-index/default.nix Lines 33 to 35 in fd48718 If you enable both |
Try out #416425, the |
|
I've seen your PR draft, but I'm a bit confused--is there something I need to change with this PR? I'm not able to see what is relevant as the draft is breaking, while this is just more of a patch that imitates the fixes used for other major shells in the meantime. |
Yeah I ended up trying a deeper solution to the same issue, so #416425 would replace this PR. It disables this command by default, but when it is enabled now instead of printing a database not found message, it prints a more comprehensive message explaining how to fix it. This is my first contribution to nix btw so I guess I will see how it goes. |
|
Hey @joshprk, I managed to get my PR merged which should fix this issue more generally: |
Currently Fish returns a verbose error by directly calling the command-not-found script as it does not catch the possibility that a database does not exist. This commit resolves this by doing what Bash and Zsh does to avoid this.
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.