All of lore.kernel.org
 help / color / mirror / Atom feed
* Systems with old regex system headers/libraries don't pick up git's compat/regex header file
@ 2016-10-06  9:15 Richard Lloyd
  2016-10-06 18:25 ` Junio C Hamano
  2016-10-06 19:11 ` Jeff King
  0 siblings, 2 replies; 5+ messages in thread
From: Richard Lloyd @ 2016-10-06  9:15 UTC (permalink / raw)
  To: git

git ships with a compat/regex tree containing a recent regex
release, presumably with the intention of allowing systems with
either no regex or an old regex installed to use the newer compat
version.

With the release of git-2.10.1, the use of a recent regex
is now specifically checked in git-compat-util.h via a
#ifndef REG_STARTEND check at line 979.

Unfortunately, on systems with an older regex shipped as
standard (e.g. HP-UX 11), the include path picks up
/usr/include/regex.h first, which doesn't define REG_STARTEND
and the git-compat-util.h check fails.

The fix I applied on HP-UX 11 was to add -Icompat/regex
to the CFLAGS ahead of other -I directives. Another possible
change needed might be to line 69 of compat/regex/regex.c:

#include "regex.h"

This is to ensure that /usr/include/regex.h isn't picked up
(since git ships its own regex.h in the compat/regex
dir, it probably shouldn't #include <regex.h> anyway,
which risks picking up an incompatible regex.h).

Richard K. Lloyd,           E-mail: richard.lloyd@connectinternetsolutions.com
Connect Internet Solutions,    WWW: https://www.connectinternetsolutions.com/
4th Floor, New Barratt House,
47, North John Street,
Liverpool,
Merseyside, UK. L2 6SG



-- 
This e-mail (and any attachments) is private and confidential. If you have 
received it in error, please notify the sender immediately and delete it 
from your system. Do not use, copy or disclose the information in any way 
nor act in reliance on it.

Any views expressed in this message are those of the individual sender,
except where the sender specifically states them to be the views of Connect
Internet Solutions Ltd. This e-mail and any attachments are believed to be
virus free but it is the recipient's responsibility to ensure that they are.

Connect Internet Solutions Ltd
(A company registered in England No: 04424350)
Registered Office: 4th Floor, New Barratt House, 47 North John Street,
Liverpool, L2 6SG
Telephone: +44 (0) 151 282 4321
VAT registration number: 758 2838 85

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

* Re: Systems with old regex system headers/libraries don't pick up git's compat/regex header file
  2016-10-06  9:15 Systems with old regex system headers/libraries don't pick up git's compat/regex header file Richard Lloyd
@ 2016-10-06 18:25 ` Junio C Hamano
  2016-10-06 19:11 ` Jeff King
  1 sibling, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2016-10-06 18:25 UTC (permalink / raw)
  To: Richard Lloyd; +Cc: git

Richard Lloyd <richard.lloyd@connectinternetsolutions.com> writes:

> git ships with a compat/regex tree containing a recent regex
> release, presumably with the intention of allowing systems with
> either no regex or an old regex installed to use the newer compat
> version.

Quick question.  Does NO_REGEX help?  cf. Makefile

# Define NO_REGEX if your C library lacks regex support with REG_STARTEND
# feature.

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

* Re: Systems with old regex system headers/libraries don't pick up git's compat/regex header file
  2016-10-06  9:15 Systems with old regex system headers/libraries don't pick up git's compat/regex header file Richard Lloyd
  2016-10-06 18:25 ` Junio C Hamano
@ 2016-10-06 19:11 ` Jeff King
  2016-10-07 15:45   ` Richard Lloyd
  1 sibling, 1 reply; 5+ messages in thread
From: Jeff King @ 2016-10-06 19:11 UTC (permalink / raw)
  To: Richard Lloyd; +Cc: git

On Thu, Oct 06, 2016 at 10:15:49AM +0100, Richard Lloyd wrote:

> Unfortunately, on systems with an older regex shipped as
> standard (e.g. HP-UX 11), the include path picks up
> /usr/include/regex.h first, which doesn't define REG_STARTEND
> and the git-compat-util.h check fails.
> 
> The fix I applied on HP-UX 11 was to add -Icompat/regex
> to the CFLAGS ahead of other -I directives. Another possible
> change needed might be to line 69 of compat/regex/regex.c:

Junio mentioned the NO_REGEX knob in the Makefile. If that works for
you, the next step is probably to add a line to the HP-UX section of
config.mak.uname, so that it just works out of the box.

-Peff

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

* Re: Systems with old regex system headers/libraries don't pick up git's compat/regex header file
  2016-10-06 19:11 ` Jeff King
@ 2016-10-07 15:45   ` Richard Lloyd
  2016-10-07 16:06     ` Jeff King
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Lloyd @ 2016-10-07 15:45 UTC (permalink / raw)
  To: Jeff King; +Cc: git

On 06/10/16 20:11, Jeff King wrote:
> Junio mentioned the NO_REGEX knob in the Makefile. If that works for
> you, the next step is probably to add a line to the HP-UX section of
> config.mak.uname, so that it just works out of the box.

This doesn't work because the check in git-compat-util.h only looks
for REG_STARTEND being defined (if it isn't, it #error's out).

That define is not mentioned anywhere else other than in the
compat/regex tree, which is why I used -Icompat/regex to pick up
<regex.h> from there - this was the "easiest" solution for me on
HP-UX 11.

Note that with this inclusion change, the source compiled and linked
fine on HP-UX 11 and git passed its tests, including the regex-based ones.

Richard K. Lloyd,           E-mail: richard.lloyd@connectinternetsolutions.com
Connect Internet Solutions,    WWW: https://www.connectinternetsolutions.com/
4th Floor, New Barratt House,
47, North John Street,
Liverpool,
Merseyside, UK. L2 6SG




>
> -Peff
>




-- 
This e-mail (and any attachments) is private and confidential. If you have 
received it in error, please notify the sender immediately and delete it 
from your system. Do not use, copy or disclose the information in any way 
nor act in reliance on it.

Any views expressed in this message are those of the individual sender,
except where the sender specifically states them to be the views of Connect
Internet Solutions Ltd. This e-mail and any attachments are believed to be
virus free but it is the recipient's responsibility to ensure that they are.

Connect Internet Solutions Ltd
(A company registered in England No: 04424350)
Registered Office: 4th Floor, New Barratt House, 47 North John Street,
Liverpool, L2 6SG
Telephone: +44 (0) 151 282 4321
VAT registration number: 758 2838 85

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

* Re: Systems with old regex system headers/libraries don't pick up git's compat/regex header file
  2016-10-07 15:45   ` Richard Lloyd
@ 2016-10-07 16:06     ` Jeff King
  0 siblings, 0 replies; 5+ messages in thread
From: Jeff King @ 2016-10-07 16:06 UTC (permalink / raw)
  To: Richard Lloyd; +Cc: git

On Fri, Oct 07, 2016 at 04:45:08PM +0100, Richard Lloyd wrote:

> On 06/10/16 20:11, Jeff King wrote:
> > Junio mentioned the NO_REGEX knob in the Makefile. If that works for
> > you, the next step is probably to add a line to the HP-UX section of
> > config.mak.uname, so that it just works out of the box.
> 
> This doesn't work because the check in git-compat-util.h only looks
> for REG_STARTEND being defined (if it isn't, it #error's out).
> 
> That define is not mentioned anywhere else other than in the
> compat/regex tree, which is why I used -Icompat/regex to pick up
> <regex.h> from there - this was the "easiest" solution for me on
> HP-UX 11.

I'm confused. Setting NO_REGEX in the Makefile will add -Icompat/regex
to your compiler invocation. So git-compat-util.h should pick up our
compat regex routines, which _do_ have REG_STARTEND.

How are you building? Doing:

  make NO_REGEX=1

is supposed to work, and if it doesn't, there's a bug.

-Peff

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

end of thread, other threads:[~2016-10-07 16:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-06  9:15 Systems with old regex system headers/libraries don't pick up git's compat/regex header file Richard Lloyd
2016-10-06 18:25 ` Junio C Hamano
2016-10-06 19:11 ` Jeff King
2016-10-07 15:45   ` Richard Lloyd
2016-10-07 16:06     ` Jeff King

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.