# [PATCH] Makefile: fix default regex settings on Darwin

5 messages from 2013-05-11 to 2013-05-11. Participants: David Aguilar, Jonathan Nieder.
Thread: https://gitlist.dev/t/33785

## David Aguilar, 2013-05-11 05:08

Subject: [PATCH] Makefile: fix default regex settings on Darwin
Message-ID: <1368248913-95188-1-git-send-email-davvid@gmail.com>
URL: https://gitlist.dev/e/1368248913-95188-1-git-send-email-davvid%40gmail.com

```
t0070-fundamental.sh fails on Mac OS X 10.8 by default.
Fix it by using Git's regex library.

Signed-off-by: David Aguilar <davvid@gmail.com>
---
"make test" fails right now; this fixes it.
t0070-fundamental is how far it got last time.
It's still running now.. :-)

 Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Makefile b/Makefile
index 7e12999..4a462c0 100644
--- a/Makefile
+++ b/Makefile
@@ -1057,6 +1057,7 @@ ifeq ($(uname_S),Darwin)
 	COMMON_DIGEST_SHA1 = YesPlease
 	COMMON_DIGEST_HMAC = YesPlease
 	PTHREAD_LIBS =
+	NO_REGEX = YesPlease
 endif
 
 ifndef CC_LD_DYNPATH
-- 
1.8.3.rc1.47.g6e51a5f

```

## Jonathan Nieder, 2013-05-11 06:31

Subject: Re: [PATCH] Makefile: fix default regex settings on Darwin
Message-ID: <20130511063132.GF3394@elie>
URL: https://gitlist.dev/e/20130511063132.GF3394%40elie
In-Reply-To: <1368248913-95188-1-git-send-email-davvid@gmail.com>

```
David Aguilar wrote:

> t0070-fundamental.sh fails on Mac OS X 10.8 by default.
> Fix it by using Git's regex library.

Can you say more about the failure?  What does

	./t0070-fundamental.sh -v

say?

Curious,
Jonathan

```

## David Aguilar, 2013-05-11 06:44

Subject: Re: [PATCH] Makefile: fix default regex settings on Darwin
Message-ID: <CAJDDKr5StD_bDr7+29qEYc4Lza+q8w=ZrHuwdSLwvCSru3YYWQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAJDDKr5StD_bDr7%2B29qEYc4Lza%2Bq8w%3DZrHuwdSLwvCSru3YYWQ%40mail.gmail.com
In-Reply-To: <20130511063132.GF3394@elie>

```
On Fri, May 10, 2013 at 11:31 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> David Aguilar wrote:
>
>> t0070-fundamental.sh fails on Mac OS X 10.8 by default.
>> Fix it by using Git's regex library.
>
> Can you say more about the failure?  What does
>
>         ./t0070-fundamental.sh -v
>
> say?

[..snip...]

expecting success:
# if this test fails, re-build git with NO_REGEX=1
test-regex

fatal: regex bug confirmed: re-build git with NO_REGEX=1
not ok 4 - check for a bug in the regex routines
#
# # if this test fails, re-build git with NO_REGEX=1
# test-regex
#

# failed 1 among 4 test(s)
1..4
--
David

```

## Jonathan Nieder, 2013-05-11 07:04

Subject: Re: [PATCH] Makefile: fix default regex settings on Darwin
Message-ID: <20130511070423.GG3394@elie>
URL: https://gitlist.dev/e/20130511070423.GG3394%40elie
In-Reply-To: <CAJDDKr5StD_bDr7+29qEYc4Lza+q8w=ZrHuwdSLwvCSru3YYWQ@mail.gmail.com>

```
David Aguilar wrote:

> expecting success:
> # if this test fails, re-build git with NO_REGEX=1
> test-regex
>
> fatal: regex bug confirmed: re-build git with NO_REGEX=1

Thanks.  Gah.  That means that regcomp() with REG_NEWLINE is letting

	[^={} \t]+

match the newline in

	={}\nfred

despite the POSIX requirement

	A <newline> in string shall not be matched by a period outside
	a bracket expression or by any form of a non-matching list

where

	A non-matching list expression begins with a <circumflex> ('^')
	and specifies a list that shall match any single-character
	collating element except for the expressions represented in
	the list after the leading <circumflex>.

and if I understand you correctly, this is a regression in Apple
libc. :(

With the commit message modified to mention the "fatal: regex bug
confirmed: re-build git with NO_REGEX=1" and uname -a output,

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

Do you know if this has been reported to Apple and
openradar.appspot.com?

```

## David Aguilar, 2013-05-11 07:55

Subject: Re: [PATCH] Makefile: fix default regex settings on Darwin
Message-ID: <CAJDDKr5t+hVE-TpNbVWmLL4VFq-NGjuVhcyPG=quaf6icz+E4Q@mail.gmail.com>
URL: https://gitlist.dev/e/CAJDDKr5t%2BhVE-TpNbVWmLL4VFq-NGjuVhcyPG%3Dquaf6icz%2BE4Q%40mail.gmail.com
In-Reply-To: <20130511070423.GG3394@elie>

```
On Sat, May 11, 2013 at 12:04 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> David Aguilar wrote:
>
>> expecting success:
>> # if this test fails, re-build git with NO_REGEX=1
>> test-regex
>>
>> fatal: regex bug confirmed: re-build git with NO_REGEX=1
>
> Thanks.  Gah.  That means that regcomp() with REG_NEWLINE is letting
>
>         [^={} \t]+
>
> match the newline in
>
>         ={}\nfred
>
> despite the POSIX requirement
>
>         A <newline> in string shall not be matched by a period outside
>         a bracket expression or by any form of a non-matching list
>
> where
>
>         A non-matching list expression begins with a <circumflex> ('^')
>         and specifies a list that shall match any single-character
>         collating element except for the expressions represented in
>         the list after the leading <circumflex>.
>
> and if I understand you correctly, this is a regression in Apple
> libc. :(
>
> With the commit message modified to mention the "fatal: regex bug
> confirmed: re-build git with NO_REGEX=1" and uname -a output,
>
> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

Thanks. I can adjust the commit message and re-roll to make this patch 1/3.

> Do you know if this has been reported to Apple and
> openradar.appspot.com?

I checked and nope, there are no bug reports.  I tried to submit one
by creating a "new radar" but that page said to go to
bugreport.apple.com.

I tried to login there but after entering my credentials I got, "An
error has occurred. Please report the error to Apple Inc. by emailing
the error detail to devbugs@apple.com."  Oh bother ;-)

I refreshed the page and finally got in.  I submitted a bug.. Problem # 13868200

I hop on this laptop to test for cross-platform issues (I'm a Linux
user myself ;-) and it's been pretty good at finding 'em.
--
David

```
