{"thread":{"id":"34693","subject":"Git bug. \"make [all]\" does not use USE_LIBPCRE when \"configure --with-libpcre\" was previously run","startedAt":"2013-08-14T12:48:49Z","lastAt":"2013-08-15T06:51:23Z","messageCount":4,"participants":["Alexey Shumkin","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"225200","messageId":"20130814124849.GA8234@ashu.dyn1.rarus.ru","threadId":"34693","inReplyTo":null,"subject":"Git bug. \"make [all]\" does not use USE_LIBPCRE when \"configure --with-libpcre\" was previously run","fromName":"Alexey Shumkin","fromEmail":"alex.crezoff@gmail.com","sentAt":"2013-08-14T12:48:49Z","receivedAt":"2013-08-14T12:48:49Z","isPatch":false,"sender":{"key":"alex.crezoff@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1183752?v=4"},"body":"Hello, Stefan!\n\nI'll begin from afar.\n\n>From time to time, I use `git grep -P` to search text in sources using PCRE.\nToday I was suprised when that command gave me the error\n    \"fatal: cannot use Perl-compatible regexes when not compiled with\n    USE_LIBPCRE\"\n\nAs far as I always use\n    ./configure --with-libpcre \n    make all\nto build my Cygwin version of Git that was a VERY sudden error for me.\n(but this is not a Cygwin-specific error, I've reproduced it on my Linux\nbox).\n\nI've found out that `make` \"does not know\" anymore about USE_LIBPCRE=YesPlease\neven `./configure --with-libpcre` was run before it. But I do remember\nthat it worked in some versions before (currently I use latest - v1.8.3.4).\n\nSo, I've got armed with the following test script:\n\n---8<---\n#!/bin/sh\n\nset -e\n./configure --with-libpcre\nmake\nset +e\n./bin-wrappers/git grep -qIP das+\n# if \"cannot use Perl-compatible regexes\" error occurs\n# then Git exits with an error code 128 (but `git bisect run` fails to\n# expect this exit code).\nif test $? -eq 128\nthen\n    exit 1\nfi\n---8<---\n\nand `git bisect run` to find out where Git was broken.\nThat gave me:\n\n---8<---\n40bfbde9da5c6cbc85f49a755f27162dc966fd89 is the first bad commit\ncommit 40bfbde9da5c6cbc85f49a755f27162dc966fd89\nAuthor: Stefano Lattarini <stefano.lattarini@gmail.com>\nDate:   Tue Sep 11 17:45:30 2012 +0200\n\n    build: don't duplicate substitution of make variables\n    \n    Thanks to our 'GIT_CONF_SUBST' layer in configure.ac, a make variable 'VAR'\n    can be defined to a value 'VAL' at ./configure runtime in our build system\n    simply by using \"GIT_CONF_SUBST([VAR], [VAL])\" in configure.ac, rather than\n    having both to call \"AC_SUBST([VAR], [VAL])\" in configure.ac and adding the\n    'VAR = @VAR@' definition in config.mak.in.  Less duplication, less margin\n    for error, less possibility of confusion.\n    \n    While at it, fix some formatting issues in configure.ac that unnecessarily\n    obscured the code flow.\n    \n    Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>\n    Signed-off-by: Junio C Hamano <gitster@pobox.com>\n\n:100644 100644 802d34223a2859ee1341d94ee722d7939b7276aa 69d48382fe69b8699eb350949fff04975db923f8 M      config.mak.in\n:100644 100644 450bbe7f1020711b4af2ad6ea52d717651c30b0b da1f41f58871b2102a9ed5eaeff7df3c9623f4bd M      configure.ac\nbisect run success\n\n---8<---\n\nI'm not a C programmer to fix that, so I ask you to.\n\n-- \nAlexey Shumkin\n"},{"id":"225207","messageId":"7v38qcuudi.fsf@alter.siamese.dyndns.org","threadId":"34693","inReplyTo":"20130814124849.GA8234@ashu.dyn1.rarus.ru","subject":"Re: Git bug. \"make [all]\" does not use USE_LIBPCRE when \"configure --with-libpcre\" was previously run","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-14T16:09:29Z","receivedAt":"2013-08-14T16:09:29Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alexey Shumkin <alex.crezoff@gmail.com> writes:\n\n>>From time to time, I use `git grep -P` to search text in sources using PCRE.\n> Today I was suprised when that command gave me the error\n>     \"fatal: cannot use Perl-compatible regexes when not compiled with\n>     USE_LIBPCRE\"\n>\n> As far as I always use\n>     ./configure --with-libpcre \n>     make all\n> to build my Cygwin version of Git that was a VERY sudden error for me.\n> (but this is not a Cygwin-specific error, I've reproduced it on my Linux\n> box).\n>\n> I've found out that `make` \"does not know\" anymore about USE_LIBPCRE=YesPlease\n> even `./configure --with-libpcre` was run before it.\n> ...\n> and `git bisect run` to find out where Git was broken.\n> That gave me:\n>\n> ---8<---\n> 40bfbde9da5c6cbc85f49a755f27162dc966fd89 is the first bad commit\n> commit 40bfbde9da5c6cbc85f49a755f27162dc966fd89\n> Author: Stefano Lattarini <stefano.lattarini@gmail.com>\n> Date:   Tue Sep 11 17:45:30 2012 +0200\n>\n>     build: don't duplicate substitution of make variables\n>     \n>     Thanks to our 'GIT_CONF_SUBST' layer in configure.ac, a make variable 'VAR'\n>     can be defined to a value 'VAL' at ./configure runtime in our build system\n>     simply by using \"GIT_CONF_SUBST([VAR], [VAL])\" in configure.ac, rather than\n>     having both to call \"AC_SUBST([VAR], [VAL])\" in configure.ac and adding the\n>     'VAR = @VAR@' definition in config.mak.in.  Less duplication, less margin\n>     for error, less possibility of confusion.\n>     \n>     While at it, fix some formatting issues in configure.ac that unnecessarily\n>     obscured the code flow.\n>     \n>     Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>\n>     Signed-off-by: Junio C Hamano <gitster@pobox.com>\n>\n> :100644 100644 802d34223a2859ee1341d94ee722d7939b7276aa 69d48382fe69b8699eb350949fff04975db923f8 M      config.mak.in\n> :100644 100644 450bbe7f1020711b4af2ad6ea52d717651c30b0b da1f41f58871b2102a9ed5eaeff7df3c9623f4bd M      configure.ac\n> bisect run success\n>\n> ---8<---\n>\n> I'm not a C programmer to fix that, so I ask you to.\n\nYikes and thanks for reporting.\n\nThis does not have anything to do with C, but is a breakage in our\nautoconf script.  It appears that anything that is meant to be\nappended at end via $config_appended_defs mechanism is missing from\nthe end result.\n\nIn fact, symbols whose explicit substitution the above patch\nremoves, e.g. CC_LD_DYNPATH, TCLTK_PATH, NEEDS_SSL_WITH_CRYPTO,\netc. are all missing.\n"},{"id":"225210","messageId":"7vtxistefl.fsf@alter.siamese.dyndns.org","threadId":"34693","inReplyTo":"7v38qcuudi.fsf@alter.siamese.dyndns.org","subject":"Re: Git bug. \"make [all]\" does not use USE_LIBPCRE when \"configure --with-libpcre\" was previously run","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-14T16:39:10Z","receivedAt":"2013-08-14T16:39:10Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> This does not have anything to do with C, but is a breakage in our\n> autoconf script.  It appears that anything that is meant to be\n> appended at end via $config_appended_defs mechanism is missing from\n> the end result.\n>\n> In fact, symbols whose explicit substitution the above patch\n> removes, e.g. CC_LD_DYNPATH, TCLTK_PATH, NEEDS_SSL_WITH_CRYPTO,\n> etc. are all missing.\n\nWait, I spoke too soon.\n\n    $ rm -f configure config.status &&\n      make configure &&\n      ./configure --with-libpcre &&\n      grep USE_LIBPCRE config.mak.autogen\n    USE_LIBPCRE=YesPlease\n\nno longer reproduces for me (even though I _thought_ I tried and saw\nthe breakage).  Hmmmmmm.....\n"},{"id":"225249","messageId":"20130815065123.GA23414@ashu.dyn1.rarus.ru","threadId":"34693","inReplyTo":"7vtxistefl.fsf@alter.siamese.dyndns.org","subject":"Re: Git bug. \"make [all]\" does not use USE_LIBPCRE when \"configure --with-libpcre\" was previously run","fromName":"Alexey Shumkin","fromEmail":"alex.crezoff@gmail.com","sentAt":"2013-08-15T06:51:23Z","receivedAt":"2013-08-15T06:51:23Z","isPatch":false,"sender":{"key":"alex.crezoff@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1183752?v=4"},"body":"On Wed, Aug 14, 2013 at 09:39:10AM -0700, Junio C Hamano wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n> > This does not have anything to do with C, but is a breakage in our\n> > autoconf script.\nI've meant C-programmers does understand autoconf, too. But I do not :(.\n\n> > It appears that anything that is meant to be\n> > appended at end via $config_appended_defs mechanism is missing from\n> > the end result.\n> >\n> > In fact, symbols whose explicit substitution the above patch\n> > removes, e.g. CC_LD_DYNPATH, TCLTK_PATH, NEEDS_SSL_WITH_CRYPTO,\n> > etc. are all missing.\n> \n> Wait, I spoke too soon.\n> \n>     $ rm -f configure config.status &&\n>       make configure &&\n>       ./configure --with-libpcre &&\n>       grep USE_LIBPCRE config.mak.autogen\n>     USE_LIBPCRE=YesPlease\n> \n> no longer reproduces for me (even though I _thought_ I tried and saw\n> the breakage).  Hmmmmmm.....\nOh! That have worked for me, too. No more error occured.\nThank you! \n\n-- \nAlexey Shumkin\n"}]}