Subject: Re: Test failures when Git is built with libpcre and grep is built without it

From: "A. Wilcox" <[email-masked]>
Date: Mon, 9 Jan 2017 04:51:22 -0600

On 02/01/17 00:53, Jeff King wrote:
> On Sat, Dec 31, 2016 at 10:59:11PM -0600, A. Wilcox wrote:
> 
>> I'm attempting to package Git for our new Linux distribution and
>> I have run in to a failure on our PowerPC builder while running
>> the test suite.
>> 
>> The PowerPC builder runs a tiny version of grep(1) that was not
>> built with PCRE.  As such, grep -P returns 2 and prints:
>> 
>> grep: support for the -P option is not compiled into this -
>> --disable-perl-regexp binary
>> 
>> However, our Git build *does* link against libpcre.  This causes
>> a tests numbered 142 and 143 to fail in t7810-grep.sh.
> 
> If we are using "grep -P" in our test suite, it should definitely
> be marked with a prerequisite that is independent of the LIBPCRE
> one.
> 
> But I can't find any such place in our test suite. [snip] Can you
> show us the output of "./t7810-grep.sh -v -i"?
> 
> -Peff
> 

The output of this command was almost 1400 lines, so I attached the log.

Interestingly enough, you seem to be right.  The failure is very
bizarre and has nothing to do with system /bin/grep:

test_must_fail: command succeeded: git grep -G -F -P -E a\x{2b}b\x{2a}c ab
not ok 142 - grep -G -F -P -E pattern
#
#               >empty &&
#               test_must_fail git grep -G -F -P -E "a\x{2b}b\x{2a}c"
ab >actual &&
#               test_cmp empty actual
#

However:

elaine trash directory.t7810-grep # git grep -G -F -P -E
a\x{2b}b\x{2a}c ab >actual
fatal: command line, 'ax{2b}bx{2a}c': Invalid contents of {}
elaine trash directory.t7810-grep # echo $?
128
elaine trash directory.t7810-grep # cat actual
elaine trash directory.t7810-grep #

I can reliably reproduce this on our x86_64 builder as well.  Note
that our distro is based on the musl libc, not glibc.  The shell is:

GNU bash, version 4.3.48(1)-release (powerpc-foxkit-linux-musl)

lrwxrwxrwx 1 root root 4 Dec 29 10:43 /bin/sh -> /bin/bash

Any further assistance would be greatly appreciated; this one really
has me stumped.

Best,
-arw

-- 
A. Wilcox (awilfox)
Project Lead, Adélie Linux
http://adelielinux.org