Describe the bug
The package doesn't install all dependent applications for file formats that it supports searching across, so if installed on a minimal system it issues errors.
To Reproduce
Steps to reproduce the behavior:
nix-env -i ripgrep-allrga to search across a directory with ZIP archives within. Will get the following error:-------------------------------------------------------------------------------
adapter: zip
Error: Unsupported Zip archive: The file length is not available in the local header
-------------------------------------------------------------------------------
Expected behavior
Expectation is that ripgrep-all would bring in all dependent applications and not rely upon global or independent installation for it to work.
Screenshots
$ rga test .
./parse-san.zip: preprocessor command failed: '"rga-preproc" "./parse-san.zip"':
-------------------------------------------------------------------------------
adapter: zip
Error: Unsupported Zip archive: The file length is not available in the local header
-------------------------------------------------------------------------------
$
Metadata
$ nix run nixpkgs.nix-info -c nix-info -m
- system: `"x86_64-linux"`
- host os: `Linux 4.19.81, NixOS, 19.09.1476.72a2ced2523 (Loris)`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.3`
- channels(root): `"nixos-19.09.1019.c5aabb0d603, nixos-hardware"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
Maintainer information:
# a list of nixpkgs attributes affected by the problem
attribute:
- ripgrep-all
The (known) missing dependencies are tesseract, pdfpages, sqlite, tar, decompress, and zip. Adding tesseract alone would likely increase the closure size of the package significantly.
Do users of ripgrep-all expect all of its supported adapters to be available? I'm assuming that on other distros, users install the dependencies for the adapters they want to use. I see a few possibilities:
/run/current-system/sw/bin/. This should allow users to install executable dependencies (like zip), similar to how they would do in other distros.Pinging the maintainer @zaninime for insight.
Point 3 is already there. rga will look for executables in the $PATH, so it shouldn't necessary to pin it to a folder (especially since there are multiple ways to install binaries).
Point 1 and 2 can be made available by doing something similar to what's done here: https://github.com/NixOS/nixpkgs-channels/blob/7d5375ebf4cd417465327d7ab453687fd19663c9/pkgs/applications/science/robotics/gazebo/default.nix#L11
...by then using makeWrapper and prepending to the $PATH the selected binaries. That would also allow for overriding through an overlay.
Thank you, @zaninime
@marcb , I'll create a PR, but it will be merged into the master branch. If you need this backported to NixOS Loris (19.09) let me know so I can request it in the PR.
Note: The error about the unsupported zip file is not due to a missing dependency, but rather due to the Rust zip library used by ripgrep-all. See https://github.com/mvdnes/zip-rs/issues/108
Thank you, @zaninime
@marcb , I'll create a PR, but it will be merged into the master branch. If you need this backported to NixOS Loris (19.09) let me know so I can request it in the PR.
I don't think it needs back porting… happy to wait.
Do users of ripgrep-all expect all of its supported adapters to be available?
It might be related to the name of the package but my expectation was for _all_ to be supported due to its name ripgrep-all…
Do users of ripgrep-all expect all of its supported adapters to be available?
tesseract/imagemagick are not enabled by default since it is very slow and not useful most of the time. All the other deps are used by default.