Nixpkgs: ripgrep-all: Doesn't explicitly reference dependencies such as zip/unzip and tesseract

Created on 16 Dec 2019  Â·  6Comments  Â·  Source: NixOS/nixpkgs

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:

  1. on a minimal system: nix-env -i ripgrep-all
  2. run rga 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
bug

All 6 comments

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:

  1. Add the dependencies to support all the adapters.
  2. Create a "full" package which features support for all the adapters.
  3. Apply a patch which forces ripgrep-all to look for executable dependencies in /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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

globin picture globin  Â·  65Comments

ttuegel picture ttuegel  Â·  98Comments

joepie91 picture joepie91  Â·  102Comments

nico202 picture nico202  Â·  70Comments

globin picture globin  Â·  65Comments