Re: [PATCH] regex: not all macOS platforms seem to have REG_ENHANCED
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Mar 20, 2026, 07:48 UTC
- Message-ID
- <f08f7097-fea8-6dc6-ef49-da0bd5ea3c01@gmx.de>
- In-Reply-To
- <3b0be017-2e6c-d1c8-0ed8-88ec4fa66e38@gmx.de>
Hi,
On Fri, 20 Mar 2026, Johannes Schindelin wrote:
Show 20 quoted lines
> On Fri, 20 Mar 2026, Junio C Hamano wrote:
>
> > René Scharfe <l.s.r@web.de> writes:
> >
> > > On 3/19/26 11:37 PM, Junio C Hamano wrote:
> > >> Earlier, 54463d32 (use enhanced basic regular expressions on macOS,
> > >> 2023-01-08) started to use the REG_ENHANCED option when ERE is not
> > >> in use on macOS. The build seems to have started failing on
> > >> macos-14 CI jobs at GitHub, however, as apparently not all the macOS
> > >> platforms have this flag defined.
> > >
> [...] my money is on a clang update in Homebrew disabling support for
> `REG_ENHANCED`. But why is `osx-meson` not affected, it uses `clang`?
> Well, there's special handling for that in `meson.build`:
> https://gitlab.com/git-scm/git/-/blob/v2.53.0/meson.build#L1347-1350
>
> if compiler.get_define('REG_ENHANCED', prefix: '#include <regex.h>') != ''
> libgit_c_args += '-DUSE_ENHANCED_BASIC_REGULAR_EXPRESSIONS'
> libgit_sources += 'compat/regcomp_enhanced.c'
> endifAnd it looks indeed as if the `osx-meson` job picks up a difference and works around it. Last week, it detected `REG_ENHANCED`: https://github.com/git-for-windows/git/actions/runs/22920658960/job/66517862315#step:4:168
> Fetching value of define "REG_ENHANCED" : 0400
This week, it detects the absence: https://github.com/git-for-windows/git/actions/runs/23325790048/job/67846594275#step:4:173
> Fetching value of define "REG_ENHANCED" : (undefined)
So there you have it. One week, the `regex.h` headers defined `REG_ENHANCED`, the next week, they didn't.
Ciao, Johannes