summaryrefslogtreecommitdiff
path: root/dev-lang/php
diff options
context:
space:
mode:
authorMichael Orlitzky <mjo@gentoo.org>2025-11-08 07:26:15 -0500
committerMichael Orlitzky <mjo@gentoo.org>2025-11-08 08:33:07 -0500
commit45950fa20b6a1600b7baa59b92b3790ce8282422 (patch)
tree8d9c7e51ab310c511e7dc6f9239bf65ca0f3bf18 /dev-lang/php
parent1d28988bee92ccc030213245d2212a3f14ec02be (diff)
downloadgentoo-45950fa20b6a1600b7baa59b92b3790ce8282422.tar.gz
gentoo-45950fa20b6a1600b7baa59b92b3790ce8282422.tar.bz2
gentoo-45950fa20b6a1600b7baa59b92b3790ce8282422.zip
dev-lang/php: patch tests for compatibility with new libpcre2
Temporarily disable a (fixed upstream) failing network test, too. Closes: https://bugs.gentoo.org/965018 Signed-off-by: Michael Orlitzky <mjo@gentoo.org>
Diffstat (limited to 'dev-lang/php')
-rw-r--r--dev-lang/php/files/php-8.4.14-libpcre2-testfix.patch61
-rw-r--r--dev-lang/php/php-8.3.27.ebuild8
-rw-r--r--dev-lang/php/php-8.4.14.ebuild8
3 files changed, 77 insertions, 0 deletions
diff --git a/dev-lang/php/files/php-8.4.14-libpcre2-testfix.patch b/dev-lang/php/files/php-8.4.14-libpcre2-testfix.patch
new file mode 100644
index 000000000000..c33ceef2bf70
--- /dev/null
+++ b/dev-lang/php/files/php-8.4.14-libpcre2-testfix.patch
@@ -0,0 +1,61 @@
+From 5f61eebf7a7a69e7ecfa87b5fe3ab49ccf4d3d56 Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Wed, 5 Nov 2025 09:34:14 -0500
+Subject: [PATCH] ext/pcre/tests: support libpcre2-10.47
+
+In the latest version of libpcre2, the offsets appearing in some
+"compilation failed" warnings have increased by one, as a result of
+
+ https://github.com/PCRE2Project/pcre2/pull/756
+
+This is causing spurious test failures, so in this commit we replace
+the hard-coded offsets by a regex that matches both values.
+
+Gentoo-bug: https://bugs.gentoo.org/965018
+---
+ ext/pcre/tests/grep2.phpt | 2 +-
+ ext/pcre/tests/pcre_extra.phpt | 4 ++--
+ ext/pcre/tests/split.phpt | 2 +-
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/ext/pcre/tests/grep2.phpt b/ext/pcre/tests/grep2.phpt
+index 9721dfbd9eec1..a953b13c49d54 100644
+--- a/ext/pcre/tests/grep2.phpt
++++ b/ext/pcre/tests/grep2.phpt
+@@ -21,7 +21,7 @@ var_dump(preg_last_error() == PREG_RECURSION_LIMIT_ERROR);
+
+ ?>
+ --EXPECTF--
+-Warning: preg_grep(): Compilation failed: quantifier does not follow a repeatable item at offset 0 in %sgrep2.php on line %d
++Warning: preg_grep(): Compilation failed: quantifier does not follow a repeatable item at offset %r(0|1)%r in %sgrep2.php on line %d
+ bool(false)
+ array(3) {
+ [5]=>
+diff --git a/ext/pcre/tests/pcre_extra.phpt b/ext/pcre/tests/pcre_extra.phpt
+index 730c7299390cb..660e0a1488a1d 100644
+--- a/ext/pcre/tests/pcre_extra.phpt
++++ b/ext/pcre/tests/pcre_extra.phpt
+@@ -8,8 +8,8 @@ var_dump(preg_match('/\y/X', '\y'));
+
+ ?>
+ --EXPECTF--
+-Warning: preg_match(): Compilation failed: unrecognized character follows \ at offset 1 in %spcre_extra.php on line 3
++Warning: preg_match(): Compilation failed: unrecognized character follows \ at offset %r(1|2)%r in %spcre_extra.php on line 3
+ bool(false)
+
+-Warning: preg_match(): Compilation failed: unrecognized character follows \ at offset 1 in %spcre_extra.php on line 4
++Warning: preg_match(): Compilation failed: unrecognized character follows \ at offset %r(1|2)%r in %spcre_extra.php on line 4
+ bool(false)
+diff --git a/ext/pcre/tests/split.phpt b/ext/pcre/tests/split.phpt
+index df4b9af92f2f9..27f1c85b433ea 100644
+--- a/ext/pcre/tests/split.phpt
++++ b/ext/pcre/tests/split.phpt
+@@ -16,7 +16,7 @@ var_dump(preg_split('/\d*/', 'ab2c3u', -1, PREG_SPLIT_NO_EMPTY));
+
+ ?>
+ --EXPECTF--
+-Warning: preg_split(): Compilation failed: quantifier does not follow a repeatable item at offset 0 in %ssplit.php on line %d
++Warning: preg_split(): Compilation failed: quantifier does not follow a repeatable item at offset %r(0|1)%r in %ssplit.php on line %d
+ bool(false)
+ array(3) {
+ [0]=>
diff --git a/dev-lang/php/php-8.3.27.ebuild b/dev-lang/php/php-8.3.27.ebuild
index 7805a5ab340e..14fca609ecae 100644
--- a/dev-lang/php/php-8.3.27.ebuild
+++ b/dev-lang/php/php-8.3.27.ebuild
@@ -135,6 +135,7 @@ BDEPEND="virtual/pkgconfig"
PATCHES=(
"${FILESDIR}/php-8.3.9-gd-cachevars.patch"
+ "${FILESDIR}/php-8.4.14-libpcre2-testfix.patch"
)
PHP_MV="$(ver_cut 1)"
@@ -273,6 +274,13 @@ src_prepare() {
rm ext/gd/tests/gh19955.phpt
fi
+ # Should be OK in the next version, but this test required network
+ # access when it was added:
+ #
+ # https://github.com/php/php-src/pull/19776
+ #
+ rm sapi/cli/tests/php_cli_server_ipv6_error_message.phpt || die
+
# One-off, somebody forgot to update a version constant
rm ext/reflection/tests/ReflectionZendExtension.phpt || die
diff --git a/dev-lang/php/php-8.4.14.ebuild b/dev-lang/php/php-8.4.14.ebuild
index a329ab480e12..2132cc3c040a 100644
--- a/dev-lang/php/php-8.4.14.ebuild
+++ b/dev-lang/php/php-8.4.14.ebuild
@@ -132,6 +132,7 @@ DEPEND="${COMMON_DEPEND}
BDEPEND="virtual/pkgconfig"
PATCHES=(
+ "${FILESDIR}/php-8.4.14-libpcre2-testfix.patch"
)
PHP_MV="$(ver_cut 1)"
@@ -280,6 +281,13 @@ src_prepare() {
rm ext/gd/tests/gh19955.phpt
fi
+ # Should be OK in the next version, but this test required network
+ # access when it was added:
+ #
+ # https://github.com/php/php-src/pull/19776
+ #
+ rm sapi/cli/tests/php_cli_server_ipv6_error_message.phpt || die
+
# One-off, somebody forgot to update a version constant
rm ext/reflection/tests/ReflectionZendExtension.phpt || die