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

Re: [PATCH] regex: not all macOS platforms seem to have REG_ENHANCED

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 20, 2026, 07:34 UTC
Message-ID
<3b0be017-2e6c-d1c8-0ed8-88ec4fa66e38@gmx.de>
In-Reply-To
<xmqqv7ergud0.fsf@gitster.g>
Hi Junio,
On Fri, 20 Mar 2026, Junio C Hamano wrote:
Show 29 quoted lines
> 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.
> >
> > Interesting.  https://en.wikipedia.org/wiki/MacOS_version_history says
> > macOS 14 (Sonoma) was released 2023-09-26, i.e. more than eight months
> > after the patch.  And the oldest regex(3) man page I could find also
> > mentions REG_ENHANCED:
> >
> > https://man.freebsd.org/cgi/man.cgi?query=regex&apropos=0&sektion=0&manpath=macOS+10.12.0&format=html
> 
> Well, I have no idea where this breakage came from; it suddenly
> started in today's pushout, and I do not think we have made any
> changes on our end to cause it.
> 
> E.g.,
> https://github.com/git/git/actions/runs/23315793655/job/67814861386#step:4:301
> 
> In any case, in the same CI run, a few other jobs on osx- that uses
> the same macos-14 image seem to be passing, so I am reasonably sure
> that the posted patch is a *bad* idea.  Instead of forcing us to
> figure out why REG_ENHANCED is missing, it would just hide the
> problem under the rug, possibly breaking a random regex tests that
> happen to depend on the "enhanced mode" working. X-<.

I also hit this in Git for Windows' "ever-green" branches: https://github.com/git-for-windows/git/actions/runs/23325790048/attempts/1

THe curious thing is that it only hits `osx-clang` and `osx-reftable`, but not `osx-gcc` nor `osx-meson`.

The breakage coincides with a runner image version bump: if you expand the
"Set up job" step, and within that step also expand the "Runner Image"
group, you will see that the succeeding (older) jobs use 20260302.0147.1,
the failing (newer) jobs use 20260317.0174.1. The change that strikes me
as most likely to be the culprit is the Homebrew bump 5.0.15 -> 5.1.0:
  https://github.com/actions/runner-images/compare/macos-14-arm64/20260302.0147..macos-14-arm64/20260317.0174#diff-5c04a529d3c8adf7a5f23afe544071dad1853e281c9c7b44cd8d626b6c57444dL35-R35

Now, 3 of the 4 `osx-*` jobs use `clang`, only `osx-gcc` uses `gcc`. So 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'
  endif
I'll continue looking along these lines.

Ciao, Johannes

Previous: Junio C HamanoNext: Johannes Schindelin
Message 4 of 14 in “regex: not all macOS platforms seem to have REG_ENHANCED”
  1. regex: not all macOS platforms seem to have REG_ENHANCEDJunio C Hamano, Mar 19, 2026
  2. René ScharfeMar 19, 2026
  3. Junio C HamanoMar 20, 2026
  4. Johannes SchindelinMar 20, 2026
  5. Johannes SchindelinMar 20, 2026
  6. Johannes SchindelinMar 20, 2026
  7. Johannes SchindelinMar 20, 2026
  8. Johannes SchindelinMar 20, 2026
  9. René ScharfeMar 20, 2026
  10. Johannes SchindelinMar 20, 2026
  11. René ScharfeMar 20, 2026
  12. Junio C HamanoMar 20, 2026
  13. Junio C HamanoMar 20, 2026
  14. Junio C HamanoMar 20, 2026

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.