summaryrefslogtreecommitdiff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorJulien Lepiller <julien@lepiller.eu>2023-01-28 14:21:12 +0100
committerJulien Lepiller <julien@lepiller.eu>2023-02-11 21:13:36 +0100
commit4d4fad681983a1a44da3a7a5c032cb26febd3ef2 (patch)
treea307885adf78b9be92b1318a9786afe39a1d153c /gnu/packages/patches
parentc8423a5457a846e42634a9a644916abfeceab5f2 (diff)
gnu: php: Update to 8.2.2.
* gnu/packages/php.scm (php): Update to 8.2.2. * gnu/packages/patches/php-curl-compat.patch: Remove file. * gnu/packages/patches/php-bug-74093-test.patch: Remove file. * gnu/packages/patches/php-fix-streams-copy-length.patch: New file. * gnu/local.mk (dist_patch_DATA): Remove them. Add it.
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/php-bug-74093-test.patch48
-rw-r--r--gnu/packages/patches/php-curl-compat.patch17
-rw-r--r--gnu/packages/patches/php-fix-streams-copy-length.patch52
3 files changed, 52 insertions, 65 deletions
diff --git a/gnu/packages/patches/php-bug-74093-test.patch b/gnu/packages/patches/php-bug-74093-test.patch
deleted file mode 100644
index 07b1949cef..0000000000
--- a/gnu/packages/patches/php-bug-74093-test.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From c641825c64e42627a2c9cac969b371ed532e0b57 Mon Sep 17 00:00:00 2001
-From: Ryan Sundberg <ryan@arctype.co>
-Date: Mon, 4 Oct 2021 20:12:25 -0700
-Subject: [PATCH] Zend/tests/bug74093.phpt: Fix failing test case
-
-This test case fails (on non-Windows hosts, where it is enabled) due
-to mismatching output in the error log language. This fixes the
-expectation, and also rewrites the test procedure in a more stable
-fashion.
-
-The objective of the test case is to run a program that exceeds
-the max_execution_time and verify that the process was aborted. The
-previous implementation tested this using a loop on array_intersect with
-large enough inputs to "probably" take enough time to trigger
-max_execution_time to abort it. With faster CPUs, over time this test
-can become flaky. Instead we simply spin a loop until enough
-wall clock time has passed to check our assertion.
----
- Zend/tests/bug74093.phpt | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
-
-diff --git a/Zend/tests/bug74093.phpt b/Zend/tests/bug74093.phpt
-index 7f20285805..32eb445ddc 100644
---- a/Zend/tests/bug74093.phpt
-+++ b/Zend/tests/bug74093.phpt
-@@ -1,5 +1,5 @@
- --TEST--
--Bug #74093 (Maximum execution time of n+2 seconds exceed not written in error_log)
-+Bug #74093 (Maximum execution time exceeded not written in error_log)
- --SKIPIF--
- <?php
- if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
-@@ -12,9 +12,9 @@ max_execution_time=1
- hard_timeout=1
- --FILE--
- <?php
--$a1 = range(1, 1000000);
--$a2 = range(100000, 1999999);
--array_intersect($a1, $a2);
-+$start = time();
-+while (time() - $start < 5);
-+die("Failed to interrupt execution");
- ?>
- --EXPECTF--
--Fatal error: Maximum execution time of 1+1 seconds exceeded %s
-+Fatal error: Maximum execution time of 1 second exceeded in %s
---
-2.31.1
diff --git a/gnu/packages/patches/php-curl-compat.patch b/gnu/packages/patches/php-curl-compat.patch
deleted file mode 100644
index 0617251194..0000000000
--- a/gnu/packages/patches/php-curl-compat.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Fix test result with cURL 7.83 and later.
-
-Taken from upstream:
-
- https://github.com/php/php-src/commit/a4179e4c92b6365d39e09cb9cd63c476848013af
-
-diff --git a/ext/curl/tests/curl_basic_007.phpt b/ext/curl/tests/curl_basic_007.phpt
-index 3b53658d6a7e..3834e4674f82 100644
---- a/ext/curl/tests/curl_basic_007.phpt
-+++ b/ext/curl/tests/curl_basic_007.phpt
-@@ -20,5 +20,5 @@ curl_close($ch);
-
- ?>
- --EXPECTF--
--string(%d) "No URL set!%w"
-+string(%d) "No URL set%A"
- int(3)
diff --git a/gnu/packages/patches/php-fix-streams-copy-length.patch b/gnu/packages/patches/php-fix-streams-copy-length.patch
new file mode 100644
index 0000000000..d68f658071
--- /dev/null
+++ b/gnu/packages/patches/php-fix-streams-copy-length.patch
@@ -0,0 +1,52 @@
+From cddcc10becb013ae498ea9c2836792f407b61678 Mon Sep 17 00:00:00 2001
+From: Julien Lepiller <julien@lepiller.eu>
+Date: Tue, 7 Feb 2023 22:55:59 +0100
+Subject: [PATCH] Fix file corruption when using copy_file_range.
+
+This patch is adapted from https://github.com/php/php-src/pull/10440.
+---
+ main/streams/streams.c | 21 +++++++++++++++++----
+ 1 file changed, 17 insertions(+), 4 deletions(-)
+
+diff --git a/main/streams/streams.c b/main/streams/streams.c
+index 20029fc7..68dc76c5 100644
+--- a/main/streams/streams.c
++++ b/main/streams/streams.c
+@@ -1634,8 +1634,21 @@ PHPAPI zend_result _php_stream_copy_to_stream_ex(php_stream *src, php_stream *de
+ char *p;
+
+ do {
+- size_t chunk_size = (maxlen == 0 || maxlen > PHP_STREAM_MMAP_MAX) ? PHP_STREAM_MMAP_MAX : maxlen;
+- size_t mapped;
++ /* We must not modify maxlen here, because otherwise the file copy fallback below can fail */
++ size_t chunk_size, must_read, mapped;
++ if (maxlen == 0) {
++ /* Unlimited read */
++ must_read = chunk_size = PHP_STREAM_MMAP_MAX;
++ } else {
++ must_read = maxlen - haveread;
++ if (must_read >= PHP_STREAM_MMAP_MAX) {
++ chunk_size = PHP_STREAM_MMAP_MAX;
++ } else {
++ /* In case the length we still have to read from the file could be smaller than the file size,
++ * chunk_size must not get bigger the size we're trying to read. */
++ chunk_size = must_read;
++ }
++ }
+
+ p = php_stream_mmap_range(src, php_stream_tell(src), chunk_size, PHP_STREAM_MAP_MODE_SHARED_READONLY, &mapped);
+
+@@ -1667,8 +1680,8 @@ PHPAPI zend_result _php_stream_copy_to_stream_ex(php_stream *src, php_stream *de
+ return SUCCESS;
+ }
+ if (maxlen != 0) {
+- maxlen -= mapped;
+- if (maxlen == 0) {
++ must_read -= mapped;
++ if (must_read == 0) {
+ return SUCCESS;
+ }
+ }
+--
+2.38.1
+