diff mbox series

[bug#61123] gnu: php: Update to 8.2.1.

Message ID c4d115c7cbc2267fe14dbf8e28a9ab50df46b8a7.1674916243.git.julien@lepiller.eu
State New
Headers show
Series [bug#61123] gnu: php: Update to 8.2.1. | expand

Commit Message

Julien Lepiller Jan. 28, 2023, 2:30 p.m. UTC
* gnu/packages/php.scm (php): Update to 8.2.1.
* gnu/packages/patches/php-curl-compat.patch: Remove file.
* gnu/packages/patches/php-bug-74093-test.patch: Remove file.
* gnu/local.mk (dist_patch_DATA): Remove them.
---
 gnu/local.mk                                  |  2 -
 gnu/packages/patches/php-bug-74093-test.patch | 48 -------------------
 gnu/packages/patches/php-curl-compat.patch    | 17 -------
 gnu/packages/php.scm                          | 26 ++++++----
 4 files changed, 17 insertions(+), 76 deletions(-)
 delete mode 100644 gnu/packages/patches/php-bug-74093-test.patch
 delete mode 100644 gnu/packages/patches/php-curl-compat.patch


base-commit: 37fdb382dad47149d8f5be41af108478800e9d30

Comments

Julien Lepiller Jan. 30, 2023, 8:34 p.m. UTC | #1
OK, CI is failing for x86_64 and suceeding for aarch64... I managed to
reproduce the same failure on my usual machine.

On the failing machine, I attempted to run issue0115.php. I had to
create a small php.ini to set phar to writable, otherwise it fails
earlier than in the logs:

```php.ini
phar.readonly=Off
```

Then, running `/tmp/guix-build-php-8.2.1.drv-0/php-8.2.1/sapi/cli/php
-c . issue0115.php` from the test directory gives me the same error as
the test:

```
Fatal error: Uncaught PharException: unable to copy stub of old phar to
new phar "/tmp/issue0115_1.phar.php" in /tmp/issue0115.php:7 Stack
trace: #0 /tmp/issue0115.php(7): Phar->offsetSet('index.php', '<?php\n
echo "H...') #1 {main}
  thrown in /tmp/issue0115.php on line 7
```

However, I have two partitions: one for / and one for /home on that
computer. They are both SSDs, with btrfs file-system. In any directory
under /home, I'm able to execute the test further, until it fails to
find the php server (it's not running). It at least shows that it was
able to create the phar:

```
Warning: proc_open(): Exec failed: No such file or directory in
/home/tyreunom/projects/packages/new/php_cli_server.inc on line 20
Server is not running
```

Using strace, it seems that the first difference is with this syscall:

```
copy_file_range(4, NULL, 6, NULL, 6641, 0) = 4096
copy_file_range(4, NULL, 6, NULL, 90, 0) = -1 EXDEV (Lien physique
inter-périphérique invalide)
```

Now, EXDEV is documented as "not on the same filesystem", but only for
kernels older than 5.3. Newer kernels are supposed to support that.
Note that when copy_file_range succeeds, the test fails, whereas the
phar is created when copy_file_range fails.

This test succeeds all the time on another aarch64 and an x86_64
machine, with the same php version. However, I noticed that the failing
machine had linux-6.1.5 whereas the two passing machines had
linux-5.19.17. Maybe it's related? It could also be related to
file-systems somehow, but I fail to see a difference between the setup
of my / and my /home...

Ideas? Should we disable these tests? Creating phars is not a usual
operation, as the default php.ini disables it, but it could be useful...
diff mbox series

Patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 7433654f0b..a899802348 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1668,8 +1668,6 @@  dist_patch_DATA =						\
   %D%/packages/patches/perl-www-curl-fix-struct-void.patch	\
   %D%/packages/patches/perl-www-curl-remove-symbol.patch	\
   %D%/packages/patches/phoronix-test-suite-fsdg.patch		\
-  %D%/packages/patches/php-bug-74093-test.patch			\
-  %D%/packages/patches/php-curl-compat.patch			\
   %D%/packages/patches/picprog-non-intel-support.patch		\
   %D%/packages/patches/pidgin-add-search-path.patch		\
   %D%/packages/patches/pinball-system-ltdl.patch		\
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/php.scm b/gnu/packages/php.scm
index 645a8edee1..4874e3f50b 100644
--- a/gnu/packages/php.scm
+++ b/gnu/packages/php.scm
@@ -61,17 +61,15 @@  (define-module (gnu packages php)
 (define-public php
   (package
     (name "php")
-    (version "7.4.30")
-    (home-page "https://secure.php.net/")
+    (version "8.2.1")
+    (home-page "https://www.php.net/")
     (source (origin
               (method url-fetch)
               (uri (string-append home-page "distributions/"
                                   "php-" version ".tar.xz"))
               (sha256
                (base32
-                "03d7icwys4ikl45q3rgsxv1m3i7kfxhykpx75nn7jzn6697s6wpa"))
-              (patches (search-patches "php-bug-74093-test.patch"
-                                       "php-curl-compat.patch"))
+                "1bqp5hhww7kxvqvamgjbaxlx6p54igfz3xm0yq3vzjjnl3bkn3b5"))
               (modules '((guix build utils)))
               (snippet
                '(with-directory-excursion "ext"
@@ -83,8 +81,7 @@  (define-public php
                             ;;"bcmath/libbcmath"
                             ;;"fileinfo/libmagic" ; a patched version of libmagic
                             '("gd/libgd"
-                              "pcre/pcre2lib"
-                              "xmlrpc/libxmlrpc"))))))
+                              "pcre/pcre2lib"))))))
     (build-system gnu-build-system)
     (arguments
      `(#:configure-flags
@@ -272,8 +269,6 @@  (define-public php
                          ;; Some WebP related tests fail.
                          "ext/gd/tests/webp_basic.phpt"
                          "ext/gd/tests/imagecreatefromstring_webp.phpt"
-                         ;; Expected error message, but from the wrong function
-                         "ext/gd/tests/bug77269.phpt"
                          ;; TODO: Enable these when libgd is built with xpm support.
                          "ext/gd/tests/xpm2gd.phpt"
                          "ext/gd/tests/xpm2jpg.phpt"
@@ -291,6 +286,14 @@  (define-public php
                          ;; The following test fails with "The image size
                          ;; differs: expected 114x115, got 117x117".
                          "ext/gd/tests/bug79068.phpt"
+                         ;; AVIF support disabled
+                         "ext/gd/tests/avif_decode_encode.phpt"
+                         ;; Typo in expected outputs
+                         "ext/gd/tests/bug72339.phpt"
+                         "ext/gd/tests/bug77272.phpt"
+                         "ext/gd/tests/bug66356.phpt"
+                         ;; AVIF support disabled
+                         "ext/gd/tests/imagecreatefromstring_avif.phpt"
 
                          ;; XXX: These iconv tests have the expected outcome,
                          ;; but with different error messages.
@@ -310,6 +313,11 @@  (define-public php
                          ;; XXX: These test failures appear legitimate, needs investigation.
                          ;; open_basedir() restriction failure.
                          "ext/curl/tests/bug61948-unix.phpt"
+                         ;; Same error reason but error code slightly different
+                         "ext/curl/tests/curl_setopt_ssl.phpt"
+
+                         ;; Wrong error name
+                         "ext/dba/tests/dba_gdbm_creation_matrix.phpt"
                          ;; Expects a false boolean, gets empty array from glob().
                          "ext/standard/tests/file/bug41655_1.phpt"
                          "ext/standard/tests/file/glob_variation5.phpt"