git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] meson: disable PCRE2 dependency by default

From
Carlo Arenas <carenas@gmail.com>
Date
Jul 14, 2025, 14:00 UTC
Message-ID
<CAPUEsphoFaS7CnxXs_PsMCtCrB7ByE+y+SxQGaxoovjAdH7UFQ@mail.gmail.com>
In-Reply-To
<aHKgu3Ew3Pk0PL2v@fruit.crustytoothpaste.net>

On Sat, Jul 12, 2025 at 10:51 AM brian m. carlson <sandals@crustytoothpaste.net> wrote:

Show 21 quoted lines
>
> On 2025-07-12 at 17:26:15, Carlo Marcelo Arenas Belón wrote:
> > Makefile requires the user to provide the USE_LIBPCRE2 flag to
> > enable this dependency, but meson has it enabled by default,
> > which can be problematic, at least in macOS.
> >
> > While a popular option and matching what was done by cmake
> > (which itself reflects what is preferred by Git for Windows)
> > could result in a broken build or linking with the wrong PCRE2
> > library.
> >
> > While not git's fault, macOS provides a PCRE2 library in base
> > that is not usable (even if it would pass the test) and not
> > configured properly, as it installs a pkgconf module that
> > points to a non existent pcre2.h header in /usr/local/include.
> >
> > Change the default to off, and let the user enable it once a
> > proper dependency is installed or meson instructed to fallback to
> > the wrap.
>
> Can we disable it by default on macOS instead of everywhere?
Yes, but I don't like it much, as it is:
* inconsistent with artifacts created with other build systems
* really an issue that should be fixed by Apple or at least handled
better in meson itself.
> For most
> builds on Linux, the system libpcre2 is the right one and users will
> expect to find PCRE support by default.

Agree with you on that, and indeed I think every packager of git (except for NonStop) does enable it at packaging time.

Maybe this is an argument to enable it by default?, one thing that I wonder though, is if we should first isolate the code on its own and link it only with `git grep`.

I think the rationale behind the current setup was that we will eventually replace all other regex engines with PCRE2, having better performance and retiring compat/regex, but code to do that failed to materialise, and I am not sure how realistic that was.

Carlo
> --
> brian m. carlson (they/them)
> Toronto, Ontario, CA
Previous: brian m. carlsonNext: Junio C Hamano
Message 3 of 28 in “meson: disable PCRE2 dependency by default”
  1. meson: disable PCRE2 dependency by defaultCarlo Marcelo Arenas Belón, Jul 12, 2025
  2. brian m. carlsonJul 12, 2025
  3. Carlo ArenasJul 14, 2025
  4. Junio C HamanoJul 14, 2025
  5. Carlo Marcelo Arenas BelónJul 14, 2025
  6. Junio C HamanoJul 14, 2025
  7. meson: disable PCRE2 dependency by default in macOSCarlo Marcelo Arenas Belón, Jul 13, 2025
  8. Junio C HamanoJul 13, 2025
  9. meson: disable PCRE2 dependency by default in macOSCarlo Marcelo Arenas Belón, Jul 13, 2025
  10. Eli SchwartzJul 15, 2025
  11. Patrick SteinhardtJul 15, 2025
  12. Carlo ArenasJul 15, 2025
  13. Patrick SteinhardtJul 15, 2025
  14. Carlo ArenasJul 15, 2025
  15. Eli SchwartzJul 15, 2025
  16. Carlo ArenasJul 15, 2025
  17. Eli SchwartzJul 15, 2025
  18. meson: woraround broken system PCRE2 dependency in macOSCarlo Marcelo Arenas Belón, Jul 15, 2025
  19. Junio C HamanoJul 15, 2025
  20. Eric SunshineJul 15, 2025
  21. meson: work around broken system PCRE2 dependency in macOSCarlo Marcelo Arenas Belón, Jul 16, 2025
  22. Junio C HamanoJul 16, 2025
  23. Junio C HamanoJul 16, 2025
  24. Eli SchwartzJul 16, 2025
  25. Carlo ArenasJul 16, 2025
  26. meson: work around broken system PCRE2 dependency in macOSCarlo Marcelo Arenas Belón, Jul 18, 2025
  27. Junio C HamanoJul 23, 2025
  28. Patrick SteinhardtJul 24, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.