{"thread":{"id":"44233","subject":"Systems with old regex system headers/libraries don't pick up git's compat/regex header file","startedAt":"2016-10-06T09:46:58Z","lastAt":"2016-10-07T16:06:24Z","messageCount":5,"participants":["Richard Lloyd","Junio C Hamano","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"303472","messageId":"9f43a2f1-5d7e-3a2e-5a83-40e92ab0d7b5@connectinternetsolutions.com","threadId":"44233","inReplyTo":null,"subject":"Systems with old regex system headers/libraries don't pick up git's compat/regex header file","fromName":"Richard Lloyd","fromEmail":"richard.lloyd@connectinternetsolutions.com","sentAt":"2016-10-06T09:15:49Z","receivedAt":"2016-10-06T09:46:58Z","isPatch":false,"sender":{"key":"richard.lloyd@connectinternetsolutions.com","avatar":null},"body":"git ships with a compat/regex tree containing a recent regex\nrelease, presumably with the intention of allowing systems with\neither no regex or an old regex installed to use the newer compat\nversion.\n\nWith the release of git-2.10.1, the use of a recent regex\nis now specifically checked in git-compat-util.h via a\n#ifndef REG_STARTEND check at line 979.\n\nUnfortunately, on systems with an older regex shipped as\nstandard (e.g. HP-UX 11), the include path picks up\n/usr/include/regex.h first, which doesn't define REG_STARTEND\nand the git-compat-util.h check fails.\n\nThe fix I applied on HP-UX 11 was to add -Icompat/regex\nto the CFLAGS ahead of other -I directives. Another possible\nchange needed might be to line 69 of compat/regex/regex.c:\n\n#include \"regex.h\"\n\nThis is to ensure that /usr/include/regex.h isn't picked up\n(since git ships its own regex.h in the compat/regex\ndir, it probably shouldn't #include <regex.h> anyway,\nwhich risks picking up an incompatible regex.h).\n\nRichard K. Lloyd,           E-mail: richard.lloyd@connectinternetsolutions.com\nConnect Internet Solutions,    WWW: https://www.connectinternetsolutions.com/\n4th Floor, New Barratt House,\n47, North John Street,\nLiverpool,\nMerseyside, UK. L2 6SG\n\n\n\n-- \nThis e-mail (and any attachments) is private and confidential. If you have \nreceived it in error, please notify the sender immediately and delete it \nfrom your system. Do not use, copy or disclose the information in any way \nnor act in reliance on it.\n\nAny views expressed in this message are those of the individual sender,\nexcept where the sender specifically states them to be the views of Connect\nInternet Solutions Ltd. This e-mail and any attachments are believed to be\nvirus free but it is the recipient's responsibility to ensure that they are.\n\nConnect Internet Solutions Ltd\n(A company registered in England No: 04424350)\nRegistered Office: 4th Floor, New Barratt House, 47 North John Street,\nLiverpool, L2 6SG\nTelephone: +44 (0) 151 282 4321\nVAT registration number: 758 2838 85\n"},{"id":"303509","messageId":"xmqqeg3tl4gj.fsf@gitster.mtv.corp.google.com","threadId":"44233","inReplyTo":"9f43a2f1-5d7e-3a2e-5a83-40e92ab0d7b5@connectinternetsolutions.com","subject":"Re: Systems with old regex system headers/libraries don't pick up git's compat/regex header file","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-10-06T18:25:48Z","receivedAt":"2016-10-06T18:27:07Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Richard Lloyd <richard.lloyd@connectinternetsolutions.com> writes:\n\n> git ships with a compat/regex tree containing a recent regex\n> release, presumably with the intention of allowing systems with\n> either no regex or an old regex installed to use the newer compat\n> version.\n\nQuick question.  Does NO_REGEX help?  cf. Makefile\n\n# Define NO_REGEX if your C library lacks regex support with REG_STARTEND\n# feature.\n"},{"id":"303515","messageId":"20161006191127.2vjtmxl7ygjeqcbk@sigill.intra.peff.net","threadId":"44233","inReplyTo":"9f43a2f1-5d7e-3a2e-5a83-40e92ab0d7b5@connectinternetsolutions.com","subject":"Re: Systems with old regex system headers/libraries don't pick up git's compat/regex header file","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-10-06T19:11:27Z","receivedAt":"2016-10-06T19:11:39Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Oct 06, 2016 at 10:15:49AM +0100, Richard Lloyd wrote:\n\n> Unfortunately, on systems with an older regex shipped as\n> standard (e.g. HP-UX 11), the include path picks up\n> /usr/include/regex.h first, which doesn't define REG_STARTEND\n> and the git-compat-util.h check fails.\n> \n> The fix I applied on HP-UX 11 was to add -Icompat/regex\n> to the CFLAGS ahead of other -I directives. Another possible\n> change needed might be to line 69 of compat/regex/regex.c:\n\nJunio mentioned the NO_REGEX knob in the Makefile. If that works for\nyou, the next step is probably to add a line to the HP-UX section of\nconfig.mak.uname, so that it just works out of the box.\n\n-Peff\n"},{"id":"303573","messageId":"4ac0ce84-ca6c-3650-ef5e-e13c54c60504@connectinternetsolutions.com","threadId":"44233","inReplyTo":"20161006191127.2vjtmxl7ygjeqcbk@sigill.intra.peff.net","subject":"Re: Systems with old regex system headers/libraries don't pick up git's compat/regex header file","fromName":"Richard Lloyd","fromEmail":"richard.lloyd@connectinternetsolutions.com","sentAt":"2016-10-07T15:45:08Z","receivedAt":"2016-10-07T15:45:25Z","isPatch":false,"sender":{"key":"richard.lloyd@connectinternetsolutions.com","avatar":null},"body":"On 06/10/16 20:11, Jeff King wrote:\n> Junio mentioned the NO_REGEX knob in the Makefile. If that works for\n> you, the next step is probably to add a line to the HP-UX section of\n> config.mak.uname, so that it just works out of the box.\n\nThis doesn't work because the check in git-compat-util.h only looks\nfor REG_STARTEND being defined (if it isn't, it #error's out).\n\nThat define is not mentioned anywhere else other than in the\ncompat/regex tree, which is why I used -Icompat/regex to pick up\n<regex.h> from there - this was the \"easiest\" solution for me on\nHP-UX 11.\n\nNote that with this inclusion change, the source compiled and linked\nfine on HP-UX 11 and git passed its tests, including the regex-based ones.\n\nRichard K. Lloyd,           E-mail: richard.lloyd@connectinternetsolutions.com\nConnect Internet Solutions,    WWW: https://www.connectinternetsolutions.com/\n4th Floor, New Barratt House,\n47, North John Street,\nLiverpool,\nMerseyside, UK. L2 6SG\n\n\n\n\n>\n> -Peff\n>\n\n\n\n\n-- \nThis e-mail (and any attachments) is private and confidential. If you have \nreceived it in error, please notify the sender immediately and delete it \nfrom your system. Do not use, copy or disclose the information in any way \nnor act in reliance on it.\n\nAny views expressed in this message are those of the individual sender,\nexcept where the sender specifically states them to be the views of Connect\nInternet Solutions Ltd. This e-mail and any attachments are believed to be\nvirus free but it is the recipient's responsibility to ensure that they are.\n\nConnect Internet Solutions Ltd\n(A company registered in England No: 04424350)\nRegistered Office: 4th Floor, New Barratt House, 47 North John Street,\nLiverpool, L2 6SG\nTelephone: +44 (0) 151 282 4321\nVAT registration number: 758 2838 85\n"},{"id":"303575","messageId":"20161007160611.wu2ehzqg6cxhkwgr@sigill.intra.peff.net","threadId":"44233","inReplyTo":"4ac0ce84-ca6c-3650-ef5e-e13c54c60504@connectinternetsolutions.com","subject":"Re: Systems with old regex system headers/libraries don't pick up git's compat/regex header file","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-10-07T16:06:11Z","receivedAt":"2016-10-07T16:06:24Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Oct 07, 2016 at 04:45:08PM +0100, Richard Lloyd wrote:\n\n> On 06/10/16 20:11, Jeff King wrote:\n> > Junio mentioned the NO_REGEX knob in the Makefile. If that works for\n> > you, the next step is probably to add a line to the HP-UX section of\n> > config.mak.uname, so that it just works out of the box.\n> \n> This doesn't work because the check in git-compat-util.h only looks\n> for REG_STARTEND being defined (if it isn't, it #error's out).\n> \n> That define is not mentioned anywhere else other than in the\n> compat/regex tree, which is why I used -Icompat/regex to pick up\n> <regex.h> from there - this was the \"easiest\" solution for me on\n> HP-UX 11.\n\nI'm confused. Setting NO_REGEX in the Makefile will add -Icompat/regex\nto your compiler invocation. So git-compat-util.h should pick up our\ncompat regex routines, which _do_ have REG_STARTEND.\n\nHow are you building? Doing:\n\n  make NO_REGEX=1\n\nis supposed to work, and if it doesn't, there's a bug.\n\n-Peff\n"}]}