Re: [PATCH v5] meson: work around broken system PCRE2 dependency in macOS
- From
Carlo Arenas <carenas@gmail.com>
- Date
- Jul 16, 2025, 22:17 UTC
- Message-ID
- <CAPUEspg9apj011c4nRCjcxxOsxBtGfBz8p1vw9LwQ1uebw5=mw@mail.gmail.com>
- In-Reply-To
- <629a1c11-fceb-4f25-a917-319a99bfed57@gentoo.org>
On Wed, Jul 16, 2025 at 3:10 PM Eli Schwartz <eschwartz@gentoo.org> wrote:
Show 15 quoted lines
>
> On 7/16/25 3:30 PM, Carlo Marcelo Arenas Belón wrote:
>
> > +if pcre2.found() and pcre2.type_name() != 'internal' and host_machine.system() == 'darwin'
> > + # macOS installs a broken system package, double check
> > + if not compiler.has_header('pcre2.h', dependencies: pcre2)
> > + if pcre2_feature.enabled()
> > + # Attempt to fallback, method can't be pkg-config
> > + pcre2 = dependency('libpcre2-8', method: 'builtin', default_options: ['default_library=static', 'test=false'])
> > + if not pcre2.found()
> > + error('only a broken pcre2 install found and pcre2 is required')
>
> If you want to override the message from a specific dependency() call,
> "required" defaults to true and aborts on the line before
> "if not pcre2.found()"It is a little hacky, but because we are not using the method: auto, then won't try pkg-config again and fallback to the wrap because as you said, required defaults to true, and allow_fallback is true if required is true.
The only way this dependency() will fail is if --wrap-mode=nofallback and that won't cause it to abort.
Carlo