#926333 ripgrep: PCRE2 is not available

Package:
ripgrep
Source:
rust-ripgrep
Description:
Recursively searches directories for a regex pattern
Submitter:
Jakub Wilk
Date:
2022-06-15 19:12:03 UTC
Severity:
wishlist
#926333#3
Date:
2019-04-03 16:21:15 UTC
From:
To:
I wanted to use rg with PCREs, but it didn't work:

    $ rg -P foo
    PCRE2 is not available in this build of ripgrep

Please enable PCRE2 support.

#926333#8
Date:
2020-03-14 10:36:08 UTC
From:
To:
I'd also like PCRE2 to be enabled. Stumbled over it because emacs/ivy's code search used the "--pcre2" switch without checking whether it was available.

Upstream provides .deb packages that have it enabled, statically linked it seems:
https://github.com/BurntSushi/ripgrep/blob/master/ci/build_deb.sh#L41-L43

When building manually I had to use 'cargo build --features pcre2 --release'

Quote README:
* ripgrep has optional support for switching its regex engine to use PCRE2.
  Among other things, this makes it possible to use look-around and
  backreferences in your patterns, which are not supported in ripgrep's default
  regex engine. PCRE2 support can be enabled with `-P/--pcre2` (use PCRE2
  always) or `--auto-hybrid-regex` (use PCRE2 only if needed).

#926333#13
Date:
2020-03-14 10:57:58 UTC
From:
To:
Quoting Martin Renold (2020-03-14 11:36:08)

I don't know ripgrep specifically, but from my work on licensecheck it
is my experience that RE2 engine is quite powerful compared to PCRE2, so
reading above I recommend to try "--auto-hybrid-regex" before "--pcre2"
(and report as a bug if "--auto-hybrid-regex" fails.

If those options are runtime options both available when ripgrep is
built with pcre2 support, then I sugges to encourage reverse
dependencies that hardcode "--pcre2" to try patch the code to instead
use "--auto-hybrid-regex".

 - Jonas

#926333#20
Date:
2022-06-15 19:08:33 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
rust-ripgrep, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 926333@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Sylvestre Ledru <sylvestre@debian.org> (supplier of updated rust-ripgrep package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Wed, 15 Jun 2022 20:39:19 +0200
Source: rust-ripgrep
Architecture: source
Version: 13.0.0-3
Distribution: unstable
Urgency: medium
Maintainer: Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
Changed-By: Sylvestre Ledru <sylvestre@debian.org>
Closes: 926333
Changes:
 rust-ripgrep (13.0.0-3) unstable; urgency=medium
 .
   * Package ripgrep 13.0.0 from crates.io using debcargo 2.5.0
   * Enable PCRE2 search (Closes: #926333)
Checksums-Sha1:
 1e817d800134f4d9f13c05bd7329358d749d2d64 2647 rust-ripgrep_13.0.0-3.dsc
 66911eda5b8be46f0d354e0489ea351f048a085a 5880 rust-ripgrep_13.0.0-3.debian.tar.xz
 bdbed363bec33ad6ef833319a1b4b7c85c57bd19 10695 rust-ripgrep_13.0.0-3_source.buildinfo
Checksums-Sha256:
 f315b73cbb451b77186b0f4fe02e3ac9bcf75333c4f20647c6f185ff38618429 2647 rust-ripgrep_13.0.0-3.dsc
 0eb35b23c75aff5288205cc074572cb63819174f000d84a378fa1549b2961973 5880 rust-ripgrep_13.0.0-3.debian.tar.xz
 5a05877ea23c2106433a52d9c9ab12fdbc428d117ec1a0195005ac6ce59d7d67 10695 rust-ripgrep_13.0.0-3_source.buildinfo
Files:
 ec685227e9e6d78b66288fb2872f30c5 2647 utils optional rust-ripgrep_13.0.0-3.dsc
 78352e25a121fd22a02149d1693aa851 5880 utils optional rust-ripgrep_13.0.0-3.debian.tar.xz
 0e449ebad12855961417e2ad6879b17b 10695 utils optional rust-ripgrep_13.0.0-3_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEtg21mU05vsTRqVzPfmUo2nUvG+EFAmKqJ1oACgkQfmUo2nUv
G+H25RAAiyNZM1VuUKtZY7p3bDSLxBsJSkGCYGfBq5FNZGYQLERLItrLcamj+CPj
HWj8V9PbJrjhO/3DQ1ArYUpKVfsZQzMqeWZ32eplNoGdwIwXseVH7hnd/VtibP4v
BEFFW/sR1upMTYlIRtJO75x72T0Kan9UjEFhA3zT2Myhe3uIdTlNmDugk9xkTMSP
D+q54thQvO9IGMuP1neTP5k6fABDpdmjBGMcpqMCIln07iY0SvxcFZqXtDzGvE86
WKYpVcnwflR4ob9CsSoQn3/cR62n1zngMDw0R00AQ/tDu49J0sICuYdcBqAvq9DX
Y5Pv1CTau2X+C7+qfHDGKoN4zCIxfOjxYxpO2+w/DeLrkkAtFe2/hItskzYWQaaR
+yzN0TuwUZXh9kQR6i7x0kJz9hzE09vWjWyaKKlonFErXOSQwgPKl1ORSqvp7r9s
2JJxifNUj4w0rEEVQcuqSqw/MOTA92bm8HpOWa4rgHvxIPInW05MTOJhlJjdQjOx
BPAOmmBALHHC7aMaB7wxXLWHFpD8bFKqcO5L75THq5KfAIPBbgeOZhDzcPbm95ce
TUxT5lOuuFyRrezV9fE2wnleEpZNDe6KIeHaRIv6y2enxb8ykmqch7Kw+TTclztR
necFMzIQYNf5dVdfHvp0kfE/3Y8mKtEGiIL9fMZxyHujCJ0wuO0=
=F8xO
-----END PGP SIGNATURE-----