All of lore.kernel.org
 help / color / mirror / Atom feed
* NO_REGEX defaults on obscure platforms
@ 2010-09-08 15:12 Ævar Arnfjörð Bjarmason
  2010-09-08 15:31 ` Brandon Casey
  0 siblings, 1 reply; 6+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2010-09-08 15:12 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: git, Gary V. Vaughan, Boyd Lynn Gerber, Brandon Casey,
	Jason Riedy, Robert Schiele

On Mon, Sep 6, 2010 at 07:41, Junio C Hamano <gitster@pobox.com> wrote:

> There are a few leftover bits in 'next' that need to be merged to 'master'
> before we declare a real -rc cycle, so tonight's pushout is -rc0.

One thing that's almost certainly wrong in v1.7.3-rc0 is the NO_REGEX
defaults. It's a non-issue for people who run the configure script,
but the Makefile probably has the wrong defaults on some obscure
platforms.

I've CC'd people involved in Tru64, UnixWare, SCO, HP/UX, IRIX etc. It
would be really useful if you could:

  1. Get v1.7.3-rc0
  2. Compile with the defaults, and NO_REGEX=YesPlease
  3. Run `cd t && ./t7008-grep-binary.sh` and report the results.

That test is probably failing on some of these platforms.

Alternatively, just check for REG_STARTEND in regex.h (or the includes
it pulls in):

    $ grep REG_STARTEND /usr/include/regex.h
    #define REG_STARTEND (1 << 2)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: NO_REGEX defaults on obscure platforms
  2010-09-08 15:12 NO_REGEX defaults on obscure platforms Ævar Arnfjörð Bjarmason
@ 2010-09-08 15:31 ` Brandon Casey
  2010-09-08 17:20   ` Jakub Narebski
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Brandon Casey @ 2010-09-08 15:31 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: Junio C Hamano, git, Gary V. Vaughan, Boyd Lynn Gerber,
	Brandon Casey, Jason Riedy, Robert Schiele

On 09/08/2010 10:12 AM, Ævar Arnfjörð Bjarmason wrote:
> On Mon, Sep 6, 2010 at 07:41, Junio C Hamano <gitster@pobox.com> wrote:
> 
>> There are a few leftover bits in 'next' that need to be merged to 'master'
>> before we declare a real -rc cycle, so tonight's pushout is -rc0.
> 
> One thing that's almost certainly wrong in v1.7.3-rc0 is the NO_REGEX
> defaults. It's a non-issue for people who run the configure script,
> but the Makefile probably has the wrong defaults on some obscure
> platforms.
> 
> I've CC'd people involved in Tru64, UnixWare, SCO, HP/UX, IRIX etc. It
> would be really useful if you could:
> 
>   1. Get v1.7.3-rc0
>   2. Compile with the defaults, and NO_REGEX=YesPlease
>   3. Run `cd t && ./t7008-grep-binary.sh` and report the results.
> 
> That test is probably failing on some of these platforms.

Yes, I've already tested and IRIX does indeed need to use the compat
regex, i.e. IRIX needs NO_REGEX=YesPlease.

> Alternatively, just check for REG_STARTEND in regex.h (or the includes
> it pulls in):
> 
>     $ grep REG_STARTEND /usr/include/regex.h
>     #define REG_STARTEND (1 << 2)

Unfortunately, IRIX actually defines REG_STARTEND in its regex.h, but
the feature does not seem to work.  This also means the configure script
will give a false negative and indicate that NO_REGEX should _not_ be
set, when it actually should be.

I have a few other patches, in addition to this NO_REGEX setting, that
I haven't found time to submit, but my feelings won't be hurt if someone
else beats me to it. (hint, hint :)

-Brandon

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: NO_REGEX defaults on obscure platforms
  2010-09-08 15:31 ` Brandon Casey
@ 2010-09-08 17:20   ` Jakub Narebski
  2010-09-09 19:15   ` [PATCH 1/2] t/t7008: workaround broken handling of \000 by printf on IRIX Brandon Casey
  2010-09-09 19:15   ` [PATCH 2/2] Makefile: use compat regex on IRIX 6.5 Brandon Casey
  2 siblings, 0 replies; 6+ messages in thread
From: Jakub Narebski @ 2010-09-08 17:20 UTC (permalink / raw)
  To: Brandon Casey
  Cc: Ævar Arnfjörð Bjarmason, Junio C Hamano, git,
	Gary V. Vaughan, Boyd Lynn Gerber, Brandon Casey, Jason Riedy,
	Robert Schiele

Brandon Casey <brandon.casey.ctr@nrlssc.navy.mil> writes:
> On 09/08/2010 10:12 AM, Ævar Arnfjörð Bjarmason wrote:
>> On Mon, Sep 6, 2010 at 07:41, Junio C Hamano <gitster@pobox.com> wrote:
>> 
>>> There are a few leftover bits in 'next' that need to be merged to 'master'
>>> before we declare a real -rc cycle, so tonight's pushout is -rc0.
>> 
>> One thing that's almost certainly wrong in v1.7.3-rc0 is the NO_REGEX
>> defaults. It's a non-issue for people who run the configure script,
>> but the Makefile probably has the wrong defaults on some obscure
>> platforms.
[...]

>> Alternatively, just check for REG_STARTEND in regex.h (or the includes
>> it pulls in):
>> 
>>     $ grep REG_STARTEND /usr/include/regex.h
>>     #define REG_STARTEND (1 << 2)
> 
> Unfortunately, IRIX actually defines REG_STARTEND in its regex.h, but
> the feature does not seem to work.  This also means the configure script
> will give a false negative and indicate that NO_REGEX should _not_ be
> set, when it actually should be.

Well, that just means that the test for NO_REGEX in configure.ac
should be more involved than just checking if REG_STARTEND is defined:
it should test if regex can truly handle null bytes.  There are some
examples of such test programs: see e.g. check for NO_C99_FORMAT
above.

-- 
Jakub Narebski
Poland
ShadeHawk on #git

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] t/t7008: workaround broken handling of \000 by printf on IRIX
  2010-09-08 15:31 ` Brandon Casey
  2010-09-08 17:20   ` Jakub Narebski
@ 2010-09-09 19:15   ` Brandon Casey
  2010-09-09 19:15   ` [PATCH 2/2] Makefile: use compat regex on IRIX 6.5 Brandon Casey
  2 siblings, 0 replies; 6+ messages in thread
From: Brandon Casey @ 2010-09-09 19:15 UTC (permalink / raw)
  To: gitster; +Cc: git, avarab, Brandon Casey

From: Brandon Casey <drafnel@gmail.com>

On IRIX 6.5, the printf utility in /usr/bin does not appear to handle the
\ddd notation according to POSIX.  This printf appears to halt processing
of the string argument and ignore any additional characters in the string.
Work around this flaw by replacing the \000's with 'Q' and using the
q_to_nul helper function provided by test-lib.sh

This problem with printf is not apparent when using the Bash shell since
Bash implements a POSIX compatible printf function internally.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 t/t7008-grep-binary.sh |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/t/t7008-grep-binary.sh b/t/t7008-grep-binary.sh
index c0f9f3f..e058d18 100755
--- a/t/t7008-grep-binary.sh
+++ b/t/t7008-grep-binary.sh
@@ -5,7 +5,7 @@ test_description='git grep in binary files'
 . ./test-lib.sh
 
 test_expect_success 'setup' "
-	printf 'binary\000file\n' >a &&
+	echo 'binaryQfile' | q_to_nul >a &&
 	git add a &&
 	git commit -m.
 "
@@ -70,32 +70,32 @@ test_expect_failure 'git grep .fi a' '
 '
 
 test_expect_success 'git grep -F y<NUL>f a' "
-	printf 'y\000f' >f &&
+	printf 'yQf' | q_to_nul >f &&
 	git grep -f f -F a
 "
 
 test_expect_success 'git grep -F y<NUL>x a' "
-	printf 'y\000x' >f &&
+	printf 'yQx' | q_to_nul >f &&
 	test_must_fail git grep -f f -F a
 "
 
 test_expect_success 'git grep -Fi Y<NUL>f a' "
-	printf 'Y\000f' >f &&
+	printf 'YQf' | q_to_nul >f &&
 	git grep -f f -Fi a
 "
 
 test_expect_failure 'git grep -Fi Y<NUL>x a' "
-	printf 'Y\000x' >f &&
+	printf 'YQx' | q_to_nul >f &&
 	test_must_fail git grep -f f -Fi a
 "
 
 test_expect_success 'git grep y<NUL>f a' "
-	printf 'y\000f' >f &&
+	printf 'yQf' | q_to_nul >f &&
 	git grep -f f a
 "
 
 test_expect_failure 'git grep y<NUL>x a' "
-	printf 'y\000x' >f &&
+	printf 'yQx' | q_to_nul >f &&
 	test_must_fail git grep -f f a
 "
 
-- 
1.7.2.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] Makefile: use compat regex on IRIX 6.5
  2010-09-08 15:31 ` Brandon Casey
  2010-09-08 17:20   ` Jakub Narebski
  2010-09-09 19:15   ` [PATCH 1/2] t/t7008: workaround broken handling of \000 by printf on IRIX Brandon Casey
@ 2010-09-09 19:15   ` Brandon Casey
  2010-09-10  0:10     ` Junio C Hamano
  2 siblings, 1 reply; 6+ messages in thread
From: Brandon Casey @ 2010-09-09 19:15 UTC (permalink / raw)
  To: gitster; +Cc: git, avarab, Brandon Casey

From: Brandon Casey <drafnel@gmail.com>

The IRIX 6.5 regex.h header file defines REG_STARTEND, but the feature does
not appear to work.  Since REG_STARTEND is required for proper functioning
of git-grep, set NO_REGEX and use the alternative regex libraries in compat/

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 Makefile |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 8b7c243..c27e8bc 100644
--- a/Makefile
+++ b/Makefile
@@ -982,6 +982,7 @@ ifeq ($(uname_S),IRIX)
 	# NO_MMAP.  If you suspect that your compiler is not affected by this
 	# issue, comment out the NO_MMAP statement.
 	NO_MMAP = YesPlease
+	NO_REGEX = YesPlease
 	SNPRINTF_RETURNS_BOGUS = YesPlease
 	SHELL_PATH = /usr/gnu/bin/bash
 	NEEDS_LIBGEN = YesPlease
@@ -1000,6 +1001,7 @@ ifeq ($(uname_S),IRIX64)
 	# NO_MMAP.  If you suspect that your compiler is not affected by this
 	# issue, comment out the NO_MMAP statement.
 	NO_MMAP = YesPlease
+	NO_REGEX = YesPlease
 	SNPRINTF_RETURNS_BOGUS = YesPlease
 	SHELL_PATH=/usr/gnu/bin/bash
 	NEEDS_LIBGEN = YesPlease
-- 
1.7.2.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] Makefile: use compat regex on IRIX 6.5
  2010-09-09 19:15   ` [PATCH 2/2] Makefile: use compat regex on IRIX 6.5 Brandon Casey
@ 2010-09-10  0:10     ` Junio C Hamano
  0 siblings, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2010-09-10  0:10 UTC (permalink / raw)
  To: Brandon Casey; +Cc: git, avarab, Brandon Casey

Thanks, as always.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-09-10  0:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-08 15:12 NO_REGEX defaults on obscure platforms Ævar Arnfjörð Bjarmason
2010-09-08 15:31 ` Brandon Casey
2010-09-08 17:20   ` Jakub Narebski
2010-09-09 19:15   ` [PATCH 1/2] t/t7008: workaround broken handling of \000 by printf on IRIX Brandon Casey
2010-09-09 19:15   ` [PATCH 2/2] Makefile: use compat regex on IRIX 6.5 Brandon Casey
2010-09-10  0:10     ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.