Skip to content

Commit

Permalink
mingw-w64-pcre2: update to 10.45
Browse files Browse the repository at this point in the history
This requires a fair share of updates to the patches (the
`fflush(stdout)` one now being obsolete), and also an update to the
valid PGP key, as v10.45 was released by a new maintainer, see
https://groups.google.com/g/pcre2-dev/c/eJgfSV-faVY/m/ev5VJEtyAAAJ for
full details.

Signed-off-by: Matthias Aßhauer <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
  • Loading branch information
rimrul authored and dscho committed Feb 20, 2025
1 parent ed549b5 commit e3d37e1
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 121 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 6f5e40032c16172e5797151e7a7e2275e5eb0738 Mon Sep 17 00:00:00 2001
From e23c1c8e29ef388312b45375944d50733aadc55c Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <[email protected]>
Date: Fri, 2 Jun 2017 17:54:57 +0200
Subject: [PATCH 1/8] RunTest: skip a couple more tests on Windows
Subject: [PATCH 1/7] RunTest: skip a couple more tests on Windows

Some of these require a larger stack (which we cannot force on Windows),
some are locale dependent (when the locale mechanism is completely
Expand All @@ -13,10 +13,10 @@ Signed-off-by: Johannes Schindelin <[email protected]>
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/RunTest b/RunTest
index ae32f5d..23985ea 100755
index dafef3e2..838b7de9 100755
--- a/RunTest
+++ b/RunTest
@@ -441,8 +441,8 @@ if [ $do0 = no -a $do1 = no -a $do2 = no -a $do3 = no -a \
@@ -437,8 +437,8 @@ if [ $do0 = no -a $do1 = no -a $do2 = no -a $do3 = no -a \
]; then
do0=yes
do1=yes
Expand All @@ -27,7 +27,7 @@ index ae32f5d..23985ea 100755
do4=yes
do5=yes
do6=yes
@@ -454,14 +454,14 @@ if [ $do0 = no -a $do1 = no -a $do2 = no -a $do3 = no -a \
@@ -450,14 +450,14 @@ if [ $do0 = no -a $do1 = no -a $do2 = no -a $do3 = no -a \
do12=yes
do13=yes
do14=yes
Expand All @@ -45,5 +45,5 @@ index ae32f5d..23985ea 100755
do24=yes
do25=yes
--
2.39.0.rc0.windows.1
2.48.1.windows.1

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From d7dbb5eba261bdcbad2f865a2c343ffa952ef5fe Mon Sep 17 00:00:00 2001
From 5498e8cdaf7cead5be748a4a41df520dbef3822f Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <[email protected]>
Date: Fri, 2 Jun 2017 17:09:43 +0200
Subject: [PATCH 2/8] RunGrepTest: compare without paying attention to line
Subject: [PATCH 2/7] RunGrepTest: compare without paying attention to line
endings

The output of pcre2grep has CR/LF line endings on Windows, but PCRE2's
Expand All @@ -13,10 +13,10 @@ Signed-off-by: Johannes Schindelin <[email protected]>
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/RunGrepTest b/RunGrepTest
index d5bd16a..106238d 100755
index 396884cc..f5641292 100755
--- a/RunGrepTest
+++ b/RunGrepTest
@@ -63,10 +63,11 @@ fi
@@ -58,10 +58,11 @@ fi
# that lacks a -u option. Try to deal with this; better do the test for the -b
# option as well.

Expand All @@ -33,5 +33,5 @@ index d5bd16a..106238d 100755
# Add a -a (always treat as text) if available. This was added in an attempt
# to get more detail from an Alpine Linux test failure on GitHub.
--
2.39.0.rc0.windows.1
2.48.1.windows.1

8 changes: 4 additions & 4 deletions mingw-w64-pcre2/0003-Fix-INTERACTIVE-fd-on-Windows.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 4887905f9b526e27ce1ebc3cf29172c27b7f67bc Mon Sep 17 00:00:00 2001
From c85f01d5c9fe1b01acf409cce09fa1c7b91689e2 Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <[email protected]>
Date: Thu, 4 Jul 2019 14:25:49 +0200
Subject: [PATCH 3/8] Fix INTERACTIVE(fd) on Windows
Subject: [PATCH 3/7] Fix INTERACTIVE(fd) on Windows

On Windows, `isatty()` also reports success on character devices such as
`NUL`, even if it is not an interactive console. That is, however, what
Expand All @@ -13,7 +13,7 @@ Signed-off-by: Johannes Schindelin <[email protected]>
1 file changed, 24 insertions(+)

diff --git a/src/pcre2test.c b/src/pcre2test.c
index 18e3f0f..3c88871 100644
index 80ab4f80..44944201 100644
--- a/src/pcre2test.c
+++ b/src/pcre2test.c
@@ -106,6 +106,30 @@ this needs to be updated or the build could break */
Expand Down Expand Up @@ -48,5 +48,5 @@ index 18e3f0f..3c88871 100644


--
2.39.0.rc0.windows.1
2.48.1.windows.1

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From d9631144a5a7815a60e84f3c99a529dba63cff5e Mon Sep 17 00:00:00 2001
From db8d11780deae530299f21acb2becd3b576707c2 Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <[email protected]>
Date: Wed, 7 Dec 2022 11:10:54 +0100
Subject: [PATCH 5/8] pcre2grep: avoid letting Windows handle command-line
Subject: [PATCH 4/7] pcre2grep: avoid letting Windows handle command-line
encoding

PCRE2 internally uses a multi-byte encoding, while Windows uses wide
Expand All @@ -17,19 +17,18 @@ This is required for the UTF-8 tests in `RunGrepTests` to pass.

Signed-off-by: Johannes Schindelin <[email protected]>
---
src/pcre2grep.c | 26 +++++++++++++++++++++++---
1 file changed, 23 insertions(+), 3 deletions(-)
src/pcre2grep.c | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/pcre2grep.c b/src/pcre2grep.c
index b6249c1..f189ee9 100644
index d56bfb41..6dacdc54 100644
--- a/src/pcre2grep.c
+++ b/src/pcre2grep.c
@@ -2468,9 +2468,29 @@ while (length > 0)
@@ -2529,8 +2529,28 @@ while (length > 0)
necessary, otherwise assume fork(). */

#ifdef WIN32
-fflush(stderr);
-fflush(stdout);
-(void)fflush(stdout);
-result = _spawnvp(_P_WAIT, argsvector[0], (const char * const *)argsvector);
+ {
+ size_t size = 0, count = 1;
Expand All @@ -49,14 +48,13 @@ index b6249c1..f189ee9 100644
+ }
+ *w0 = NULL;
+
+ fflush(stderr);
+ fflush(stdout);
+ (void)fflush(stdout);
+ result = _wspawnvp(_P_WAIT, wargv[0], (const wchar_t * const*)wargv);
+ free(wargv);
+ }

#elif defined __VMS
{
--
2.39.0.rc0.windows.1
2.48.1.windows.1

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From d98dfe0514ebf64d24246e0f8e4b49a6206d59f8 Mon Sep 17 00:00:00 2001
From 80024d5e0c5c84095554a48c2c1771e4d07f0db0 Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <[email protected]>
Date: Tue, 6 Dec 2022 23:41:42 +0100
Subject: [PATCH 6/8] RunGrepTest: work around Unix vs Windows path issues
Subject: [PATCH 5/7] RunGrepTest: work around Unix vs Windows path issues

We run the tests using the MSYS2 Bash, which will do its best to pretend
that it can handle Unix paths, but when it calls a MINGW program (such
Expand All @@ -16,10 +16,10 @@ Signed-off-by: Johannes Schindelin <[email protected]>
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/RunGrepTest b/RunGrepTest
index 106238d..9589529 100755
index f5641292..d1ddf257 100755
--- a/RunGrepTest
+++ b/RunGrepTest
@@ -595,7 +595,7 @@ echo "---------------------------- Test 109 -----------------------------" >>tes
@@ -606,7 +606,7 @@ echo "---------------------------- Test 109 -----------------------------" >>tes
echo "RC=$?" >>testtrygrep

echo "---------------------------- Test 110 -----------------------------" >>testtrygrep
Expand All @@ -28,16 +28,16 @@ index 106238d..9589529 100755
echo "RC=$?" >>testtrygrep

echo "---------------------------- Test 111 -----------------------------" >>testtrygrep
@@ -762,7 +762,7 @@ echo "---------------------------- Test 140 -----------------------------" >>tes
@@ -775,7 +775,7 @@ echo "---------------------------- Test 140 -----------------------------" >>tes
echo "RC=$?" >>testtrygrep

echo "---------------------------- Test 141 -----------------------------" >>testtrygrep
-printf "$srcdir/testdata/grepinputv\n-\n" >testtemp1grep
+printf "$(cygpath -am "$srcdir")/testdata/grepinputv\n-\n" >testtemp1grep
-printf "%s/testdata/grepinputv\n-\n" "$srcdir" >testtemp1grep
+printf "%s/testdata/grepinputv\n-\n" "$(cygpath -am "$srcdir")" >testtemp1grep
printf 'This is a line from stdin.' >testtemp2grep
$valgrind $vjs $pcre2grep --file-list testtemp1grep "line from stdin" <testtemp2grep >>testtrygrep 2>&1
echo "RC=$?" >>testtrygrep
@@ -779,7 +779,7 @@ $valgrind $vjs $pcre2grep -f - $srcdir/testdata/grepinputv <testtemp1grep >>test
@@ -792,7 +792,7 @@ $valgrind $vjs $pcre2grep -f - $srcdir/testdata/grepinputv <testtemp1grep >>test
echo "RC=$?" >>testtrygrep

echo "---------------------------- Test 144 -----------------------------" >>testtrygrep
Expand All @@ -46,7 +46,7 @@ index 106238d..9589529 100755
echo "RC=$?" >>testtrygrep

echo "---------------------------- Test 145 -----------------------------" >>testtrygrep
@@ -821,11 +821,11 @@ $valgrind $vjs $pcre2grep --buffer-size=0 >>testtrygrep 2>&1
@@ -834,11 +834,11 @@ $valgrind $vjs $pcre2grep --buffer-size=0 >>testtrygrep 2>&1
echo "RC=$?" >>testtrygrep
$valgrind $vjs $pcre2grep --exclude '(badpat' abc /dev/null >>testtrygrep 2>&1
echo "RC=$?" >>testtrygrep
Expand All @@ -62,5 +62,5 @@ index 106238d..9589529 100755

echo "---------------------------- Test 149 -----------------------------" >>testtrygrep
--
2.39.0.rc0.windows.1
2.48.1.windows.1

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From f7ab458412dea056a3336ee28560820bf4d68b67 Mon Sep 17 00:00:00 2001
From 1cc37758aa83c23c4278b033bf9cc5084b6b711c Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <[email protected]>
Date: Wed, 7 Dec 2022 01:48:56 +0100
Subject: [PATCH 7/8] RunGrepTest: Windows does not have a /bin/echo
Subject: [PATCH 6/7] RunGrepTest: Windows does not have a /bin/echo

Therefore, let's hard-code the absolute path to the MSYS2 "echo.exe" in
`$MSYSROOT/usr/bin/echo.exe`.
Expand All @@ -12,32 +12,38 @@ Signed-off-by: Johannes Schindelin <[email protected]>
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/RunGrepTest b/RunGrepTest
index 9589529..9258627 100755
index d1ddf257..20ad33a5 100755
--- a/RunGrepTest
+++ b/RunGrepTest
@@ -973,10 +973,10 @@ fi

@@ -1062,16 +1062,16 @@ fi
if $valgrind $vjs $pcre2grep --help | $valgrind $vjs $pcre2grep -q 'callout scripts in patterns are supported'; then
echo "Testing pcre2grep script callouts"
- $valgrind $vjs $pcre2grep '(T)(..(.))(?C"/bin/echo|Arg1: [$1] [$2] [$3]|Arg2: $|${1}$| ($4) ($14) ($0)")()' $srcdir/testdata/grepinputv >testtrygrep
echo "--- Test 1 ---" >testtrygrep
- $valgrind $vjs $pcre2grep '(T)(..(.))(?C"/bin/echo|Arg1: [$1] [$2] [$3]|Arg2: $|${1}$| ($4) ($14) ($0)")()' $srcdir/testdata/grepinputv >>testtrygrep
+ $valgrind $vjs $pcre2grep '(T)(..(.))(?C"echo|Arg1: [$1] [$2] [$3]|Arg2: $|${1}$| ($4) ($14) ($0)")()' $srcdir/testdata/grepinputv >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "--- Test 2 ---" >>testtrygrep
- $valgrind $vjs $pcre2grep '(T)(..(.))()()()()()()()(..)(?C"/bin/echo|Arg1: [$11] [${11}]")' $srcdir/testdata/grepinputv >>testtrygrep
+ $valgrind $vjs $pcre2grep '(T)(..(.))(?C"echo|Arg1: [$1] [$2] [$3]|Arg2: $|${1}$| ($4) ($14) ($0)")()' $srcdir/testdata/grepinputv >testtrygrep
+ $valgrind $vjs $pcre2grep '(T)(..(.))()()()()()()()(..)(?C"echo|Arg1: [$11] [${11}]")' $srcdir/testdata/grepinputv >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "--- Test 3 ---" >>testtrygrep
$valgrind $vjs $pcre2grep '(T)(?C"|$0:$1$n")' $srcdir/testdata/grepinputv >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "--- Test 4 ---" >>testtrygrep
- $valgrind $vjs $pcre2grep '(T)(?C"/bin/echo|$0:$1$n")' $srcdir/testdata/grepinputv >>testtrygrep
+ $valgrind $vjs $pcre2grep '(T)(?C"echo|$0:$1$n")' $srcdir/testdata/grepinputv >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "--- Test 5 ---" >>testtrygrep
$valgrind $vjs $pcre2grep '(T)(?C"|$1$n")(*F)' $srcdir/testdata/grepinputv >>testtrygrep
$valgrind $vjs $pcre2grep -m1 '(T)(?C"|$0:$1:$x{41}$o{101}$n")' $srcdir/testdata/grepinputv >>testtrygrep

@@ -994,7 +994,7 @@ if $valgrind $vjs $pcre2grep --help | $valgrind $vjs $pcre2grep -q 'callout scri
if [ $utf8 -ne 0 ] ; then
echo "Testing pcre2grep script callout with UTF-8 features"
$valgrind $vjs $pcre2grep -u '(T)(?C"|$0:$x{a6}$n")' $srcdir/testdata/grepinputv >testtrygrep
@@ -1097,7 +1097,7 @@ if $valgrind $vjs $pcre2grep --help | $valgrind $vjs $pcre2grep -q 'callout scri
$valgrind $vjs $pcre2grep -u '(T)(?C"|$0:$x{a6}$n")' $srcdir/testdata/grepinputv >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "--- Test 2 ---" >>testtrygrep
- $valgrind $vjs $pcre2grep -u '(T)(?C"/bin/echo|$0:$x{a6}$n")' $srcdir/testdata/grepinputv >>testtrygrep
+ $valgrind $vjs $pcre2grep -u '(T)(?C"echo|$0:$x{a6}$n")' $srcdir/testdata/grepinputv >>testtrygrep
echo "RC=$?" >>testtrygrep

if [ $nonfork = 1 ] ; then
$cf $srcdir/testdata/grepoutputCNU testtrygrep
--
2.39.0.rc0.windows.1
2.48.1.windows.1

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From c4454f8b50d8474d45a3bae5c0d59515528142f8 Mon Sep 17 00:00:00 2001
From 46e1a3caff42f1118e2dc31618366d14beb069fb Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <[email protected]>
Date: Wed, 7 Dec 2022 01:52:45 +0100
Subject: [PATCH 8/8] RunGrepTest: work around MSYS2 idiosyncrasy
Subject: [PATCH 7/7] RunGrepTest: work around MSYS2 idiosyncrasy

When calling the MSYS2 version of `echo` from a non-MSYS program, the
command-line is parsed in a non-standard manner. In particular when
Expand All @@ -17,27 +17,27 @@ Signed-off-by: Johannes Schindelin <[email protected]>
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/RunGrepTest b/RunGrepTest
index 9258627..0dbbee1 100755
index 20ad33a5..f32d72c9 100755
--- a/RunGrepTest
+++ b/RunGrepTest
@@ -976,7 +976,7 @@ if $valgrind $vjs $pcre2grep --help | $valgrind $vjs $pcre2grep -q 'callout scri
$valgrind $vjs $pcre2grep '(T)(..(.))(?C"echo|Arg1: [$1] [$2] [$3]|Arg2: $|${1}$| ($4) ($14) ($0)")()' $srcdir/testdata/grepinputv >testtrygrep
$valgrind $vjs $pcre2grep '(T)(..(.))()()()()()()()(..)(?C"echo|Arg1: [$11] [${11}]")' $srcdir/testdata/grepinputv >>testtrygrep
@@ -1071,7 +1071,7 @@ if $valgrind $vjs $pcre2grep --help | $valgrind $vjs $pcre2grep -q 'callout scri
$valgrind $vjs $pcre2grep '(T)(?C"|$0:$1$n")' $srcdir/testdata/grepinputv >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "--- Test 4 ---" >>testtrygrep
- $valgrind $vjs $pcre2grep '(T)(?C"echo|$0:$1$n")' $srcdir/testdata/grepinputv >>testtrygrep
+ $valgrind $vjs $pcre2grep '(T)(?C"echo|-e|$0:$1\n")' $srcdir/testdata/grepinputv >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "--- Test 5 ---" >>testtrygrep
$valgrind $vjs $pcre2grep '(T)(?C"|$1$n")(*F)' $srcdir/testdata/grepinputv >>testtrygrep
$valgrind $vjs $pcre2grep -m1 '(T)(?C"|$0:$1:$x{41}$o{101}$n")' $srcdir/testdata/grepinputv >>testtrygrep

@@ -994,7 +994,7 @@ if $valgrind $vjs $pcre2grep --help | $valgrind $vjs $pcre2grep -q 'callout scri
if [ $utf8 -ne 0 ] ; then
echo "Testing pcre2grep script callout with UTF-8 features"
$valgrind $vjs $pcre2grep -u '(T)(?C"|$0:$x{a6}$n")' $srcdir/testdata/grepinputv >testtrygrep
@@ -1097,7 +1097,7 @@ if $valgrind $vjs $pcre2grep --help | $valgrind $vjs $pcre2grep -q 'callout scri
$valgrind $vjs $pcre2grep -u '(T)(?C"|$0:$x{a6}$n")' $srcdir/testdata/grepinputv >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "--- Test 2 ---" >>testtrygrep
- $valgrind $vjs $pcre2grep -u '(T)(?C"echo|$0:$x{a6}$n")' $srcdir/testdata/grepinputv >>testtrygrep
+ $valgrind $vjs $pcre2grep -u '(T)(?C"echo|-e|$0:$x{a6}\n")' $srcdir/testdata/grepinputv >>testtrygrep
echo "RC=$?" >>testtrygrep

if [ $nonfork = 1 ] ; then
$cf $srcdir/testdata/grepoutputCNU testtrygrep
--
2.39.0.rc0.windows.1
2.48.1.windows.1

Loading

0 comments on commit e3d37e1

Please sign in to comment.