{"thread":{"id":"48023","subject":"[PATCH 0/3] Switch the default PCRE from v1 to v2 + configure fixes","startedAt":"2018-03-11T13:26:32Z","lastAt":"2018-03-14T22:42:00Z","messageCount":5,"participants":["Ævar Arnfjörð Bjarmason","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"341414","messageId":"20180311132609.32154-1-avarab@gmail.com","threadId":"48023","inReplyTo":null,"subject":"[PATCH 0/3] Switch the default PCRE from v1 to v2 + configure fixes","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-03-11T13:26:06Z","receivedAt":"2018-03-11T13:26:32Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"This small series makes USE_LIBPCRE=YesPlease mean\nUSE_LIBPCRE2=YesPlease, instead of USE_LIBPCRE1=YesPlease is it does\nnow. Along the way I fixed a couple of minor issues in the PCRE\ndetection in the autoconf script.\n\nÆvar Arnfjörð Bjarmason (3):\n  configure: fix a regression in PCRE v1 detection\n  configure: detect redundant --with-libpcre & --with-libpcre1\n  Makefile: make USE_LIBPCRE=YesPlease mean v2, not v1\n\n Makefile     | 26 +++++++++++++-------------\n configure.ac | 26 +++++++++++++++-----------\n 2 files changed, 28 insertions(+), 24 deletions(-)\n\n-- \n2.15.1.424.g9478a66081\n\n"},{"id":"341415","messageId":"20180311132609.32154-2-avarab@gmail.com","threadId":"48023","inReplyTo":"20180311132609.32154-1-avarab@gmail.com","subject":"[PATCH 1/3] configure: fix a regression in PCRE v1 detection","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-03-11T13:26:07Z","receivedAt":"2018-03-11T13:26:34Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the check for PCRE v1 to disable the --with-libpcre1 option if\nthe pcre_version() function can't be found in the pcre library. I\nunintentionally changed this in my 94da9193a6 (\"grep: add support for\nPCRE v2\", 2017-06-01) while renaming moving some variables.\n\nThe intent of this check ever since it was added in\na119f91e57 (\"configure: Check for libpcre\", 2011-05-09) is to\nsecond-guess the user and turn off an explicitly provided\n--with-libpcre if the library can't be found.\n\nI don't think that behavior makes any sense, we shouldn't be\nsecond-guessing the user with an auto-detection, but changing that\nneeds a bigger refactoring of this script, and only has marginal\nbenefits. So let's fix it to work as it was intended to work again.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n configure.ac | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/configure.ac b/configure.ac\nindex 7f8415140f..41ceb2ac81 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -549,8 +549,8 @@ if test -n \"$USE_LIBPCRE1\"; then\n GIT_STASH_FLAGS($LIBPCREDIR)\n \n AC_CHECK_LIB([pcre], [pcre_version],\n-[USE_LIBPCRE=YesPlease],\n-[USE_LIBPCRE=])\n+[USE_LIBPCRE1=YesPlease],\n+[USE_LIBPCRE1=])\n \n GIT_UNSTASH_FLAGS($LIBPCREDIR)\n \n-- \n2.15.1.424.g9478a66081\n\n"},{"id":"341416","messageId":"20180311132609.32154-3-avarab@gmail.com","threadId":"48023","inReplyTo":"20180311132609.32154-1-avarab@gmail.com","subject":"[PATCH 2/3] configure: detect redundant --with-libpcre & --with-libpcre1","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-03-11T13:26:08Z","receivedAt":"2018-03-11T13:26:35Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"The --with-libpcre option is a synonym for the --with-libpcre1 flag,\nbut the configure script allowed for redundantly specifying both.\n\nNothing broke as a result of this, but it's confusing, so let's\ndisallow it.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n configure.ac | 4 ++++\n 1 file changed, 4 insertions(+)\n\ndiff --git a/configure.ac b/configure.ac\nindex 41ceb2ac81..d1b3b143c4 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -280,6 +280,10 @@ AS_HELP_STRING([--with-libpcre],[synonym for --with-libpcre1]),\n AC_ARG_WITH(libpcre1,\n AS_HELP_STRING([--with-libpcre1],[support Perl-compatible regexes via libpcre1 (default is NO)])\n AS_HELP_STRING([],           [ARG can be also prefix for libpcre library and headers]),\n+    if test -n \"$USE_LIBPCRE1\"; then\n+        AC_MSG_ERROR([Only supply one of --with-libpcre or its synonym --with-libpcre1!])\n+    fi\n+\n     if test \"$withval\" = \"no\"; then\n \tUSE_LIBPCRE1=\n     elif test \"$withval\" = \"yes\"; then\n-- \n2.15.1.424.g9478a66081\n\n"},{"id":"341417","messageId":"20180311132609.32154-4-avarab@gmail.com","threadId":"48023","inReplyTo":"20180311132609.32154-1-avarab@gmail.com","subject":"[PATCH 3/3] Makefile: make USE_LIBPCRE=YesPlease mean v2, not v1","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-03-11T13:26:09Z","receivedAt":"2018-03-11T13:26:38Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the USE_LIBPCRE flag from being an alias for USE_LIBPCRE1 to\nbeing an alias for USE_LIBPCRE2.\n\nWhen support for v2 was added in my 94da9193a6 (\"grep: add support for\nPCRE v2\", 2017-06-01) the existing USE_LIBPCRE flag was left as\nmeaning v1, with a note that this would likely change in a future\nrelease. That optional support for v2 first made it into Git version\n2.14.0.\n\nThe PCRE v2 support has been shown to be stable, and the upstream PCRE\nproject is highly encouraging downstream users to move to v2, so it\nmakes sense to give packagers of Git who haven't heard the news about\nPCRE v2 a further nudge to move to v2.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile     | 26 +++++++++++++-------------\n configure.ac | 26 +++++++++++++-------------\n 2 files changed, 26 insertions(+), 26 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex de4b8f0c02..449ff71f45 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -29,10 +29,10 @@ all::\n # Perl-compatible regular expressions instead of standard or extended\n # POSIX regular expressions.\n #\n-# Currently USE_LIBPCRE is a synonym for USE_LIBPCRE1, define\n-# USE_LIBPCRE2 instead if you'd like to use version 2 of the PCRE\n-# library. The USE_LIBPCRE flag will likely be changed to mean v2 by\n-# default in future releases.\n+# USE_LIBPCRE is a synonym for USE_LIBPCRE2, define USE_LIBPCRE1\n+# instead if you'd like to use the legacy version 1 of the PCRE\n+# library. Support for version 1 will likely be removed in some future\n+# release of Git, as upstream has all but abandoned it.\n #\n # When using USE_LIBPCRE1, define NO_LIBPCRE1_JIT if the PCRE v1\n # library is compiled without --enable-jit. We will auto-detect\n@@ -1164,13 +1164,18 @@ ifdef NO_LIBGEN_H\n \tCOMPAT_OBJS += compat/basename.o\n endif\n \n-USE_LIBPCRE1 ?= $(USE_LIBPCRE)\n+USE_LIBPCRE2 ?= $(USE_LIBPCRE)\n \n-ifneq (,$(USE_LIBPCRE1))\n-\tifdef USE_LIBPCRE2\n-$(error Only set USE_LIBPCRE1 (or its alias USE_LIBPCRE) or USE_LIBPCRE2, not both!)\n+ifneq (,$(USE_LIBPCRE2))\n+\tifdef USE_LIBPCRE1\n+$(error Only set USE_LIBPCRE2 (or its alias USE_LIBPCRE) or USE_LIBPCRE1, not both!)\n \tendif\n \n+\tBASIC_CFLAGS += -DUSE_LIBPCRE2\n+\tEXTLIBS += -lpcre2-8\n+endif\n+\n+ifdef USE_LIBPCRE1\n \tBASIC_CFLAGS += -DUSE_LIBPCRE1\n \tEXTLIBS += -lpcre\n \n@@ -1179,11 +1184,6 @@ ifdef NO_LIBPCRE1_JIT\n endif\n endif\n \n-ifdef USE_LIBPCRE2\n-\tBASIC_CFLAGS += -DUSE_LIBPCRE2\n-\tEXTLIBS += -lpcre2-8\n-endif\n-\n ifdef LIBPCREDIR\n \tBASIC_CFLAGS += -I$(LIBPCREDIR)/include\n \tEXTLIBS += -L$(LIBPCREDIR)/$(lib) $(CC_LD_DYNPATH)$(LIBPCREDIR)/$(lib)\ndiff --git a/configure.ac b/configure.ac\nindex d1b3b143c4..6f1fd9df35 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -254,25 +254,25 @@ GIT_PARSE_WITH([openssl]))\n # Perl-compatible regular expressions instead of standard or extended\n # POSIX regular expressions.\n #\n-# Currently USE_LIBPCRE is a synonym for USE_LIBPCRE1, define\n-# USE_LIBPCRE2 instead if you'd like to use version 2 of the PCRE\n-# library. The USE_LIBPCRE flag will likely be changed to mean v2 by\n-# default in future releases.\n+# USE_LIBPCRE is a synonym for USE_LIBPCRE2, define USE_LIBPCRE1\n+# instead if you'd like to use the legacy version 1 of the PCRE\n+# library. Support for version 1 will likely be removed in some future\n+# release of Git, as upstream has all but abandoned it.\n #\n # Define LIBPCREDIR=/foo/bar if your PCRE header and library files are in\n # /foo/bar/include and /foo/bar/lib directories.\n #\n AC_ARG_WITH(libpcre,\n-AS_HELP_STRING([--with-libpcre],[synonym for --with-libpcre1]),\n+AS_HELP_STRING([--with-libpcre],[synonym for --with-libpcre2]),\n     if test \"$withval\" = \"no\"; then\n-\tUSE_LIBPCRE1=\n+\tUSE_LIBPCRE2=\n     elif test \"$withval\" = \"yes\"; then\n-\tUSE_LIBPCRE1=YesPlease\n+\tUSE_LIBPCRE2=YesPlease\n     else\n-\tUSE_LIBPCRE1=YesPlease\n+\tUSE_LIBPCRE2=YesPlease\n \tLIBPCREDIR=$withval\n \tAC_MSG_NOTICE([Setting LIBPCREDIR to $LIBPCREDIR])\n-        dnl USE_LIBPCRE1 can still be modified below, so don't substitute\n+        dnl USE_LIBPCRE2 can still be modified below, so don't substitute\n         dnl it yet.\n \tGIT_CONF_SUBST([LIBPCREDIR])\n     fi)\n@@ -280,10 +280,6 @@ AS_HELP_STRING([--with-libpcre],[synonym for --with-libpcre1]),\n AC_ARG_WITH(libpcre1,\n AS_HELP_STRING([--with-libpcre1],[support Perl-compatible regexes via libpcre1 (default is NO)])\n AS_HELP_STRING([],           [ARG can be also prefix for libpcre library and headers]),\n-    if test -n \"$USE_LIBPCRE1\"; then\n-        AC_MSG_ERROR([Only supply one of --with-libpcre or its synonym --with-libpcre1!])\n-    fi\n-\n     if test \"$withval\" = \"no\"; then\n \tUSE_LIBPCRE1=\n     elif test \"$withval\" = \"yes\"; then\n@@ -300,6 +296,10 @@ AS_HELP_STRING([],           [ARG can be also prefix for libpcre library and hea\n AC_ARG_WITH(libpcre2,\n AS_HELP_STRING([--with-libpcre2],[support Perl-compatible regexes via libpcre2 (default is NO)])\n AS_HELP_STRING([],           [ARG can be also prefix for libpcre library and headers]),\n+    if test -n \"$USE_LIBPCRE2\"; then\n+        AC_MSG_ERROR([Only supply one of --with-libpcre or its synonym --with-libpcre2!])\n+    fi\n+\n     if test -n \"$USE_LIBPCRE1\"; then\n         AC_MSG_ERROR([Only supply one of --with-libpcre1 or --with-libpcre2!])\n     fi\n-- \n2.15.1.424.g9478a66081\n\n"},{"id":"341725","messageId":"xmqqo9jqxosx.fsf@gitster-ct.c.googlers.com","threadId":"48023","inReplyTo":"20180311132609.32154-1-avarab@gmail.com","subject":"Re: [PATCH 0/3] Switch the default PCRE from v1 to v2 + configure fixes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-03-14T22:41:50Z","receivedAt":"2018-03-14T22:42:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n\n> This small series makes USE_LIBPCRE=YesPlease mean\n> USE_LIBPCRE2=YesPlease, instead of USE_LIBPCRE1=YesPlease is it does\n> now. Along the way I fixed a couple of minor issues in the PCRE\n> detection in the autoconf script.\n>\n> Ævar Arnfjörð Bjarmason (3):\n>   configure: fix a regression in PCRE v1 detection\n>   configure: detect redundant --with-libpcre & --with-libpcre1\n>   Makefile: make USE_LIBPCRE=YesPlease mean v2, not v1\n>\n>  Makefile     | 26 +++++++++++++-------------\n>  configure.ac | 26 +++++++++++++++-----------\n>  2 files changed, 28 insertions(+), 24 deletions(-)\n\nMakes sense.  Will queue.\n"}]}