unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* PHP on core-updates
@ 2017-02-26 20:46 Leo Famulari
  2017-02-27 10:24 ` julien lepiller
  0 siblings, 1 reply; 13+ messages in thread
From: Leo Famulari @ 2017-02-26 20:46 UTC (permalink / raw)
  To: guix-devel

Hi Julien,

Libgd is updated to 2.2.4 on the core-updates branch.

Can you take a look and decide what to do with gd-for-php on that
branch?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: PHP on core-updates
  2017-02-26 20:46 PHP on core-updates Leo Famulari
@ 2017-02-27 10:24 ` julien lepiller
       [not found]   ` <20170227210958.GB3643@jasmine>
  0 siblings, 1 reply; 13+ messages in thread
From: julien lepiller @ 2017-02-27 10:24 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 763 bytes --]

Le 2017-02-26 21:46, Leo Famulari a écrit :
> Hi Julien,
> 
> Libgd is updated to 2.2.4 on the core-updates branch.
> 
> Can you take a look and decide what to do with gd-for-php on that
> branch?

I think php-for-gd would break with the new version (it would fail to 
apply the patches), so I'd like to get rid of it, and use our gd package 
instead.

I found an issue with gd that was discovered by php, reported to gd and 
fixed in their repo. I've extracted a patch from the gd repo and would 
like to add it to our package. I found a way to "fix" the newly failing 
tests and reported them upstream. I've attached two patches I'd like to 
see in core-updates. I haven't tested them yet, though, but comments 
would be highly appreciated ;)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-gd-Fix-an-issue-with-XBM-decoding.patch --]
[-- Type: text/x-diff; name=0001-gnu-gd-Fix-an-issue-with-XBM-decoding.patch, Size: 5678 bytes --]

From 6ee0afac1c72c8e92dcd0384090ead62d5e0cf8a Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Mon, 27 Feb 2017 11:09:11 +0100
Subject: [PATCH 1/2] gnu: gd: Fix an issue with XBM decoding.

* gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch: New file.
* gnu/local.scm (dist_patch_DATA): Add it.
* gnu/packages/gd.scm (gd)[source]: Use it.
---
 gnu/local.mk                                       |   1 +
 gnu/packages/gd.scm                                |   3 +-
 .../patches/gd-php-73968-Fix-109-XBM-reading.patch | 114 +++++++++++++++++++++
 3 files changed, 117 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 3d9ad70..271d2c4 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -582,6 +582,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/gd-fix-tests-on-i686.patch		\
   %D%/packages/patches/gd-fix-truecolor-format-correction.patch	\
   %D%/packages/patches/gd-freetype-test-failure.patch		\
+  %D%/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch		\
   %D%/packages/patches/gegl-CVE-2012-4433.patch			\
   %D%/packages/patches/geoclue-config.patch			\
   %D%/packages/patches/ghc-dont-pass-linker-flags-via-response-files.patch	\
diff --git a/gnu/packages/gd.scm b/gnu/packages/gd.scm
index 8cac242..664e653 100644
--- a/gnu/packages/gd.scm
+++ b/gnu/packages/gd.scm
@@ -52,7 +52,8 @@
                "1rp4v7n1dq38b92kl7gkvpvqqkw7nvdfnz6d5kip5klkxfki6zqk"))
              (patches (search-patches "gd-fix-gd2-read-test.patch"
                                       "gd-fix-tests-on-i686.patch"
-                                      "gd-freetype-test-failure.patch"))))
+                                      "gd-freetype-test-failure.patch"
+                                      "gd-php-73968-Fix-109-XBM-reading.patch"))))
     (build-system gnu-build-system)
     (arguments
      `(#:phases
diff --git a/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch b/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch
new file mode 100644
index 0000000..bfaa4ff
--- /dev/null
+++ b/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch
@@ -0,0 +1,114 @@
+From 082c5444838ea0d84f9fb6441aefdb44d78d9bba Mon Sep 17 00:00:00 2001
+From: "Christoph M. Becker" <cmbecker69@gmx.de>
+Date: Fri, 20 Jan 2017 22:48:20 +0100
+Subject: [PATCH] Fix #109: XBM reading fails with printed error
+
+When calculating the number of required bytes of an XBM image, we have
+to take the line padding into account.
+
+This patch has been taken from the gd repository and binary files have been
+removed from the patch because our patch procedure doesn't support that format.
+---
+ src/gd_xbm.c                     |   2 +-
+ tests/xbm/CMakeLists.txt         |   1 +
+ tests/xbm/Makemodule.am          |   5 ++++-
+ tests/xbm/github_bug_109.c       |  35 +++++++++++++++++++++++++++++++++++
+ tests/xbm/github_bug_109.xbm     |   5 +++++
+ 5 files changed, 47 insertions(+), 2 deletions(-)
+ create mode 100644 tests/xbm/github_bug_109.c
+ create mode 100644 tests/xbm/github_bug_109.xbm
+ create mode 100644 tests/xbm/github_bug_109_exp.png
+
+diff --git a/src/gd_xbm.c b/src/gd_xbm.c
+index 5f09b56..c2ba2ad 100644
+--- a/src/gd_xbm.c
++++ b/src/gd_xbm.c
+@@ -108,7 +108,7 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFromXbm(FILE * fd)
+ 				max_bit = 32768;
+ 			}
+ 			if (max_bit) {
+-				bytes = (width * height / 8) + 1;
++                bytes = (width + 7) / 8 * height;
+ 				if (!bytes) {
+ 					return 0;
+ 				}
+diff --git a/tests/xbm/CMakeLists.txt b/tests/xbm/CMakeLists.txt
+index 183cf5e..08576e0 100644
+--- a/tests/xbm/CMakeLists.txt
++++ b/tests/xbm/CMakeLists.txt
+@@ -1,4 +1,5 @@
+ LIST(APPEND TESTS_FILES
++	github_bug_109
+ 	github_bug_170
+ )
+ 
+diff --git a/tests/xbm/Makemodule.am b/tests/xbm/Makemodule.am
+index ba1eabd..0f5beb6 100644
+--- a/tests/xbm/Makemodule.am
++++ b/tests/xbm/Makemodule.am
+@@ -1,5 +1,8 @@
+ libgd_test_programs += \
++	xbm/github_bug_109 \
+ 	xbm/github_bug_170
+ 
+ EXTRA_DIST += \
+-	xbm/CMakeLists.txt
++	xbm/CMakeLists.txt \
++	xbm/github_bug_109.xbm \
++	xbm/github_bug_109_exp.png
+diff --git a/tests/xbm/github_bug_109.c b/tests/xbm/github_bug_109.c
+new file mode 100644
+index 0000000..1a020c6
+--- /dev/null
++++ b/tests/xbm/github_bug_109.c
+@@ -0,0 +1,35 @@
++/**
++ * Test reading of XBM images with a width that is not a multiple of 8
++ *
++ * We're reading such an XBM image, and check that we got what we've expected,
++ * instead of an error message.
++ *
++ * See also <https://github.com/libgd/libgd/issues/109>.
++ */
++
++
++#include "gd.h"
++#include "gdtest.h"
++
++
++int main()
++{
++    gdImagePtr im;
++    FILE *fp;
++    char *path;
++
++    fp = gdTestFileOpen2("xbm", "github_bug_109.xbm");
++    im = gdImageCreateFromXbm(fp);
++    fclose(fp);
++    gdTestAssert(im != NULL);
++    gdTestAssert(gdImageGetTrueColorPixel(im, 0, 0) == 0);
++    gdTestAssert(gdImageGetTrueColorPixel(im, 0, 1) == 0xffffff);
++
++    path = gdTestFilePath2("xbm", "github_bug_109_exp.png");
++    gdAssertImageEqualsToFile(path, im);
++    gdFree(path);
++
++    gdImageDestroy(im);
++
++    return gdNumFailures();
++}
+diff --git a/tests/xbm/github_bug_109.xbm b/tests/xbm/github_bug_109.xbm
+new file mode 100644
+index 0000000..f427d86
+--- /dev/null
++++ b/tests/xbm/github_bug_109.xbm
+@@ -0,0 +1,5 @@
++#define test_width 10
++#define test_height 10
++static unsigned char test_bits[] = {
++  0xFF, 0x03, 0x00, 0x00, 0xFF, 0x03, 0x00, 0x00, 0xFF, 0x03, 0x00, 0x00, 
++  0xFF, 0x03, 0x00, 0x00, 0xFF, 0x03, 0x00, 0x00};
+
+-- 
+2.7.4
+
-- 
2.7.4


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-gnu-php-Update-to-7.1.2.patch --]
[-- Type: text/x-diff; name=0002-gnu-php-Update-to-7.1.2.patch, Size: 3239 bytes --]

From b9b181a0a82e7931a98db6916f34ea9223aa2034 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Mon, 27 Feb 2017 11:15:29 +0100
Subject: [PATCH 2/2] gnu: php: Update to 7.1.2.

* gnu/packages/php.scm (php): Update to 7.1.2.
---
 gnu/packages/php.scm | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/gnu/packages/php.scm b/gnu/packages/php.scm
index 16b0985..7a09b96 100644
--- a/gnu/packages/php.scm
+++ b/gnu/packages/php.scm
@@ -50,21 +50,10 @@
   #:use-module (guix build-system gnu)
   #:use-module ((guix licenses) #:prefix license:))
 
-;; This fixes PHP bugs 73155 and 73159. Remove when gd
-;; is updated to > 2.2.3.
-(define gd-for-php
-  (package (inherit gd)
-           (source
-            (origin
-              (inherit (package-source gd))
-              (patches (search-patches
-                        "gd-fix-truecolor-format-correction.patch"
-                        "gd-fix-chunk-size-on-boundaries.patch"))))))
-
 (define-public php
   (package
     (name "php")
-    (version "7.0.14")
+    (version "7.1.2")
     (home-page "https://secure.php.net/")
     (source (origin
               (method url-fetch)
@@ -72,7 +61,7 @@
                                   name "-" version ".tar.xz"))
               (sha256
                (base32
-                "12ccgbrfchgvmcfb88rcknq7xmrf19c5ysdr4v8jxk51j9izy78g"))
+                "0wg9ng230w724rpwsrhcg4pw41xm1xhz0zx76haanyymkz1s05fq"))
               (modules '((guix build utils)))
               (snippet
                '(with-directory-excursion "ext"
@@ -179,6 +168,13 @@
                             "ext/standard/tests/general_functions/bug44667.phpt"
                             "ext/standard/tests/general_functions/proc_open.phpt")
                (("/bin/cat") (which "cat")))
+
+             ;; These tests fail because they include a file whose modification
+             ;; time is 0. Touch them to make the test pass. The issue is reported
+             ;; upstream as #74137.
+             (utime "sapi/phpdbg/tests/include_once.phpt" 1 1)
+             (utime "sapi/phpdbg/tests/phpdbg_get_executable_stream_wrapper.phpt" 1 1)
+
              ;; The encoding of this file is not recognized, so we simply drop it.
              (delete-file "ext/mbstring/tests/mb_send_mail07.phpt")
 
@@ -257,8 +253,10 @@
                          ;; The test expects an Array, but instead get the contents(?).
                          "ext/gd/tests/bug43073.phpt"
                          ;; imagettftext() returns wrong coordinates.
+                         "ext/gd/tests/bug48732-mb.phpt"
                          "ext/gd/tests/bug48732.phpt"
                          ;; Similarly for imageftbbox().
+                         "ext/gd/tests/bug48801-mb.phpt"
                          "ext/gd/tests/bug48801.phpt"
                          ;; Different expected output from imagecolorallocate().
                          "ext/gd/tests/bug53504.phpt"
@@ -291,7 +289,7 @@
        ("curl" ,curl)
        ("cyrus-sasl" ,cyrus-sasl)
        ("freetype" ,freetype)
-       ("gd" ,gd-for-php)
+       ("gd" ,gd)
        ("gdbm" ,gdbm)
        ("glibc" ,glibc)
        ("gmp" ,gmp)
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: PHP on core-updates
       [not found]   ` <20170227210958.GB3643@jasmine>
@ 2017-02-28  8:03     ` Julien Lepiller
  0 siblings, 0 replies; 13+ messages in thread
From: Julien Lepiller @ 2017-02-28  8:03 UTC (permalink / raw)
  To: guix-devel

On Mon, 27 Feb 2017 16:09:58 -0500
Leo Famulari <leo@famulari.name> wrote:

> On Mon, Feb 27, 2017 at 11:24:42AM +0100, julien lepiller wrote:
> > I think php-for-gd would break with the new version (it would fail
> > to apply the patches), so I'd like to get rid of it, and use our gd
> > package instead.  
> 
> Okay, sounds good!
> 
> > I found an issue with gd that was discovered by php, reported to gd
> > and fixed in their repo. I've extracted a patch from the gd repo
> > and would like to add it to our package. I found a way to "fix" the
> > newly failing tests and reported them upstream. I've attached two
> > patches I'd like to see in core-updates. I haven't tested them yet,
> > though, but comments would be highly appreciated ;)  
> 
> It's expected that contributors test their submissions before sending
> them, or put a note in the message subject like "WIP". Please let us
> know the result of your test :)

It was going to take some time to build all dependencies, but I
wanted feedback quickly. Ok for the "WIP" thing, I'll think about that
next time. I've tried to build php and failed because it depends on glib
that fails to build on core-updates because one test hangs.

> 
> > From 6ee0afac1c72c8e92dcd0384090ead62d5e0cf8a Mon Sep 17 00:00:00
> > 2001 From: Julien Lepiller <julien@lepiller.eu>
> > Date: Mon, 27 Feb 2017 11:09:11 +0100
> > Subject: [PATCH 1/2] gnu: gd: Fix an issue with XBM decoding.
> > 
> > * gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch: New
> > file.
> > * gnu/local.scm (dist_patch_DATA): Add it.
> > * gnu/packages/gd.scm (gd)[source]: Use it.  
> 
> [...]
> 
> > diff --git
> > a/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch
> > b/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch new
> > file mode 100644 index 0000000..bfaa4ff --- /dev/null
> > +++ b/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch
> > @@ -0,0 +1,114 @@
> > +From 082c5444838ea0d84f9fb6441aefdb44d78d9bba Mon Sep 17 00:00:00
> > 2001 +From: "Christoph M. Becker" <cmbecker69@gmx.de>
> > +Date: Fri, 20 Jan 2017 22:48:20 +0100
> > +Subject: [PATCH] Fix #109: XBM reading fails with printed error
> > +
> > +When calculating the number of required bytes of an XBM image, we
> > have +to take the line padding into account.
> > +
> > +This patch has been taken from the gd repository and binary files
> > have been +removed from the patch because our patch procedure
> > doesn't support that format. +---
> > + src/gd_xbm.c                     |   2 +-
> > + tests/xbm/CMakeLists.txt         |   1 +
> > + tests/xbm/Makemodule.am          |   5 ++++-
> > + tests/xbm/github_bug_109.c       |  35
> > +++++++++++++++++++++++++++++++++++
> > + tests/xbm/github_bug_109.xbm     |   5 +++++
> > + 5 files changed, 47 insertions(+), 2 deletions(-)
> > + create mode 100644 tests/xbm/github_bug_109.c
> > + create mode 100644 tests/xbm/github_bug_109.xbm
> > + create mode 100644 tests/xbm/github_bug_109_exp.png  
> 
> We should always include links to the upstream bug report (if one
> exists) and source of the 3rd-party patch in the patch file that is
> being added (in this case, in
> 'gd-php-73968-Fix-109-XBM-reading.patch'). This makes it more likely
> that people will review it. I'm sure you can imagine that it's
> exhausting to hunt down the origin and reasoning behind every
> 3rd-party patch.

The php bug report is this one: https://bugs.php.net/bug.php?id=73968.

> 
> I guess these are some relevant bug reports (I did not find the PHP
> report): https://bitbucket.org/libgd/gd-libgd/issues/109
> https://github.com/libgd/libgd/issues/109
> 
> And the source of the patch is this:
> https://github.com/libgd/libgd/commit/082c5444838ea0d84f9fb6441aefdb44d78d9bba
> 
> Do you know if this change have a security impact? Is XBM still used
> widely?

It was not marked as a security bug in php or gd, so I don't think so.
That patch is required for a test not to fail in php though. If you
don't like having patches around, I could also disable the test in php.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: PHP on core-updates
@ 2017-03-01 15:34 julien lepiller
  2017-03-01 16:25 ` Marius Bakke
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: julien lepiller @ 2017-03-01 15:34 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 234 bytes --]

I've "fixed" the glib failure by disabling a test. Attached are patches 
I would like to see in core-updates. If it's too late to add the patch 
for gd, then I would like to keep gd-for-php. This time I've tested them 
and php works.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-glib-Fix-test-hang.patch --]
[-- Type: text/x-diff; name=0001-gnu-glib-Fix-test-hang.patch, Size: 878 bytes --]

From 300af3fb262a31958f26aeac5eef33e376eda604 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Wed, 1 Mar 2017 10:24:32 +0100
Subject: [PATCH 1/3] gnu: glib: Fix test hang.

* gnu/packages/glib.scm (glib)[arguments]: Fix test hang.
---
 gnu/packages/glib.scm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index 1a794db..dab0524 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -204,6 +204,9 @@ shared NFS home directories.")
                        ;; recognize it.
                        "/thread/thread4"))
 
+                     ("glib/tests/642026.c"
+                      ("/glib/642026"))
+
                      ("glib/tests/timer.c"
                       (;; fails if compiler optimizations are enabled, which they
                        ;; are by default.
-- 
2.7.4


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-gnu-gd-Fix-an-issue-with-XBM-decoding.patch --]
[-- Type: text/x-diff; name=0002-gnu-gd-Fix-an-issue-with-XBM-decoding.patch, Size: 5673 bytes --]

From 0aa21c67381203d7dfec325fdc85303f5d3db76e Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Mon, 27 Feb 2017 11:09:11 +0100
Subject: [PATCH 2/3] gnu: gd: Fix an issue with XBM decoding.

* gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch: New file.
* gnu/local.scm (dist_patch_DATA): Add it.
* gnu/packages/gd.scm (gd)[source]: Use it.
---
 gnu/local.mk                                       |   1 +
 gnu/packages/gd.scm                                |   3 +-
 .../patches/gd-php-73968-Fix-109-XBM-reading.patch | 114 +++++++++++++++++++++
 3 files changed, 117 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 3d9ad70..271d2c4 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -582,6 +582,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/gd-fix-tests-on-i686.patch		\
   %D%/packages/patches/gd-fix-truecolor-format-correction.patch	\
   %D%/packages/patches/gd-freetype-test-failure.patch		\
+  %D%/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch		\
   %D%/packages/patches/gegl-CVE-2012-4433.patch			\
   %D%/packages/patches/geoclue-config.patch			\
   %D%/packages/patches/ghc-dont-pass-linker-flags-via-response-files.patch	\
diff --git a/gnu/packages/gd.scm b/gnu/packages/gd.scm
index 8cac242..664e653 100644
--- a/gnu/packages/gd.scm
+++ b/gnu/packages/gd.scm
@@ -52,7 +52,8 @@
                "1rp4v7n1dq38b92kl7gkvpvqqkw7nvdfnz6d5kip5klkxfki6zqk"))
              (patches (search-patches "gd-fix-gd2-read-test.patch"
                                       "gd-fix-tests-on-i686.patch"
-                                      "gd-freetype-test-failure.patch"))))
+                                      "gd-freetype-test-failure.patch"
+                                      "gd-php-73968-Fix-109-XBM-reading.patch"))))
     (build-system gnu-build-system)
     (arguments
      `(#:phases
diff --git a/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch b/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch
new file mode 100644
index 0000000..bfaa4ff
--- /dev/null
+++ b/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch
@@ -0,0 +1,114 @@
+From 082c5444838ea0d84f9fb6441aefdb44d78d9bba Mon Sep 17 00:00:00 2001
+From: "Christoph M. Becker" <cmbecker69@gmx.de>
+Date: Fri, 20 Jan 2017 22:48:20 +0100
+Subject: [PATCH] Fix #109: XBM reading fails with printed error
+
+When calculating the number of required bytes of an XBM image, we have
+to take the line padding into account.
+
+This patch has been taken from the gd repository and binary files have been
+removed from the patch because our patch procedure doesn't support that format.
+---
+ src/gd_xbm.c                     |   2 +-
+ tests/xbm/CMakeLists.txt         |   1 +
+ tests/xbm/Makemodule.am          |   5 ++++-
+ tests/xbm/github_bug_109.c       |  35 +++++++++++++++++++++++++++++++++++
+ tests/xbm/github_bug_109.xbm     |   5 +++++
+ 5 files changed, 47 insertions(+), 2 deletions(-)
+ create mode 100644 tests/xbm/github_bug_109.c
+ create mode 100644 tests/xbm/github_bug_109.xbm
+ create mode 100644 tests/xbm/github_bug_109_exp.png
+
+diff --git a/src/gd_xbm.c b/src/gd_xbm.c
+index 5f09b56..c2ba2ad 100644
+--- a/src/gd_xbm.c
++++ b/src/gd_xbm.c
+@@ -108,7 +108,7 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFromXbm(FILE * fd)
+ 				max_bit = 32768;
+ 			}
+ 			if (max_bit) {
+-				bytes = (width * height / 8) + 1;
++                bytes = (width + 7) / 8 * height;
+ 				if (!bytes) {
+ 					return 0;
+ 				}
+diff --git a/tests/xbm/CMakeLists.txt b/tests/xbm/CMakeLists.txt
+index 183cf5e..08576e0 100644
+--- a/tests/xbm/CMakeLists.txt
++++ b/tests/xbm/CMakeLists.txt
+@@ -1,4 +1,5 @@
+ LIST(APPEND TESTS_FILES
++	github_bug_109
+ 	github_bug_170
+ )
+
+diff --git a/tests/xbm/Makemodule.am b/tests/xbm/Makemodule.am
+index ba1eabd..0f5beb6 100644
+--- a/tests/xbm/Makemodule.am
++++ b/tests/xbm/Makemodule.am
+@@ -1,5 +1,8 @@
+ libgd_test_programs += \
++	xbm/github_bug_109 \
+ 	xbm/github_bug_170
+
+ EXTRA_DIST += \
+-	xbm/CMakeLists.txt
++	xbm/CMakeLists.txt \
++	xbm/github_bug_109.xbm \
++	xbm/github_bug_109_exp.png
+diff --git a/tests/xbm/github_bug_109.c b/tests/xbm/github_bug_109.c
+new file mode 100644
+index 0000000..1a020c6
+--- /dev/null
++++ b/tests/xbm/github_bug_109.c
+@@ -0,0 +1,35 @@
++/**
++ * Test reading of XBM images with a width that is not a multiple of 8
++ *
++ * We're reading such an XBM image, and check that we got what we've expected,
++ * instead of an error message.
++ *
++ * See also <https://github.com/libgd/libgd/issues/109>.
++ */
++
++
++#include "gd.h"
++#include "gdtest.h"
++
++
++int main()
++{
++    gdImagePtr im;
++    FILE *fp;
++    char *path;
++
++    fp = gdTestFileOpen2("xbm", "github_bug_109.xbm");
++    im = gdImageCreateFromXbm(fp);
++    fclose(fp);
++    gdTestAssert(im != NULL);
++    gdTestAssert(gdImageGetTrueColorPixel(im, 0, 0) == 0);
++    gdTestAssert(gdImageGetTrueColorPixel(im, 0, 1) == 0xffffff);
++
++    path = gdTestFilePath2("xbm", "github_bug_109_exp.png");
++    gdAssertImageEqualsToFile(path, im);
++    gdFree(path);
++
++    gdImageDestroy(im);
++
++    return gdNumFailures();
++}
+diff --git a/tests/xbm/github_bug_109.xbm b/tests/xbm/github_bug_109.xbm
+new file mode 100644
+index 0000000..f427d86
+--- /dev/null
++++ b/tests/xbm/github_bug_109.xbm
+@@ -0,0 +1,5 @@
++#define test_width 10
++#define test_height 10
++static unsigned char test_bits[] = {
++  0xFF, 0x03, 0x00, 0x00, 0xFF, 0x03, 0x00, 0x00, 0xFF, 0x03, 0x00, 0x00,
++  0xFF, 0x03, 0x00, 0x00, 0xFF, 0x03, 0x00, 0x00};
+
+--
+2.7.4
+
--
2.7.4


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0003-gnu-php-Update-to-7.1.2.patch --]
[-- Type: text/x-diff; name=0003-gnu-php-Update-to-7.1.2.patch, Size: 4520 bytes --]

From 128fb06c4477792b4a4f58f21c66a50e5ab4fd0e Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Mon, 27 Feb 2017 11:15:29 +0100
Subject: [PATCH 3/3] gnu: php: Update to 7.1.2.

* gnu/packages/php.scm (php): Update to 7.1.2.
---
 .../patches/gd-php-73968-Fix-109-XBM-reading.patch |  7 ++++--
 gnu/packages/php.scm                               | 27 +++++++++++-----------
 2 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch b/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch
index bfaa4ff..3fedba3 100644
--- a/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch
+++ b/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch
@@ -6,8 +6,11 @@ Subject: [PATCH] Fix #109: XBM reading fails with printed error
 When calculating the number of required bytes of an XBM image, we have
 to take the line padding into account.
 
-This patch has been taken from the gd repository and binary files have been
-removed from the patch because our patch procedure doesn't support that format.
+This bug was first reported to php on https://bugs.php.net/bug.php?id=73968.
+php then reported it to gd in https://github.com/libgd/libgd/issues/109. This
+patch is taken from commit 082c5444838ea0d84f9fb6441aefdb44d78d9bba of gd.
+Binary files have been removed from the patch because our patch procedure
+doesn't support that format.
 ---
  src/gd_xbm.c                     |   2 +-
  tests/xbm/CMakeLists.txt         |   1 +
diff --git a/gnu/packages/php.scm b/gnu/packages/php.scm
index 16b0985..0dfee36 100644
--- a/gnu/packages/php.scm
+++ b/gnu/packages/php.scm
@@ -50,21 +50,10 @@
   #:use-module (guix build-system gnu)
   #:use-module ((guix licenses) #:prefix license:))
 
-;; This fixes PHP bugs 73155 and 73159. Remove when gd
-;; is updated to > 2.2.3.
-(define gd-for-php
-  (package (inherit gd)
-           (source
-            (origin
-              (inherit (package-source gd))
-              (patches (search-patches
-                        "gd-fix-truecolor-format-correction.patch"
-                        "gd-fix-chunk-size-on-boundaries.patch"))))))
-
 (define-public php
   (package
     (name "php")
-    (version "7.0.14")
+    (version "7.1.2")
     (home-page "https://secure.php.net/")
     (source (origin
               (method url-fetch)
@@ -72,7 +61,7 @@
                                   name "-" version ".tar.xz"))
               (sha256
                (base32
-                "12ccgbrfchgvmcfb88rcknq7xmrf19c5ysdr4v8jxk51j9izy78g"))
+                "0wg9ng230w724rpwsrhcg4pw41xm1xhz0zx76haanyymkz1s05fq"))
               (modules '((guix build utils)))
               (snippet
                '(with-directory-excursion "ext"
@@ -179,6 +168,13 @@
                             "ext/standard/tests/general_functions/bug44667.phpt"
                             "ext/standard/tests/general_functions/proc_open.phpt")
                (("/bin/cat") (which "cat")))
+
+             ;; These tests fail because they include a file whose modification
+             ;; time is 0. Touch them to make the test pass. The issue is reported
+             ;; upstream as #74137.
+             (utime "sapi/phpdbg/tests/include.inc" 1 1)
+             (utime "sapi/phpdbg/tests/phpdbg_get_executable_stream_wrapper.inc" 1 1)
+
              ;; The encoding of this file is not recognized, so we simply drop it.
              (delete-file "ext/mbstring/tests/mb_send_mail07.phpt")
 
@@ -257,8 +253,10 @@
                          ;; The test expects an Array, but instead get the contents(?).
                          "ext/gd/tests/bug43073.phpt"
                          ;; imagettftext() returns wrong coordinates.
+                         "ext/gd/tests/bug48732-mb.phpt"
                          "ext/gd/tests/bug48732.phpt"
                          ;; Similarly for imageftbbox().
+                         "ext/gd/tests/bug48801-mb.phpt"
                          "ext/gd/tests/bug48801.phpt"
                          ;; Different expected output from imagecolorallocate().
                          "ext/gd/tests/bug53504.phpt"
@@ -291,10 +289,11 @@
        ("curl" ,curl)
        ("cyrus-sasl" ,cyrus-sasl)
        ("freetype" ,freetype)
-       ("gd" ,gd-for-php)
+       ("gd" ,gd)
        ("gdbm" ,gdbm)
        ("glibc" ,glibc)
        ("gmp" ,gmp)
+       ("gnutls" ,gnutls)
        ("libgcrypt" ,libgcrypt)
        ("libjpeg" ,libjpeg)
        ("libpng" ,libpng)
--
2.7.4


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: PHP on core-updates
  2017-03-01 15:34 julien lepiller
@ 2017-03-01 16:25 ` Marius Bakke
  2017-03-01 17:09   ` Leo Famulari
  2017-03-01 17:22 ` Leo Famulari
  2017-03-02 16:37 ` julien lepiller
  2 siblings, 1 reply; 13+ messages in thread
From: Marius Bakke @ 2017-03-01 16:25 UTC (permalink / raw)
  To: julien lepiller, guix-devel

[-- Attachment #1: Type: text/plain, Size: 13564 bytes --]

julien lepiller <julien@lepiller.eu> writes:

> I've "fixed" the glib failure by disabling a test. Attached are patches 
> I would like to see in core-updates. If it's too late to add the patch 
> for gd, then I would like to keep gd-for-php. This time I've tested them 
> and php works.

I did not get a substitute for gd on core-updates, so I don't think it
(or dependent packages) have been built yet. If so, patching it should
be okay.

[...]

> From 300af3fb262a31958f26aeac5eef33e376eda604 Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien@lepiller.eu>
> Date: Wed, 1 Mar 2017 10:24:32 +0100
> Subject: [PATCH 1/3] gnu: glib: Fix test hang.
>
> * gnu/packages/glib.scm (glib)[arguments]: Fix test hang.
> ---
>  gnu/packages/glib.scm | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
> index 1a794db..dab0524 100644
> --- a/gnu/packages/glib.scm
> +++ b/gnu/packages/glib.scm
> @@ -204,6 +204,9 @@ shared NFS home directories.")
>                         ;; recognize it.
>                         "/thread/thread4"))
>  
> +                     ("glib/tests/642026.c"
> +                      ("/glib/642026"))

This needs an explaining comment. Under which circumstances does this
test hang? I cannot reproduce it on 'core-updates'. 

> +
>                       ("glib/tests/timer.c"
>                        (;; fails if compiler optimizations are enabled, which they
>                         ;; are by default.
> -- 
> 2.7.4
>
> From 0aa21c67381203d7dfec325fdc85303f5d3db76e Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien@lepiller.eu>
> Date: Mon, 27 Feb 2017 11:09:11 +0100
> Subject: [PATCH 2/3] gnu: gd: Fix an issue with XBM decoding.
>
> * gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch: New file.
> * gnu/local.scm (dist_patch_DATA): Add it.
> * gnu/packages/gd.scm (gd)[source]: Use it.
> ---
>  gnu/local.mk                                       |   1 +
>  gnu/packages/gd.scm                                |   3 +-
>  .../patches/gd-php-73968-Fix-109-XBM-reading.patch | 114 +++++++++++++++++++++
>  3 files changed, 117 insertions(+), 1 deletion(-)
>  create mode 100644 gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch
>
> diff --git a/gnu/local.mk b/gnu/local.mk
> index 3d9ad70..271d2c4 100644
> --- a/gnu/local.mk
> +++ b/gnu/local.mk
> @@ -582,6 +582,7 @@ dist_patch_DATA =						\
>    %D%/packages/patches/gd-fix-tests-on-i686.patch		\
>    %D%/packages/patches/gd-fix-truecolor-format-correction.patch	\
>    %D%/packages/patches/gd-freetype-test-failure.patch		\
> +  %D%/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch		\
>    %D%/packages/patches/gegl-CVE-2012-4433.patch			\
>    %D%/packages/patches/geoclue-config.patch			\
>    %D%/packages/patches/ghc-dont-pass-linker-flags-via-response-files.patch	\
> diff --git a/gnu/packages/gd.scm b/gnu/packages/gd.scm
> index 8cac242..664e653 100644
> --- a/gnu/packages/gd.scm
> +++ b/gnu/packages/gd.scm
> @@ -52,7 +52,8 @@
>                 "1rp4v7n1dq38b92kl7gkvpvqqkw7nvdfnz6d5kip5klkxfki6zqk"))
>               (patches (search-patches "gd-fix-gd2-read-test.patch"
>                                        "gd-fix-tests-on-i686.patch"
> -                                      "gd-freetype-test-failure.patch"))))
> +                                      "gd-freetype-test-failure.patch"
> +                                      "gd-php-73968-Fix-109-XBM-reading.patch"))))
>      (build-system gnu-build-system)
>      (arguments
>       `(#:phases
> diff --git a/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch b/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch
> new file mode 100644
> index 0000000..bfaa4ff
> --- /dev/null
> +++ b/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch
> @@ -0,0 +1,114 @@
> +From 082c5444838ea0d84f9fb6441aefdb44d78d9bba Mon Sep 17 00:00:00 2001
> +From: "Christoph M. Becker" <cmbecker69@gmx.de>
> +Date: Fri, 20 Jan 2017 22:48:20 +0100
> +Subject: [PATCH] Fix #109: XBM reading fails with printed error

Please add a few words at the top of this file (before patch headers)
describing what it does, why it's needed, and where to find the
original. Look into other patches for examples.

> +
> +When calculating the number of required bytes of an XBM image, we have
> +to take the line padding into account.
> +
> +This patch has been taken from the gd repository and binary files have been
> +removed from the patch because our patch procedure doesn't support that format.

Is this not the original commit message? The next patch leads me to
think so. I would prefer not messing with commit messages of git-format
patches; either remove them or keep it intact.

> +---
> + src/gd_xbm.c                     |   2 +-
> + tests/xbm/CMakeLists.txt         |   1 +
> + tests/xbm/Makemodule.am          |   5 ++++-
> + tests/xbm/github_bug_109.c       |  35 +++++++++++++++++++++++++++++++++++
> + tests/xbm/github_bug_109.xbm     |   5 +++++
> + 5 files changed, 47 insertions(+), 2 deletions(-)
> + create mode 100644 tests/xbm/github_bug_109.c
> + create mode 100644 tests/xbm/github_bug_109.xbm
> + create mode 100644 tests/xbm/github_bug_109_exp.png
> +
> +diff --git a/src/gd_xbm.c b/src/gd_xbm.c
> +index 5f09b56..c2ba2ad 100644
> +--- a/src/gd_xbm.c
> ++++ b/src/gd_xbm.c
> +@@ -108,7 +108,7 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFromXbm(FILE * fd)
> + 				max_bit = 32768;
> + 			}
> + 			if (max_bit) {
> +-				bytes = (width * height / 8) + 1;
> ++                bytes = (width + 7) / 8 * height;

This looks funky, but matches what's in the current HEAD of libgd:

https://github.com/libgd/libgd/blob/master/src/gd_xbm.c#L114

> + 				if (!bytes) {
> + 					return 0;
> + 				}
> +diff --git a/tests/xbm/CMakeLists.txt b/tests/xbm/CMakeLists.txt
> +index 183cf5e..08576e0 100644
> +--- a/tests/xbm/CMakeLists.txt
> ++++ b/tests/xbm/CMakeLists.txt
> +@@ -1,4 +1,5 @@
> + LIST(APPEND TESTS_FILES
> ++	github_bug_109
> + 	github_bug_170
> + )
> +
> +diff --git a/tests/xbm/Makemodule.am b/tests/xbm/Makemodule.am
> +index ba1eabd..0f5beb6 100644
> +--- a/tests/xbm/Makemodule.am
> ++++ b/tests/xbm/Makemodule.am
> +@@ -1,5 +1,8 @@
> + libgd_test_programs += \
> ++	xbm/github_bug_109 \
> + 	xbm/github_bug_170
> +
> + EXTRA_DIST += \
> +-	xbm/CMakeLists.txt
> ++	xbm/CMakeLists.txt \
> ++	xbm/github_bug_109.xbm \
> ++	xbm/github_bug_109_exp.png
> +diff --git a/tests/xbm/github_bug_109.c b/tests/xbm/github_bug_109.c
> +new file mode 100644
> +index 0000000..1a020c6
> +--- /dev/null
> ++++ b/tests/xbm/github_bug_109.c
> +@@ -0,0 +1,35 @@
> ++/**
> ++ * Test reading of XBM images with a width that is not a multiple of 8
> ++ *
> ++ * We're reading such an XBM image, and check that we got what we've expected,
> ++ * instead of an error message.
> ++ *
> ++ * See also <https://github.com/libgd/libgd/issues/109>.
> ++ */
> ++
> ++
> ++#include "gd.h"
> ++#include "gdtest.h"
> ++
> ++
> ++int main()
> ++{
> ++    gdImagePtr im;
> ++    FILE *fp;
> ++    char *path;
> ++
> ++    fp = gdTestFileOpen2("xbm", "github_bug_109.xbm");
> ++    im = gdImageCreateFromXbm(fp);
> ++    fclose(fp);
> ++    gdTestAssert(im != NULL);
> ++    gdTestAssert(gdImageGetTrueColorPixel(im, 0, 0) == 0);
> ++    gdTestAssert(gdImageGetTrueColorPixel(im, 0, 1) == 0xffffff);
> ++
> ++    path = gdTestFilePath2("xbm", "github_bug_109_exp.png");
> ++    gdAssertImageEqualsToFile(path, im);
> ++    gdFree(path);
> ++
> ++    gdImageDestroy(im);
> ++
> ++    return gdNumFailures();
> ++}
> +diff --git a/tests/xbm/github_bug_109.xbm b/tests/xbm/github_bug_109.xbm
> +new file mode 100644
> +index 0000000..f427d86
> +--- /dev/null
> ++++ b/tests/xbm/github_bug_109.xbm
> +@@ -0,0 +1,5 @@
> ++#define test_width 10
> ++#define test_height 10
> ++static unsigned char test_bits[] = {
> ++  0xFF, 0x03, 0x00, 0x00, 0xFF, 0x03, 0x00, 0x00, 0xFF, 0x03, 0x00, 0x00,
> ++  0xFF, 0x03, 0x00, 0x00, 0xFF, 0x03, 0x00, 0x00};
> +
> +--
> +2.7.4
> +
> --
> 2.7.4
>
> From 128fb06c4477792b4a4f58f21c66a50e5ab4fd0e Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien@lepiller.eu>
> Date: Mon, 27 Feb 2017 11:15:29 +0100
> Subject: [PATCH 3/3] gnu: php: Update to 7.1.2.
>
> * gnu/packages/php.scm (php): Update to 7.1.2.
> ---
>  .../patches/gd-php-73968-Fix-109-XBM-reading.patch |  7 ++++--
>  gnu/packages/php.scm                               | 27 +++++++++++-----------
>  2 files changed, 18 insertions(+), 16 deletions(-)
>
> diff --git a/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch b/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch
> index bfaa4ff..3fedba3 100644
> --- a/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch
> +++ b/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch
> @@ -6,8 +6,11 @@ Subject: [PATCH] Fix #109: XBM reading fails with printed error
>  When calculating the number of required bytes of an XBM image, we have
>  to take the line padding into account.
>  
> -This patch has been taken from the gd repository and binary files have been
> -removed from the patch because our patch procedure doesn't support that format.
> +This bug was first reported to php on https://bugs.php.net/bug.php?id=73968.
> +php then reported it to gd in https://github.com/libgd/libgd/issues/109. This
> +patch is taken from commit 082c5444838ea0d84f9fb6441aefdb44d78d9bba of gd.
> +Binary files have been removed from the patch because our patch procedure
> +doesn't support that format.

Please add this information to the previous patch. Messing with
unrelated files in commits makes review, revert, bisecting etc
difficult. Reverting this commit as-is would cause a rebuild of
everything using gd.

>  ---
>   src/gd_xbm.c                     |   2 +-
>   tests/xbm/CMakeLists.txt         |   1 +
> diff --git a/gnu/packages/php.scm b/gnu/packages/php.scm
> index 16b0985..0dfee36 100644
> --- a/gnu/packages/php.scm
> +++ b/gnu/packages/php.scm
> @@ -50,21 +50,10 @@
>    #:use-module (guix build-system gnu)
>    #:use-module ((guix licenses) #:prefix license:))
>  
> -;; This fixes PHP bugs 73155 and 73159. Remove when gd
> -;; is updated to > 2.2.3.
> -(define gd-for-php
> -  (package (inherit gd)
> -           (source
> -            (origin
> -              (inherit (package-source gd))
> -              (patches (search-patches
> -                        "gd-fix-truecolor-format-correction.patch"
> -                        "gd-fix-chunk-size-on-boundaries.patch"))))))

Please also delete these two patches with this commit, and remove them
from local.mk.

> -
>  (define-public php
>    (package
>      (name "php")
> -    (version "7.0.14")
> +    (version "7.1.2")
>      (home-page "https://secure.php.net/")
>      (source (origin
>                (method url-fetch)
> @@ -72,7 +61,7 @@
>                                    name "-" version ".tar.xz"))
>                (sha256
>                 (base32
> -                "12ccgbrfchgvmcfb88rcknq7xmrf19c5ysdr4v8jxk51j9izy78g"))
> +                "0wg9ng230w724rpwsrhcg4pw41xm1xhz0zx76haanyymkz1s05fq"))
>                (modules '((guix build utils)))
>                (snippet
>                 '(with-directory-excursion "ext"
> @@ -179,6 +168,13 @@
>                              "ext/standard/tests/general_functions/bug44667.phpt"
>                              "ext/standard/tests/general_functions/proc_open.phpt")
>                 (("/bin/cat") (which "cat")))
> +
> +             ;; These tests fail because they include a file whose modification
> +             ;; time is 0. Touch them to make the test pass. The issue is reported
> +             ;; upstream as #74137.
> +             (utime "sapi/phpdbg/tests/include.inc" 1 1)
> +             (utime "sapi/phpdbg/tests/phpdbg_get_executable_stream_wrapper.inc" 1 1)
> +
>               ;; The encoding of this file is not recognized, so we simply drop it.
>               (delete-file "ext/mbstring/tests/mb_send_mail07.phpt")
>  
> @@ -257,8 +253,10 @@
>                           ;; The test expects an Array, but instead get the contents(?).
>                           "ext/gd/tests/bug43073.phpt"
>                           ;; imagettftext() returns wrong coordinates.
> +                         "ext/gd/tests/bug48732-mb.phpt"
>                           "ext/gd/tests/bug48732.phpt"
>                           ;; Similarly for imageftbbox().
> +                         "ext/gd/tests/bug48801-mb.phpt"
>                           "ext/gd/tests/bug48801.phpt"
>                           ;; Different expected output from imagecolorallocate().
>                           "ext/gd/tests/bug53504.phpt"
> @@ -291,10 +289,11 @@
>         ("curl" ,curl)
>         ("cyrus-sasl" ,cyrus-sasl)
>         ("freetype" ,freetype)
> -       ("gd" ,gd-for-php)
> +       ("gd" ,gd)
>         ("gdbm" ,gdbm)
>         ("glibc" ,glibc)
>         ("gmp" ,gmp)
> +       ("gnutls" ,gnutls)

Is this a recent dependency? If not, I would prefer to have it as a separate commit.

Apart from the glib test thingy, these patches LGTM for 'core-updates'
with the mentioned changes.

>         ("libgcrypt" ,libgcrypt)
>         ("libjpeg" ,libjpeg)
>         ("libpng" ,libpng)
> --
> 2.7.4

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: PHP on core-updates
  2017-03-01 16:25 ` Marius Bakke
@ 2017-03-01 17:09   ` Leo Famulari
  0 siblings, 0 replies; 13+ messages in thread
From: Leo Famulari @ 2017-03-01 17:09 UTC (permalink / raw)
  To: Marius Bakke; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 654 bytes --]

On Wed, Mar 01, 2017 at 05:25:46PM +0100, Marius Bakke wrote:
> julien lepiller <julien@lepiller.eu> writes:
> 
> > I've "fixed" the glib failure by disabling a test. Attached are patches 
> > I would like to see in core-updates. If it's too late to add the patch 
> > for gd, then I would like to keep gd-for-php. This time I've tested them 
> > and php works.
> 
> I did not get a substitute for gd on core-updates, so I don't think it
> (or dependent packages) have been built yet. If so, patching it should
> be okay.

I think that gd should be working since
3de15bb740dbadf89cdcbd1b0737057996f4f87a (gnu: freetype: Update to
2.7.1.).

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: PHP on core-updates
  2017-03-01 15:34 julien lepiller
  2017-03-01 16:25 ` Marius Bakke
@ 2017-03-01 17:22 ` Leo Famulari
  2017-03-02 16:37 ` julien lepiller
  2 siblings, 0 replies; 13+ messages in thread
From: Leo Famulari @ 2017-03-01 17:22 UTC (permalink / raw)
  To: julien lepiller; +Cc: guix-devel

On Wed, Mar 01, 2017 at 04:34:25PM +0100, julien lepiller wrote:
> I've "fixed" the glib failure by disabling a test. Attached are patches I
> would like to see in core-updates. If it's too late to add the patch for gd,
> then I would like to keep gd-for-php. This time I've tested them and php
> works.

Oh no, I was so ready to be done with gd-for-php :) I'll check the
status of core-updates and give my opinion in a few hours.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: PHP on core-updates
  2017-03-01 15:34 julien lepiller
  2017-03-01 16:25 ` Marius Bakke
  2017-03-01 17:22 ` Leo Famulari
@ 2017-03-02 16:37 ` julien lepiller
  2017-03-02 16:55   ` Marius Bakke
  2017-03-02 17:17   ` Leo Famulari
  2 siblings, 2 replies; 13+ messages in thread
From: julien lepiller @ 2017-03-02 16:37 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 574 bytes --]

Le 2017-03-01 16:34, julien lepiller a écrit :
> I've "fixed" the glib failure by disabling a test. Attached are
> patches I would like to see in core-updates. If it's too late to add
> the patch for gd, then I would like to keep gd-for-php. This time I've
> tested them and php works.

A better version of those patches. I still don't know why glib tests 
hang. I had to add gnutls as an input because otherwise the build 
doesn't find "-lgnutls". There's no problem with the same php version on 
master, so I guess a dependency doesn't propagate gnutls anymore.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-glib-Fix-test-hang.patch --]
[-- Type: text/x-diff; name=0001-gnu-glib-Fix-test-hang.patch, Size: 878 bytes --]

From dcae1b092a48b05631845a6e5194a716e1538386 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Wed, 1 Mar 2017 10:24:32 +0100
Subject: [PATCH 1/3] gnu: glib: Fix test hang.

* gnu/packages/glib.scm (glib)[arguments]: Fix test hang.
---
 gnu/packages/glib.scm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index 1a794db..dab0524 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -204,6 +204,9 @@ shared NFS home directories.")
                        ;; recognize it.
                        "/thread/thread4"))
 
+                     ("glib/tests/642026.c"
+                      ("/glib/642026"))
+
                      ("glib/tests/timer.c"
                       (;; fails if compiler optimizations are enabled, which they
                        ;; are by default.
-- 
2.7.4


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-gnu-gd-Fix-an-issue-with-XBM-decoding.patch --]
[-- Type: text/x-diff; name=0002-gnu-gd-Fix-an-issue-with-XBM-decoding.patch, Size: 5919 bytes --]

From 10ab0fc95f83dbb291179cbf525d4bef196a827f Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Mon, 27 Feb 2017 11:09:11 +0100
Subject: [PATCH 2/3] gnu: gd: Fix an issue with XBM decoding.

* gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch: New file.
* gnu/local.scm (dist_patch_DATA): Add it.
* gnu/packages/gd.scm (gd)[source]: Use it.
---
 gnu/local.mk                                       |   1 +
 gnu/packages/gd.scm                                |   3 +-
 .../patches/gd-php-73968-Fix-109-XBM-reading.patch | 117 +++++++++++++++++++++
 3 files changed, 120 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 3d9ad70..271d2c4 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -582,6 +582,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/gd-fix-tests-on-i686.patch		\
   %D%/packages/patches/gd-fix-truecolor-format-correction.patch	\
   %D%/packages/patches/gd-freetype-test-failure.patch		\
+  %D%/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch		\
   %D%/packages/patches/gegl-CVE-2012-4433.patch			\
   %D%/packages/patches/geoclue-config.patch			\
   %D%/packages/patches/ghc-dont-pass-linker-flags-via-response-files.patch	\
diff --git a/gnu/packages/gd.scm b/gnu/packages/gd.scm
index ea13540..62c8fd8 100644
--- a/gnu/packages/gd.scm
+++ b/gnu/packages/gd.scm
@@ -53,7 +53,8 @@
                "1rp4v7n1dq38b92kl7gkvpvqqkw7nvdfnz6d5kip5klkxfki6zqk"))
              (patches (search-patches "gd-fix-gd2-read-test.patch"
                                       "gd-fix-tests-on-i686.patch"
-                                      "gd-freetype-test-failure.patch"))))
+                                      "gd-freetype-test-failure.patch"
+                                      "gd-php-73968-Fix-109-XBM-reading.patch"))))
     (build-system gnu-build-system)
     (arguments
       ;; As recommended by github.com/libgd/libgd/issues/278 to fix rounding
diff --git a/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch b/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch
new file mode 100644
index 0000000..c5c5022
--- /dev/null
+++ b/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch
@@ -0,0 +1,117 @@
+This bug was first reported to php on https://bugs.php.net/bug.php?id=73968.
+php then reported it to gd in https://github.com/libgd/libgd/issues/109. This
+patch is taken from commit 082c5444838ea0d84f9fb6441aefdb44d78d9bba of gd.
+Binary files have been removed from the patch because our patch procedure
+doesn't support that format.
+
+From 082c5444838ea0d84f9fb6441aefdb44d78d9bba Mon Sep 17 00:00:00 2001
+From: "Christoph M. Becker" <cmbecker69@gmx.de>
+Date: Fri, 20 Jan 2017 22:48:20 +0100
+Subject: [PATCH] Fix #109: XBM reading fails with printed error
+
+When calculating the number of required bytes of an XBM image, we have
+to take the line padding into account.
+---
+ src/gd_xbm.c                     |   2 +-
+ tests/xbm/CMakeLists.txt         |   1 +
+ tests/xbm/Makemodule.am          |   5 ++++-
+ tests/xbm/github_bug_109.c       |  35 +++++++++++++++++++++++++++++++++++
+ tests/xbm/github_bug_109.xbm     |   5 +++++
+ 5 files changed, 47 insertions(+), 2 deletions(-)
+ create mode 100644 tests/xbm/github_bug_109.c
+ create mode 100644 tests/xbm/github_bug_109.xbm
+ create mode 100644 tests/xbm/github_bug_109_exp.png
+
+diff --git a/src/gd_xbm.c b/src/gd_xbm.c
+index 5f09b56..c2ba2ad 100644
+--- a/src/gd_xbm.c
++++ b/src/gd_xbm.c
+@@ -108,7 +108,7 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFromXbm(FILE * fd)
+ 				max_bit = 32768;
+ 			}
+ 			if (max_bit) {
+-				bytes = (width * height / 8) + 1;
++                bytes = (width + 7) / 8 * height;
+ 				if (!bytes) {
+ 					return 0;
+ 				}
+diff --git a/tests/xbm/CMakeLists.txt b/tests/xbm/CMakeLists.txt
+index 183cf5e..08576e0 100644
+--- a/tests/xbm/CMakeLists.txt
++++ b/tests/xbm/CMakeLists.txt
+@@ -1,4 +1,5 @@
+ LIST(APPEND TESTS_FILES
++	github_bug_109
+ 	github_bug_170
+ )
+ 
+diff --git a/tests/xbm/Makemodule.am b/tests/xbm/Makemodule.am
+index ba1eabd..0f5beb6 100644
+--- a/tests/xbm/Makemodule.am
++++ b/tests/xbm/Makemodule.am
+@@ -1,5 +1,8 @@
+ libgd_test_programs += \
++	xbm/github_bug_109 \
+ 	xbm/github_bug_170
+ 
+ EXTRA_DIST += \
+-	xbm/CMakeLists.txt
++	xbm/CMakeLists.txt \
++	xbm/github_bug_109.xbm \
++	xbm/github_bug_109_exp.png
+diff --git a/tests/xbm/github_bug_109.c b/tests/xbm/github_bug_109.c
+new file mode 100644
+index 0000000..1a020c6
+--- /dev/null
++++ b/tests/xbm/github_bug_109.c
+@@ -0,0 +1,35 @@
++/**
++ * Test reading of XBM images with a width that is not a multiple of 8
++ *
++ * We're reading such an XBM image, and check that we got what we've expected,
++ * instead of an error message.
++ *
++ * See also <https://github.com/libgd/libgd/issues/109>.
++ */
++
++
++#include "gd.h"
++#include "gdtest.h"
++
++
++int main()
++{
++    gdImagePtr im;
++    FILE *fp;
++    char *path;
++
++    fp = gdTestFileOpen2("xbm", "github_bug_109.xbm");
++    im = gdImageCreateFromXbm(fp);
++    fclose(fp);
++    gdTestAssert(im != NULL);
++    gdTestAssert(gdImageGetTrueColorPixel(im, 0, 0) == 0);
++    gdTestAssert(gdImageGetTrueColorPixel(im, 0, 1) == 0xffffff);
++
++    path = gdTestFilePath2("xbm", "github_bug_109_exp.png");
++    gdAssertImageEqualsToFile(path, im);
++    gdFree(path);
++
++    gdImageDestroy(im);
++
++    return gdNumFailures();
++}
+diff --git a/tests/xbm/github_bug_109.xbm b/tests/xbm/github_bug_109.xbm
+new file mode 100644
+index 0000000..f427d86
+--- /dev/null
++++ b/tests/xbm/github_bug_109.xbm
+@@ -0,0 +1,5 @@
++#define test_width 10
++#define test_height 10
++static unsigned char test_bits[] = {
++  0xFF, 0x03, 0x00, 0x00, 0xFF, 0x03, 0x00, 0x00, 0xFF, 0x03, 0x00, 0x00, 
++  0xFF, 0x03, 0x00, 0x00, 0xFF, 0x03, 0x00, 0x00};
+
+-- 
+2.7.4
+
-- 
2.7.4


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0003-gnu-php-Update-to-7.1.2.patch --]
[-- Type: text/x-diff; name=0003-gnu-php-Update-to-7.1.2.patch, Size: 11202 bytes --]

From e1a202e5210adb4074a756dbd0b20cd82cb043c2 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Mon, 27 Feb 2017 11:15:29 +0100
Subject: [PATCH 3/3] gnu: php: Update to 7.1.2.

* gnu/packages/php.scm (php): Update to 7.1.2.
* gnu/packages/patches/gd-fix-chunk-size-on-boundaries.patch: Remove file.
* gnu/packages/patches/*gd-fix-truecolor-format-correction.patch: Remove file.
* gnu/local.mk (dist_patch_DATA): Remove them.
---
 gnu/local.mk                                       |   2 -
 .../patches/gd-fix-chunk-size-on-boundaries.patch  | 102 ---------------------
 .../gd-fix-truecolor-format-correction.patch       |  95 -------------------
 gnu/packages/php.scm                               |  27 +++---
 4 files changed, 13 insertions(+), 213 deletions(-)
 delete mode 100644 gnu/packages/patches/gd-fix-chunk-size-on-boundaries.patch
 delete mode 100644 gnu/packages/patches/gd-fix-truecolor-format-correction.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 271d2c4..ff10e90 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -577,10 +577,8 @@ dist_patch_DATA =						\
   %D%/packages/patches/gcc-6-cross-environment-variables.patch	\
   %D%/packages/patches/gcj-arm-mode.patch			\
   %D%/packages/patches/gdk-pixbuf-list-dir.patch		\
-  %D%/packages/patches/gd-fix-chunk-size-on-boundaries.patch	\
   %D%/packages/patches/gd-fix-gd2-read-test.patch		\
   %D%/packages/patches/gd-fix-tests-on-i686.patch		\
-  %D%/packages/patches/gd-fix-truecolor-format-correction.patch	\
   %D%/packages/patches/gd-freetype-test-failure.patch		\
   %D%/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch		\
   %D%/packages/patches/gegl-CVE-2012-4433.patch			\
diff --git a/gnu/packages/patches/gd-fix-chunk-size-on-boundaries.patch b/gnu/packages/patches/gd-fix-chunk-size-on-boundaries.patch
deleted file mode 100644
index e395c66..0000000
--- a/gnu/packages/patches/gd-fix-chunk-size-on-boundaries.patch
+++ /dev/null
@@ -1,102 +0,0 @@
-This fixes PHP bug #73155: https://bugs.php.net/bug.php?id=73155
-
-Patch adapted from upstream source repository:
-
-https://github.com/libgd/libgd/commit/8067a8ac336dfe0acbe96ec2eb24572209a7f279
-
-(.gitignore change removed)
-
-From 8067a8ac336dfe0acbe96ec2eb24572209a7f279 Mon Sep 17 00:00:00 2001
-From: "Christoph M. Becker" <cmbecker69@gmx.de>
-Date: Fri, 23 Sep 2016 18:29:52 +0200
-Subject: [PATCH] Fix #309: gdImageGd2() writes wrong chunk sizes on boundaries
-
-(cherry picked from commit bb1998a16e30d542ab22eba5501911a9aa066edb)
----
- src/gd_gd2.c             |  4 ++--
- tests/gd2/CMakeLists.txt |  1 +
- tests/gd2/Makemodule.am  |  1 +
- tests/gd2/bug00309.c     | 37 +++++++++++++++++++++++++++++++++++++
- 4 files changed, 41 insertions(+), 2 deletions(-)
- create mode 100644 tests/gd2/bug00309.c
-
-diff --git a/src/gd_gd2.c b/src/gd_gd2.c
-index 75e5e1f..b9b2f93 100644
---- a/src/gd_gd2.c
-+++ b/src/gd_gd2.c
-@@ -938,8 +938,8 @@ _gdImageGd2 (gdImagePtr im, gdIOCtx * out, int cs, int fmt)
- 	};
- 
- 	/* Work out number of chunks. */
--	ncx = im->sx / cs + 1;
--	ncy = im->sy / cs + 1;
-+	ncx = (im->sx + cs - 1) / cs;
-+	ncy = (im->sy + cs - 1) / cs;
- 
- 	/* Write the standard header. */
- 	_gd2PutHeader (im, out, cs, fmt, ncx, ncy);
-diff --git a/tests/gd2/CMakeLists.txt b/tests/gd2/CMakeLists.txt
-index 3b650ad..247b466 100644
---- a/tests/gd2/CMakeLists.txt
-+++ b/tests/gd2/CMakeLists.txt
-@@ -1,5 +1,6 @@
- SET(TESTS_FILES
- 	bug_289
-+	bug00309
- 	gd2_empty_file
- 	gd2_im2im
- 	gd2_null
-diff --git a/tests/gd2/Makemodule.am b/tests/gd2/Makemodule.am
-index b8ee946..d69aee0 100644
---- a/tests/gd2/Makemodule.am
-+++ b/tests/gd2/Makemodule.am
-@@ -1,5 +1,6 @@
- libgd_test_programs += \
- 	gd2/bug_289 \
-+	gd2/bug00309 \
- 	gd2/gd2_empty_file \
- 	gd2/php_bug_72339 \
- 	gd2/gd2_read_corrupt
-diff --git a/tests/gd2/bug00309.c b/tests/gd2/bug00309.c
-new file mode 100644
-index 0000000..b649cdc
---- /dev/null
-+++ b/tests/gd2/bug00309.c
-@@ -0,0 +1,37 @@
-+/**
-+ * Regression test for <https://github.com/libgd/libgd/issues/309>.
-+ *
-+ * We test that an image with 64x64 pixels reports only a single chunk in the
-+ * GD2 image header when the chunk size is 64.
-+ */
-+
-+
-+#include "gd.h"
-+#include "gdtest.h"
-+
-+
-+int main()
-+{
-+    gdImagePtr im;
-+    unsigned char *buf;
-+    int size, word;
-+
-+    im = gdImageCreate(64, 64);
-+    gdImageColorAllocate(im, 0, 0, 0);
-+
-+    buf = gdImageGd2Ptr(im, 64, 1, &size);
-+
-+    gdImageDestroy(im);
-+
-+    word = buf[10] << 8 | buf[11];
-+    gdTestAssertMsg(word == 64, "chunk size is %d, but expected 64\n", word);
-+    word = buf[14] << 8 | buf[15];
-+    gdTestAssertMsg(word == 1, "x chunk count is %d, but expected 1\n", word);
-+    word = buf[16] << 8 | buf[17];
-+    gdTestAssertMsg(word == 1, "y chunk count is %d, but expected 1\n", word);
-+    gdTestAssertMsg(size == 5145, "file size is %d, but expected 5145\n", size);
-+
-+    gdFree(buf);
-+
-+    return gdNumFailures();
-+}
diff --git a/gnu/packages/patches/gd-fix-truecolor-format-correction.patch b/gnu/packages/patches/gd-fix-truecolor-format-correction.patch
deleted file mode 100644
index be3eff9..0000000
--- a/gnu/packages/patches/gd-fix-truecolor-format-correction.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-This fixes PHP bug #73159: https://bugs.php.net/bug.php?id=73159
-
-Patch lifted from upstream source repository:
-
-https://github.com/libgd/libgd/commit/e1f61a4141d2e0937a13b8bfb1992b9f29eb05f5
-
-From e1f61a4141d2e0937a13b8bfb1992b9f29eb05f5 Mon Sep 17 00:00:00 2001
-From: "Christoph M. Becker" <cmbecker69@gmx.de>
-Date: Mon, 15 Aug 2016 17:49:40 +0200
-Subject: [PATCH] Fix #289: Passing unrecognized formats to gdImageGd2 results
- in corrupted files
-
-We must not apply the format correction twice for truecolor images.
-
-(cherry picked from commit 09090c125658e23a4ae2a2e002646bb7278bd89e)
----
- src/gd_gd2.c             |  2 +-
- tests/gd2/CMakeLists.txt |  1 +
- tests/gd2/Makemodule.am  |  1 +
- tests/gd2/bug_289.c      | 33 +++++++++++++++++++++++++++++++++
- 4 files changed, 36 insertions(+), 1 deletion(-)
- create mode 100644 tests/gd2/bug_289.c
-
-diff --git a/src/gd_gd2.c b/src/gd_gd2.c
-index 86c881e..75e5e1f 100644
---- a/src/gd_gd2.c
-+++ b/src/gd_gd2.c
-@@ -918,7 +918,7 @@ _gdImageGd2 (gdImagePtr im, gdIOCtx * out, int cs, int fmt)
- 	/* Force fmt to a valid value since we don't return anything. */
- 	/* */
- 	if ((fmt != GD2_FMT_RAW) && (fmt != GD2_FMT_COMPRESSED)) {
--		fmt = im->trueColor ? GD2_FMT_TRUECOLOR_COMPRESSED : GD2_FMT_COMPRESSED;
-+		fmt = GD2_FMT_COMPRESSED;
- 	};
- 	if (im->trueColor) {
- 		fmt += 2;
-diff --git a/tests/gd2/CMakeLists.txt b/tests/gd2/CMakeLists.txt
-index 8aecacc..3b650ad 100644
---- a/tests/gd2/CMakeLists.txt
-+++ b/tests/gd2/CMakeLists.txt
-@@ -1,4 +1,5 @@
- SET(TESTS_FILES
-+	bug_289
- 	gd2_empty_file
- 	gd2_im2im
- 	gd2_null
-diff --git a/tests/gd2/Makemodule.am b/tests/gd2/Makemodule.am
-index 754a284..b8ee946 100644
---- a/tests/gd2/Makemodule.am
-+++ b/tests/gd2/Makemodule.am
-@@ -1,4 +1,5 @@
- libgd_test_programs += \
-+	gd2/bug_289 \
- 	gd2/gd2_empty_file \
- 	gd2/php_bug_72339 \
- 	gd2/gd2_read_corrupt
-diff --git a/tests/gd2/bug_289.c b/tests/gd2/bug_289.c
-new file mode 100644
-index 0000000..ad311e9
---- /dev/null
-+++ b/tests/gd2/bug_289.c
-@@ -0,0 +1,33 @@
-+/**
-+ * Passing an unrecognized format to gdImageGd2() should result in
-+ * GD2_FMT_TRUECOLOR_COMPRESSED for truecolor images.
-+ *
-+ * See <https://github.com/libgd/libgd/issues/289>.
-+ */
-+
-+#include "gd.h"
-+#include "gdtest.h"
-+
-+
-+#define GD2_FMT_UNRECOGNIZED 0
-+#define GD2_FMT_TRUECOLOR_COMPRESSED 4
-+
-+#define MSG "expected %s byte to be %d, but got %d\n"
-+
-+
-+int main()
-+{
-+    gdImagePtr im;
-+    char *buffer;
-+    int size;
-+
-+    im = gdImageCreateTrueColor(10, 10);
-+    gdTestAssert(im != NULL);
-+    buffer = (char *) gdImageGd2Ptr(im, 128, GD2_FMT_UNRECOGNIZED, &size);
-+    gdTestAssert(buffer != NULL);
-+    gdImageDestroy(im);
-+    gdTestAssertMsg(buffer[12] == 0, MSG, "1st", 0, buffer[12]);
-+    gdTestAssertMsg(buffer[13] == GD2_FMT_TRUECOLOR_COMPRESSED, MSG, "2nd", GD2_FMT_TRUECOLOR_COMPRESSED, buffer[13]);
-+
-+    return gdNumFailures();
-+}
diff --git a/gnu/packages/php.scm b/gnu/packages/php.scm
index 16b0985..0dfee36 100644
--- a/gnu/packages/php.scm
+++ b/gnu/packages/php.scm
@@ -50,21 +50,10 @@
   #:use-module (guix build-system gnu)
   #:use-module ((guix licenses) #:prefix license:))
 
-;; This fixes PHP bugs 73155 and 73159. Remove when gd
-;; is updated to > 2.2.3.
-(define gd-for-php
-  (package (inherit gd)
-           (source
-            (origin
-              (inherit (package-source gd))
-              (patches (search-patches
-                        "gd-fix-truecolor-format-correction.patch"
-                        "gd-fix-chunk-size-on-boundaries.patch"))))))
-
 (define-public php
   (package
     (name "php")
-    (version "7.0.14")
+    (version "7.1.2")
     (home-page "https://secure.php.net/")
     (source (origin
               (method url-fetch)
@@ -72,7 +61,7 @@
                                   name "-" version ".tar.xz"))
               (sha256
                (base32
-                "12ccgbrfchgvmcfb88rcknq7xmrf19c5ysdr4v8jxk51j9izy78g"))
+                "0wg9ng230w724rpwsrhcg4pw41xm1xhz0zx76haanyymkz1s05fq"))
               (modules '((guix build utils)))
               (snippet
                '(with-directory-excursion "ext"
@@ -179,6 +168,13 @@
                             "ext/standard/tests/general_functions/bug44667.phpt"
                             "ext/standard/tests/general_functions/proc_open.phpt")
                (("/bin/cat") (which "cat")))
+
+             ;; These tests fail because they include a file whose modification
+             ;; time is 0. Touch them to make the test pass. The issue is reported
+             ;; upstream as #74137.
+             (utime "sapi/phpdbg/tests/include.inc" 1 1)
+             (utime "sapi/phpdbg/tests/phpdbg_get_executable_stream_wrapper.inc" 1 1)
+
              ;; The encoding of this file is not recognized, so we simply drop it.
              (delete-file "ext/mbstring/tests/mb_send_mail07.phpt")
 
@@ -257,8 +253,10 @@
                          ;; The test expects an Array, but instead get the contents(?).
                          "ext/gd/tests/bug43073.phpt"
                          ;; imagettftext() returns wrong coordinates.
+                         "ext/gd/tests/bug48732-mb.phpt"
                          "ext/gd/tests/bug48732.phpt"
                          ;; Similarly for imageftbbox().
+                         "ext/gd/tests/bug48801-mb.phpt"
                          "ext/gd/tests/bug48801.phpt"
                          ;; Different expected output from imagecolorallocate().
                          "ext/gd/tests/bug53504.phpt"
@@ -291,10 +289,11 @@
        ("curl" ,curl)
        ("cyrus-sasl" ,cyrus-sasl)
        ("freetype" ,freetype)
-       ("gd" ,gd-for-php)
+       ("gd" ,gd)
        ("gdbm" ,gdbm)
        ("glibc" ,glibc)
        ("gmp" ,gmp)
+       ("gnutls" ,gnutls)
        ("libgcrypt" ,libgcrypt)
        ("libjpeg" ,libjpeg)
        ("libpng" ,libpng)
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: PHP on core-updates
  2017-03-02 16:37 ` julien lepiller
@ 2017-03-02 16:55   ` Marius Bakke
  2017-03-02 17:18     ` Leo Famulari
  2017-03-02 17:17   ` Leo Famulari
  1 sibling, 1 reply; 13+ messages in thread
From: Marius Bakke @ 2017-03-02 16:55 UTC (permalink / raw)
  To: julien lepiller, guix-devel

[-- Attachment #1: Type: text/plain, Size: 20504 bytes --]

julien lepiller <julien@lepiller.eu> writes:

> Le 2017-03-01 16:34, julien lepiller a écrit :
>> I've "fixed" the glib failure by disabling a test. Attached are
>> patches I would like to see in core-updates. If it's too late to add
>> the patch for gd, then I would like to keep gd-for-php. This time I've
>> tested them and php works.
>
> A better version of those patches. I still don't know why glib tests 
> hang. I had to add gnutls as an input because otherwise the build 
> doesn't find "-lgnutls". There's no problem with the same php version on 
> master, so I guess a dependency doesn't propagate gnutls anymore.

Ok, thanks for the update! The latter two patches LGTM for
'core-updates'. I would hold the glib patch until we understand what's
going on, I am not able to reproduce it.

Please also update the commit message of the PHP patch to mention the
new inputs and arguments change, as well as the removal of the
"gd-for-php" variable.

> From dcae1b092a48b05631845a6e5194a716e1538386 Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien@lepiller.eu>
> Date: Wed, 1 Mar 2017 10:24:32 +0100
> Subject: [PATCH 1/3] gnu: glib: Fix test hang.
>
> * gnu/packages/glib.scm (glib)[arguments]: Fix test hang.
> ---
>  gnu/packages/glib.scm | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
> index 1a794db..dab0524 100644
> --- a/gnu/packages/glib.scm
> +++ b/gnu/packages/glib.scm
> @@ -204,6 +204,9 @@ shared NFS home directories.")
>                         ;; recognize it.
>                         "/thread/thread4"))
>  
> +                     ("glib/tests/642026.c"
> +                      ("/glib/642026"))
> +
>                       ("glib/tests/timer.c"
>                        (;; fails if compiler optimizations are enabled, which they
>                         ;; are by default.
> -- 
> 2.7.4
>
> From 10ab0fc95f83dbb291179cbf525d4bef196a827f Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien@lepiller.eu>
> Date: Mon, 27 Feb 2017 11:09:11 +0100
> Subject: [PATCH 2/3] gnu: gd: Fix an issue with XBM decoding.
>
> * gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch: New file.
> * gnu/local.scm (dist_patch_DATA): Add it.
> * gnu/packages/gd.scm (gd)[source]: Use it.
> ---
>  gnu/local.mk                                       |   1 +
>  gnu/packages/gd.scm                                |   3 +-
>  .../patches/gd-php-73968-Fix-109-XBM-reading.patch | 117 +++++++++++++++++++++
>  3 files changed, 120 insertions(+), 1 deletion(-)
>  create mode 100644 gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch
>
> diff --git a/gnu/local.mk b/gnu/local.mk
> index 3d9ad70..271d2c4 100644
> --- a/gnu/local.mk
> +++ b/gnu/local.mk
> @@ -582,6 +582,7 @@ dist_patch_DATA =						\
>    %D%/packages/patches/gd-fix-tests-on-i686.patch		\
>    %D%/packages/patches/gd-fix-truecolor-format-correction.patch	\
>    %D%/packages/patches/gd-freetype-test-failure.patch		\
> +  %D%/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch		\
>    %D%/packages/patches/gegl-CVE-2012-4433.patch			\
>    %D%/packages/patches/geoclue-config.patch			\
>    %D%/packages/patches/ghc-dont-pass-linker-flags-via-response-files.patch	\
> diff --git a/gnu/packages/gd.scm b/gnu/packages/gd.scm
> index ea13540..62c8fd8 100644
> --- a/gnu/packages/gd.scm
> +++ b/gnu/packages/gd.scm
> @@ -53,7 +53,8 @@
>                 "1rp4v7n1dq38b92kl7gkvpvqqkw7nvdfnz6d5kip5klkxfki6zqk"))
>               (patches (search-patches "gd-fix-gd2-read-test.patch"
>                                        "gd-fix-tests-on-i686.patch"
> -                                      "gd-freetype-test-failure.patch"))))
> +                                      "gd-freetype-test-failure.patch"
> +                                      "gd-php-73968-Fix-109-XBM-reading.patch"))))
>      (build-system gnu-build-system)
>      (arguments
>        ;; As recommended by github.com/libgd/libgd/issues/278 to fix rounding
> diff --git a/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch b/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch
> new file mode 100644
> index 0000000..c5c5022
> --- /dev/null
> +++ b/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch
> @@ -0,0 +1,117 @@
> +This bug was first reported to php on https://bugs.php.net/bug.php?id=73968.
> +php then reported it to gd in https://github.com/libgd/libgd/issues/109. This
> +patch is taken from commit 082c5444838ea0d84f9fb6441aefdb44d78d9bba of gd.
> +Binary files have been removed from the patch because our patch procedure
> +doesn't support that format.
> +
> +From 082c5444838ea0d84f9fb6441aefdb44d78d9bba Mon Sep 17 00:00:00 2001
> +From: "Christoph M. Becker" <cmbecker69@gmx.de>
> +Date: Fri, 20 Jan 2017 22:48:20 +0100
> +Subject: [PATCH] Fix #109: XBM reading fails with printed error
> +
> +When calculating the number of required bytes of an XBM image, we have
> +to take the line padding into account.
> +---
> + src/gd_xbm.c                     |   2 +-
> + tests/xbm/CMakeLists.txt         |   1 +
> + tests/xbm/Makemodule.am          |   5 ++++-
> + tests/xbm/github_bug_109.c       |  35 +++++++++++++++++++++++++++++++++++
> + tests/xbm/github_bug_109.xbm     |   5 +++++
> + 5 files changed, 47 insertions(+), 2 deletions(-)
> + create mode 100644 tests/xbm/github_bug_109.c
> + create mode 100644 tests/xbm/github_bug_109.xbm
> + create mode 100644 tests/xbm/github_bug_109_exp.png
> +
> +diff --git a/src/gd_xbm.c b/src/gd_xbm.c
> +index 5f09b56..c2ba2ad 100644
> +--- a/src/gd_xbm.c
> ++++ b/src/gd_xbm.c
> +@@ -108,7 +108,7 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFromXbm(FILE * fd)
> + 				max_bit = 32768;
> + 			}
> + 			if (max_bit) {
> +-				bytes = (width * height / 8) + 1;
> ++                bytes = (width + 7) / 8 * height;
> + 				if (!bytes) {
> + 					return 0;
> + 				}
> +diff --git a/tests/xbm/CMakeLists.txt b/tests/xbm/CMakeLists.txt
> +index 183cf5e..08576e0 100644
> +--- a/tests/xbm/CMakeLists.txt
> ++++ b/tests/xbm/CMakeLists.txt
> +@@ -1,4 +1,5 @@
> + LIST(APPEND TESTS_FILES
> ++	github_bug_109
> + 	github_bug_170
> + )
> + 
> +diff --git a/tests/xbm/Makemodule.am b/tests/xbm/Makemodule.am
> +index ba1eabd..0f5beb6 100644
> +--- a/tests/xbm/Makemodule.am
> ++++ b/tests/xbm/Makemodule.am
> +@@ -1,5 +1,8 @@
> + libgd_test_programs += \
> ++	xbm/github_bug_109 \
> + 	xbm/github_bug_170
> + 
> + EXTRA_DIST += \
> +-	xbm/CMakeLists.txt
> ++	xbm/CMakeLists.txt \
> ++	xbm/github_bug_109.xbm \
> ++	xbm/github_bug_109_exp.png
> +diff --git a/tests/xbm/github_bug_109.c b/tests/xbm/github_bug_109.c
> +new file mode 100644
> +index 0000000..1a020c6
> +--- /dev/null
> ++++ b/tests/xbm/github_bug_109.c
> +@@ -0,0 +1,35 @@
> ++/**
> ++ * Test reading of XBM images with a width that is not a multiple of 8
> ++ *
> ++ * We're reading such an XBM image, and check that we got what we've expected,
> ++ * instead of an error message.
> ++ *
> ++ * See also <https://github.com/libgd/libgd/issues/109>.
> ++ */
> ++
> ++
> ++#include "gd.h"
> ++#include "gdtest.h"
> ++
> ++
> ++int main()
> ++{
> ++    gdImagePtr im;
> ++    FILE *fp;
> ++    char *path;
> ++
> ++    fp = gdTestFileOpen2("xbm", "github_bug_109.xbm");
> ++    im = gdImageCreateFromXbm(fp);
> ++    fclose(fp);
> ++    gdTestAssert(im != NULL);
> ++    gdTestAssert(gdImageGetTrueColorPixel(im, 0, 0) == 0);
> ++    gdTestAssert(gdImageGetTrueColorPixel(im, 0, 1) == 0xffffff);
> ++
> ++    path = gdTestFilePath2("xbm", "github_bug_109_exp.png");
> ++    gdAssertImageEqualsToFile(path, im);
> ++    gdFree(path);
> ++
> ++    gdImageDestroy(im);
> ++
> ++    return gdNumFailures();
> ++}
> +diff --git a/tests/xbm/github_bug_109.xbm b/tests/xbm/github_bug_109.xbm
> +new file mode 100644
> +index 0000000..f427d86
> +--- /dev/null
> ++++ b/tests/xbm/github_bug_109.xbm
> +@@ -0,0 +1,5 @@
> ++#define test_width 10
> ++#define test_height 10
> ++static unsigned char test_bits[] = {
> ++  0xFF, 0x03, 0x00, 0x00, 0xFF, 0x03, 0x00, 0x00, 0xFF, 0x03, 0x00, 0x00, 
> ++  0xFF, 0x03, 0x00, 0x00, 0xFF, 0x03, 0x00, 0x00};
> +
> +-- 
> +2.7.4
> +
> -- 
> 2.7.4
>
> From e1a202e5210adb4074a756dbd0b20cd82cb043c2 Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien@lepiller.eu>
> Date: Mon, 27 Feb 2017 11:15:29 +0100
> Subject: [PATCH 3/3] gnu: php: Update to 7.1.2.
>
> * gnu/packages/php.scm (php): Update to 7.1.2.
> * gnu/packages/patches/gd-fix-chunk-size-on-boundaries.patch: Remove file.
> * gnu/packages/patches/*gd-fix-truecolor-format-correction.patch: Remove file.
> * gnu/local.mk (dist_patch_DATA): Remove them.
> ---
>  gnu/local.mk                                       |   2 -
>  .../patches/gd-fix-chunk-size-on-boundaries.patch  | 102 ---------------------
>  .../gd-fix-truecolor-format-correction.patch       |  95 -------------------
>  gnu/packages/php.scm                               |  27 +++---
>  4 files changed, 13 insertions(+), 213 deletions(-)
>  delete mode 100644 gnu/packages/patches/gd-fix-chunk-size-on-boundaries.patch
>  delete mode 100644 gnu/packages/patches/gd-fix-truecolor-format-correction.patch
>
> diff --git a/gnu/local.mk b/gnu/local.mk
> index 271d2c4..ff10e90 100644
> --- a/gnu/local.mk
> +++ b/gnu/local.mk
> @@ -577,10 +577,8 @@ dist_patch_DATA =						\
>    %D%/packages/patches/gcc-6-cross-environment-variables.patch	\
>    %D%/packages/patches/gcj-arm-mode.patch			\
>    %D%/packages/patches/gdk-pixbuf-list-dir.patch		\
> -  %D%/packages/patches/gd-fix-chunk-size-on-boundaries.patch	\
>    %D%/packages/patches/gd-fix-gd2-read-test.patch		\
>    %D%/packages/patches/gd-fix-tests-on-i686.patch		\
> -  %D%/packages/patches/gd-fix-truecolor-format-correction.patch	\
>    %D%/packages/patches/gd-freetype-test-failure.patch		\
>    %D%/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch		\
>    %D%/packages/patches/gegl-CVE-2012-4433.patch			\
> diff --git a/gnu/packages/patches/gd-fix-chunk-size-on-boundaries.patch b/gnu/packages/patches/gd-fix-chunk-size-on-boundaries.patch
> deleted file mode 100644
> index e395c66..0000000
> --- a/gnu/packages/patches/gd-fix-chunk-size-on-boundaries.patch
> +++ /dev/null
> @@ -1,102 +0,0 @@
> -This fixes PHP bug #73155: https://bugs.php.net/bug.php?id=73155
> -
> -Patch adapted from upstream source repository:
> -
> -https://github.com/libgd/libgd/commit/8067a8ac336dfe0acbe96ec2eb24572209a7f279
> -
> -(.gitignore change removed)
> -
> -From 8067a8ac336dfe0acbe96ec2eb24572209a7f279 Mon Sep 17 00:00:00 2001
> -From: "Christoph M. Becker" <cmbecker69@gmx.de>
> -Date: Fri, 23 Sep 2016 18:29:52 +0200
> -Subject: [PATCH] Fix #309: gdImageGd2() writes wrong chunk sizes on boundaries
> -
> -(cherry picked from commit bb1998a16e30d542ab22eba5501911a9aa066edb)
> ----
> - src/gd_gd2.c             |  4 ++--
> - tests/gd2/CMakeLists.txt |  1 +
> - tests/gd2/Makemodule.am  |  1 +
> - tests/gd2/bug00309.c     | 37 +++++++++++++++++++++++++++++++++++++
> - 4 files changed, 41 insertions(+), 2 deletions(-)
> - create mode 100644 tests/gd2/bug00309.c
> -
> -diff --git a/src/gd_gd2.c b/src/gd_gd2.c
> -index 75e5e1f..b9b2f93 100644
> ---- a/src/gd_gd2.c
> -+++ b/src/gd_gd2.c
> -@@ -938,8 +938,8 @@ _gdImageGd2 (gdImagePtr im, gdIOCtx * out, int cs, int fmt)
> - 	};
> - 
> - 	/* Work out number of chunks. */
> --	ncx = im->sx / cs + 1;
> --	ncy = im->sy / cs + 1;
> -+	ncx = (im->sx + cs - 1) / cs;
> -+	ncy = (im->sy + cs - 1) / cs;
> - 
> - 	/* Write the standard header. */
> - 	_gd2PutHeader (im, out, cs, fmt, ncx, ncy);
> -diff --git a/tests/gd2/CMakeLists.txt b/tests/gd2/CMakeLists.txt
> -index 3b650ad..247b466 100644
> ---- a/tests/gd2/CMakeLists.txt
> -+++ b/tests/gd2/CMakeLists.txt
> -@@ -1,5 +1,6 @@
> - SET(TESTS_FILES
> - 	bug_289
> -+	bug00309
> - 	gd2_empty_file
> - 	gd2_im2im
> - 	gd2_null
> -diff --git a/tests/gd2/Makemodule.am b/tests/gd2/Makemodule.am
> -index b8ee946..d69aee0 100644
> ---- a/tests/gd2/Makemodule.am
> -+++ b/tests/gd2/Makemodule.am
> -@@ -1,5 +1,6 @@
> - libgd_test_programs += \
> - 	gd2/bug_289 \
> -+	gd2/bug00309 \
> - 	gd2/gd2_empty_file \
> - 	gd2/php_bug_72339 \
> - 	gd2/gd2_read_corrupt
> -diff --git a/tests/gd2/bug00309.c b/tests/gd2/bug00309.c
> -new file mode 100644
> -index 0000000..b649cdc
> ---- /dev/null
> -+++ b/tests/gd2/bug00309.c
> -@@ -0,0 +1,37 @@
> -+/**
> -+ * Regression test for <https://github.com/libgd/libgd/issues/309>.
> -+ *
> -+ * We test that an image with 64x64 pixels reports only a single chunk in the
> -+ * GD2 image header when the chunk size is 64.
> -+ */
> -+
> -+
> -+#include "gd.h"
> -+#include "gdtest.h"
> -+
> -+
> -+int main()
> -+{
> -+    gdImagePtr im;
> -+    unsigned char *buf;
> -+    int size, word;
> -+
> -+    im = gdImageCreate(64, 64);
> -+    gdImageColorAllocate(im, 0, 0, 0);
> -+
> -+    buf = gdImageGd2Ptr(im, 64, 1, &size);
> -+
> -+    gdImageDestroy(im);
> -+
> -+    word = buf[10] << 8 | buf[11];
> -+    gdTestAssertMsg(word == 64, "chunk size is %d, but expected 64\n", word);
> -+    word = buf[14] << 8 | buf[15];
> -+    gdTestAssertMsg(word == 1, "x chunk count is %d, but expected 1\n", word);
> -+    word = buf[16] << 8 | buf[17];
> -+    gdTestAssertMsg(word == 1, "y chunk count is %d, but expected 1\n", word);
> -+    gdTestAssertMsg(size == 5145, "file size is %d, but expected 5145\n", size);
> -+
> -+    gdFree(buf);
> -+
> -+    return gdNumFailures();
> -+}
> diff --git a/gnu/packages/patches/gd-fix-truecolor-format-correction.patch b/gnu/packages/patches/gd-fix-truecolor-format-correction.patch
> deleted file mode 100644
> index be3eff9..0000000
> --- a/gnu/packages/patches/gd-fix-truecolor-format-correction.patch
> +++ /dev/null
> @@ -1,95 +0,0 @@
> -This fixes PHP bug #73159: https://bugs.php.net/bug.php?id=73159
> -
> -Patch lifted from upstream source repository:
> -
> -https://github.com/libgd/libgd/commit/e1f61a4141d2e0937a13b8bfb1992b9f29eb05f5
> -
> -From e1f61a4141d2e0937a13b8bfb1992b9f29eb05f5 Mon Sep 17 00:00:00 2001
> -From: "Christoph M. Becker" <cmbecker69@gmx.de>
> -Date: Mon, 15 Aug 2016 17:49:40 +0200
> -Subject: [PATCH] Fix #289: Passing unrecognized formats to gdImageGd2 results
> - in corrupted files
> -
> -We must not apply the format correction twice for truecolor images.
> -
> -(cherry picked from commit 09090c125658e23a4ae2a2e002646bb7278bd89e)
> ----
> - src/gd_gd2.c             |  2 +-
> - tests/gd2/CMakeLists.txt |  1 +
> - tests/gd2/Makemodule.am  |  1 +
> - tests/gd2/bug_289.c      | 33 +++++++++++++++++++++++++++++++++
> - 4 files changed, 36 insertions(+), 1 deletion(-)
> - create mode 100644 tests/gd2/bug_289.c
> -
> -diff --git a/src/gd_gd2.c b/src/gd_gd2.c
> -index 86c881e..75e5e1f 100644
> ---- a/src/gd_gd2.c
> -+++ b/src/gd_gd2.c
> -@@ -918,7 +918,7 @@ _gdImageGd2 (gdImagePtr im, gdIOCtx * out, int cs, int fmt)
> - 	/* Force fmt to a valid value since we don't return anything. */
> - 	/* */
> - 	if ((fmt != GD2_FMT_RAW) && (fmt != GD2_FMT_COMPRESSED)) {
> --		fmt = im->trueColor ? GD2_FMT_TRUECOLOR_COMPRESSED : GD2_FMT_COMPRESSED;
> -+		fmt = GD2_FMT_COMPRESSED;
> - 	};
> - 	if (im->trueColor) {
> - 		fmt += 2;
> -diff --git a/tests/gd2/CMakeLists.txt b/tests/gd2/CMakeLists.txt
> -index 8aecacc..3b650ad 100644
> ---- a/tests/gd2/CMakeLists.txt
> -+++ b/tests/gd2/CMakeLists.txt
> -@@ -1,4 +1,5 @@
> - SET(TESTS_FILES
> -+	bug_289
> - 	gd2_empty_file
> - 	gd2_im2im
> - 	gd2_null
> -diff --git a/tests/gd2/Makemodule.am b/tests/gd2/Makemodule.am
> -index 754a284..b8ee946 100644
> ---- a/tests/gd2/Makemodule.am
> -+++ b/tests/gd2/Makemodule.am
> -@@ -1,4 +1,5 @@
> - libgd_test_programs += \
> -+	gd2/bug_289 \
> - 	gd2/gd2_empty_file \
> - 	gd2/php_bug_72339 \
> - 	gd2/gd2_read_corrupt
> -diff --git a/tests/gd2/bug_289.c b/tests/gd2/bug_289.c
> -new file mode 100644
> -index 0000000..ad311e9
> ---- /dev/null
> -+++ b/tests/gd2/bug_289.c
> -@@ -0,0 +1,33 @@
> -+/**
> -+ * Passing an unrecognized format to gdImageGd2() should result in
> -+ * GD2_FMT_TRUECOLOR_COMPRESSED for truecolor images.
> -+ *
> -+ * See <https://github.com/libgd/libgd/issues/289>.
> -+ */
> -+
> -+#include "gd.h"
> -+#include "gdtest.h"
> -+
> -+
> -+#define GD2_FMT_UNRECOGNIZED 0
> -+#define GD2_FMT_TRUECOLOR_COMPRESSED 4
> -+
> -+#define MSG "expected %s byte to be %d, but got %d\n"
> -+
> -+
> -+int main()
> -+{
> -+    gdImagePtr im;
> -+    char *buffer;
> -+    int size;
> -+
> -+    im = gdImageCreateTrueColor(10, 10);
> -+    gdTestAssert(im != NULL);
> -+    buffer = (char *) gdImageGd2Ptr(im, 128, GD2_FMT_UNRECOGNIZED, &size);
> -+    gdTestAssert(buffer != NULL);
> -+    gdImageDestroy(im);
> -+    gdTestAssertMsg(buffer[12] == 0, MSG, "1st", 0, buffer[12]);
> -+    gdTestAssertMsg(buffer[13] == GD2_FMT_TRUECOLOR_COMPRESSED, MSG, "2nd", GD2_FMT_TRUECOLOR_COMPRESSED, buffer[13]);
> -+
> -+    return gdNumFailures();
> -+}
> diff --git a/gnu/packages/php.scm b/gnu/packages/php.scm
> index 16b0985..0dfee36 100644
> --- a/gnu/packages/php.scm
> +++ b/gnu/packages/php.scm
> @@ -50,21 +50,10 @@
>    #:use-module (guix build-system gnu)
>    #:use-module ((guix licenses) #:prefix license:))
>  
> -;; This fixes PHP bugs 73155 and 73159. Remove when gd
> -;; is updated to > 2.2.3.
> -(define gd-for-php
> -  (package (inherit gd)
> -           (source
> -            (origin
> -              (inherit (package-source gd))
> -              (patches (search-patches
> -                        "gd-fix-truecolor-format-correction.patch"
> -                        "gd-fix-chunk-size-on-boundaries.patch"))))))
> -
>  (define-public php
>    (package
>      (name "php")
> -    (version "7.0.14")
> +    (version "7.1.2")
>      (home-page "https://secure.php.net/")
>      (source (origin
>                (method url-fetch)
> @@ -72,7 +61,7 @@
>                                    name "-" version ".tar.xz"))
>                (sha256
>                 (base32
> -                "12ccgbrfchgvmcfb88rcknq7xmrf19c5ysdr4v8jxk51j9izy78g"))
> +                "0wg9ng230w724rpwsrhcg4pw41xm1xhz0zx76haanyymkz1s05fq"))
>                (modules '((guix build utils)))
>                (snippet
>                 '(with-directory-excursion "ext"
> @@ -179,6 +168,13 @@
>                              "ext/standard/tests/general_functions/bug44667.phpt"
>                              "ext/standard/tests/general_functions/proc_open.phpt")
>                 (("/bin/cat") (which "cat")))
> +
> +             ;; These tests fail because they include a file whose modification
> +             ;; time is 0. Touch them to make the test pass. The issue is reported
> +             ;; upstream as #74137.
> +             (utime "sapi/phpdbg/tests/include.inc" 1 1)
> +             (utime "sapi/phpdbg/tests/phpdbg_get_executable_stream_wrapper.inc" 1 1)
> +
>               ;; The encoding of this file is not recognized, so we simply drop it.
>               (delete-file "ext/mbstring/tests/mb_send_mail07.phpt")
>  
> @@ -257,8 +253,10 @@
>                           ;; The test expects an Array, but instead get the contents(?).
>                           "ext/gd/tests/bug43073.phpt"
>                           ;; imagettftext() returns wrong coordinates.
> +                         "ext/gd/tests/bug48732-mb.phpt"
>                           "ext/gd/tests/bug48732.phpt"
>                           ;; Similarly for imageftbbox().
> +                         "ext/gd/tests/bug48801-mb.phpt"
>                           "ext/gd/tests/bug48801.phpt"
>                           ;; Different expected output from imagecolorallocate().
>                           "ext/gd/tests/bug53504.phpt"
> @@ -291,10 +289,11 @@
>         ("curl" ,curl)
>         ("cyrus-sasl" ,cyrus-sasl)
>         ("freetype" ,freetype)
> -       ("gd" ,gd-for-php)
> +       ("gd" ,gd)
>         ("gdbm" ,gdbm)
>         ("glibc" ,glibc)
>         ("gmp" ,gmp)
> +       ("gnutls" ,gnutls)
>         ("libgcrypt" ,libgcrypt)
>         ("libjpeg" ,libjpeg)
>         ("libpng" ,libpng)
> -- 
> 2.7.4

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: PHP on core-updates
  2017-03-02 16:37 ` julien lepiller
  2017-03-02 16:55   ` Marius Bakke
@ 2017-03-02 17:17   ` Leo Famulari
  1 sibling, 0 replies; 13+ messages in thread
From: Leo Famulari @ 2017-03-02 17:17 UTC (permalink / raw)
  To: julien lepiller; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1589 bytes --]

On Thu, Mar 02, 2017 at 05:37:07PM +0100, julien lepiller wrote:
> From 10ab0fc95f83dbb291179cbf525d4bef196a827f Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien@lepiller.eu>
> Date: Mon, 27 Feb 2017 11:09:11 +0100
> Subject: [PATCH 2/3] gnu: gd: Fix an issue with XBM decoding.
> 
> * gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch: New file.
> * gnu/local.scm (dist_patch_DATA): Add it.
> * gnu/packages/gd.scm (gd)[source]: Use it.

> diff --git a/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch b/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch
> new file mode 100644
> index 0000000..c5c5022
> --- /dev/null
> +++ b/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch
> @@ -0,0 +1,117 @@

Please include the actual link to the upstream commit:

https://github.com/libgd/libgd/commit/082c5444838ea0d84f9fb6441aefdb44d78d9bba

Including the link makes it *much* easier to review 3rd-party patches,
whether are being submitted, or when we are trying to review them after
they've been added (for example, when checking if an upstream update
makes the patch redundant). Consider it a requirement if the upstream
source control system makes it possible :)

> +This bug was first reported to php on https://bugs.php.net/bug.php?id=73968.
> +php then reported it to gd in https://github.com/libgd/libgd/issues/109. This
> +patch is taken from commit 082c5444838ea0d84f9fb6441aefdb44d78d9bba of gd.
> +Binary files have been removed from the patch because our patch procedure
> +doesn't support that format.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: PHP on core-updates
  2017-03-02 16:55   ` Marius Bakke
@ 2017-03-02 17:18     ` Leo Famulari
  2017-03-03  9:28       ` julien lepiller
  0 siblings, 1 reply; 13+ messages in thread
From: Leo Famulari @ 2017-03-02 17:18 UTC (permalink / raw)
  To: Marius Bakke; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1185 bytes --]

On Thu, Mar 02, 2017 at 05:55:30PM +0100, Marius Bakke wrote:
> julien lepiller <julien@lepiller.eu> writes:
> 
> > Le 2017-03-01 16:34, julien lepiller a écrit :
> >> I've "fixed" the glib failure by disabling a test. Attached are
> >> patches I would like to see in core-updates. If it's too late to add
> >> the patch for gd, then I would like to keep gd-for-php. This time I've
> >> tested them and php works.
> >
> > A better version of those patches. I still don't know why glib tests 
> > hang. I had to add gnutls as an input because otherwise the build 
> > doesn't find "-lgnutls". There's no problem with the same php version on 
> > master, so I guess a dependency doesn't propagate gnutls anymore.
> 
> Ok, thanks for the update! The latter two patches LGTM for
> 'core-updates'. I would hold the glib patch until we understand what's
> going on, I am not able to reproduce it.
> 
> Please also update the commit message of the PHP patch to mention the
> new inputs and arguments change, as well as the removal of the
> "gd-for-php" variable.

+1

Please add the link to the upstream commit in the XBM patch, as
requested in my previous message.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: PHP on core-updates
  2017-03-02 17:18     ` Leo Famulari
@ 2017-03-03  9:28       ` julien lepiller
  2017-03-03 19:31         ` Leo Famulari
  0 siblings, 1 reply; 13+ messages in thread
From: julien lepiller @ 2017-03-03  9:28 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1331 bytes --]

Le 2017-03-02 18:18, Leo Famulari a écrit :
> On Thu, Mar 02, 2017 at 05:55:30PM +0100, Marius Bakke wrote:
>> julien lepiller <julien@lepiller.eu> writes:
>> 
>> > Le 2017-03-01 16:34, julien lepiller a écrit :
>> >> I've "fixed" the glib failure by disabling a test. Attached are
>> >> patches I would like to see in core-updates. If it's too late to add
>> >> the patch for gd, then I would like to keep gd-for-php. This time I've
>> >> tested them and php works.
>> >
>> > A better version of those patches. I still don't know why glib tests
>> > hang. I had to add gnutls as an input because otherwise the build
>> > doesn't find "-lgnutls". There's no problem with the same php version on
>> > master, so I guess a dependency doesn't propagate gnutls anymore.
>> 
>> Ok, thanks for the update! The latter two patches LGTM for
>> 'core-updates'. I would hold the glib patch until we understand what's
>> going on, I am not able to reproduce it.
>> 
>> Please also update the commit message of the PHP patch to mention the
>> new inputs and arguments change, as well as the removal of the
>> "gd-for-php" variable.
> 
> +1
> 
> Please add the link to the upstream commit in the XBM patch, as
> requested in my previous message.

I think they are good now. How could I investigate glib's failure?

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-gd-Fix-an-issue-with-XBM-decoding.patch --]
[-- Type: text/x-diff; name=0001-gnu-gd-Fix-an-issue-with-XBM-decoding.patch, Size: 5954 bytes --]

From c6bede4feb365304d0cce71445070aa342d9db4d Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Mon, 27 Feb 2017 11:09:11 +0100
Subject: [PATCH 1/2] gnu: gd: Fix an issue with XBM decoding.

* gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch: New file.
* gnu/local.scm (dist_patch_DATA): Add it.
* gnu/packages/gd.scm (gd)[source]: Use it.
---
 gnu/local.mk                                       |   1 +
 gnu/packages/gd.scm                                |   3 +-
 .../patches/gd-php-73968-Fix-109-XBM-reading.patch | 119 +++++++++++++++++++++
 3 files changed, 122 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index abb1b04..5765a3f 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -583,6 +583,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/gd-fix-tests-on-i686.patch		\
   %D%/packages/patches/gd-fix-truecolor-format-correction.patch	\
   %D%/packages/patches/gd-freetype-test-failure.patch		\
+  %D%/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch		\
   %D%/packages/patches/gegl-CVE-2012-4433.patch			\
   %D%/packages/patches/geoclue-config.patch			\
   %D%/packages/patches/ghc-dont-pass-linker-flags-via-response-files.patch	\
diff --git a/gnu/packages/gd.scm b/gnu/packages/gd.scm
index ea13540..62c8fd8 100644
--- a/gnu/packages/gd.scm
+++ b/gnu/packages/gd.scm
@@ -53,7 +53,8 @@
                "1rp4v7n1dq38b92kl7gkvpvqqkw7nvdfnz6d5kip5klkxfki6zqk"))
              (patches (search-patches "gd-fix-gd2-read-test.patch"
                                       "gd-fix-tests-on-i686.patch"
-                                      "gd-freetype-test-failure.patch"))))
+                                      "gd-freetype-test-failure.patch"
+                                      "gd-php-73968-Fix-109-XBM-reading.patch"))))
     (build-system gnu-build-system)
     (arguments
       ;; As recommended by github.com/libgd/libgd/issues/278 to fix rounding
diff --git a/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch b/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch
new file mode 100644
index 0000000..2e64092
--- /dev/null
+++ b/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch
@@ -0,0 +1,119 @@
+This bug was first reported to php on https://bugs.php.net/bug.php?id=73968.
+php then reported it to gd in https://github.com/libgd/libgd/issues/109. This
+patch is taken from commit:
+https://github.com/libgd/libgd/commit/082c5444838ea0d84f9fb6441aefdb44d78d9bba
+
+Binary files have been removed from the patch because our patch procedure
+doesn't support that format.
+
+From 082c5444838ea0d84f9fb6441aefdb44d78d9bba Mon Sep 17 00:00:00 2001
+From: "Christoph M. Becker" <cmbecker69@gmx.de>
+Date: Fri, 20 Jan 2017 22:48:20 +0100
+Subject: [PATCH] Fix #109: XBM reading fails with printed error
+
+When calculating the number of required bytes of an XBM image, we have
+to take the line padding into account.
+---
+ src/gd_xbm.c                     |   2 +-
+ tests/xbm/CMakeLists.txt         |   1 +
+ tests/xbm/Makemodule.am          |   5 ++++-
+ tests/xbm/github_bug_109.c       |  35 +++++++++++++++++++++++++++++++++++
+ tests/xbm/github_bug_109.xbm     |   5 +++++
+ 5 files changed, 47 insertions(+), 2 deletions(-)
+ create mode 100644 tests/xbm/github_bug_109.c
+ create mode 100644 tests/xbm/github_bug_109.xbm
+ create mode 100644 tests/xbm/github_bug_109_exp.png
+
+diff --git a/src/gd_xbm.c b/src/gd_xbm.c
+index 5f09b56..c2ba2ad 100644
+--- a/src/gd_xbm.c
++++ b/src/gd_xbm.c
+@@ -108,7 +108,7 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFromXbm(FILE * fd)
+ 				max_bit = 32768;
+ 			}
+ 			if (max_bit) {
+-				bytes = (width * height / 8) + 1;
++                bytes = (width + 7) / 8 * height;
+ 				if (!bytes) {
+ 					return 0;
+ 				}
+diff --git a/tests/xbm/CMakeLists.txt b/tests/xbm/CMakeLists.txt
+index 183cf5e..08576e0 100644
+--- a/tests/xbm/CMakeLists.txt
++++ b/tests/xbm/CMakeLists.txt
+@@ -1,4 +1,5 @@
+ LIST(APPEND TESTS_FILES
++	github_bug_109
+ 	github_bug_170
+ )
+ 
+diff --git a/tests/xbm/Makemodule.am b/tests/xbm/Makemodule.am
+index ba1eabd..0f5beb6 100644
+--- a/tests/xbm/Makemodule.am
++++ b/tests/xbm/Makemodule.am
+@@ -1,5 +1,8 @@
+ libgd_test_programs += \
++	xbm/github_bug_109 \
+ 	xbm/github_bug_170
+ 
+ EXTRA_DIST += \
+-	xbm/CMakeLists.txt
++	xbm/CMakeLists.txt \
++	xbm/github_bug_109.xbm \
++	xbm/github_bug_109_exp.png
+diff --git a/tests/xbm/github_bug_109.c b/tests/xbm/github_bug_109.c
+new file mode 100644
+index 0000000..1a020c6
+--- /dev/null
++++ b/tests/xbm/github_bug_109.c
+@@ -0,0 +1,35 @@
++/**
++ * Test reading of XBM images with a width that is not a multiple of 8
++ *
++ * We're reading such an XBM image, and check that we got what we've expected,
++ * instead of an error message.
++ *
++ * See also <https://github.com/libgd/libgd/issues/109>.
++ */
++
++
++#include "gd.h"
++#include "gdtest.h"
++
++
++int main()
++{
++    gdImagePtr im;
++    FILE *fp;
++    char *path;
++
++    fp = gdTestFileOpen2("xbm", "github_bug_109.xbm");
++    im = gdImageCreateFromXbm(fp);
++    fclose(fp);
++    gdTestAssert(im != NULL);
++    gdTestAssert(gdImageGetTrueColorPixel(im, 0, 0) == 0);
++    gdTestAssert(gdImageGetTrueColorPixel(im, 0, 1) == 0xffffff);
++
++    path = gdTestFilePath2("xbm", "github_bug_109_exp.png");
++    gdAssertImageEqualsToFile(path, im);
++    gdFree(path);
++
++    gdImageDestroy(im);
++
++    return gdNumFailures();
++}
+diff --git a/tests/xbm/github_bug_109.xbm b/tests/xbm/github_bug_109.xbm
+new file mode 100644
+index 0000000..f427d86
+--- /dev/null
++++ b/tests/xbm/github_bug_109.xbm
+@@ -0,0 +1,5 @@
++#define test_width 10
++#define test_height 10
++static unsigned char test_bits[] = {
++  0xFF, 0x03, 0x00, 0x00, 0xFF, 0x03, 0x00, 0x00, 0xFF, 0x03, 0x00, 0x00, 
++  0xFF, 0x03, 0x00, 0x00, 0xFF, 0x03, 0x00, 0x00};
+
+-- 
+2.7.4
+
-- 
2.7.4


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-gnu-php-Update-to-7.1.2.patch --]
[-- Type: text/x-diff; name=0002-gnu-php-Update-to-7.1.2.patch, Size: 11255 bytes --]

From ebe4eb669f1cf4a87a961452425513a3185becbe Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Mon, 27 Feb 2017 11:15:29 +0100
Subject: [PATCH 2/2] gnu: php: Update to 7.1.2.

* gnu/packages/php.scm (php): Update to 7.1.2.
[inputs]: Add gnutls.
(gd-for-php): Remove variable.
* gnu/packages/patches/gd-fix-chunk-size-on-boundaries.patch: Remove file.
* gnu/packages/patches/*gd-fix-truecolor-format-correction.patch: Remove file.
* gnu/local.mk (dist_patch_DATA): Remove them.
---
 gnu/local.mk                                       |   2 -
 .../patches/gd-fix-chunk-size-on-boundaries.patch  | 102 ---------------------
 .../gd-fix-truecolor-format-correction.patch       |  95 -------------------
 gnu/packages/php.scm                               |  27 +++---
 4 files changed, 13 insertions(+), 213 deletions(-)
 delete mode 100644 gnu/packages/patches/gd-fix-chunk-size-on-boundaries.patch
 delete mode 100644 gnu/packages/patches/gd-fix-truecolor-format-correction.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 5765a3f..e4114be 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -578,10 +578,8 @@ dist_patch_DATA =						\
   %D%/packages/patches/gcc-6-cross-environment-variables.patch	\
   %D%/packages/patches/gcj-arm-mode.patch			\
   %D%/packages/patches/gdk-pixbuf-list-dir.patch		\
-  %D%/packages/patches/gd-fix-chunk-size-on-boundaries.patch	\
   %D%/packages/patches/gd-fix-gd2-read-test.patch		\
   %D%/packages/patches/gd-fix-tests-on-i686.patch		\
-  %D%/packages/patches/gd-fix-truecolor-format-correction.patch	\
   %D%/packages/patches/gd-freetype-test-failure.patch		\
   %D%/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch		\
   %D%/packages/patches/gegl-CVE-2012-4433.patch			\
diff --git a/gnu/packages/patches/gd-fix-chunk-size-on-boundaries.patch b/gnu/packages/patches/gd-fix-chunk-size-on-boundaries.patch
deleted file mode 100644
index e395c66..0000000
--- a/gnu/packages/patches/gd-fix-chunk-size-on-boundaries.patch
+++ /dev/null
@@ -1,102 +0,0 @@
-This fixes PHP bug #73155: https://bugs.php.net/bug.php?id=73155
-
-Patch adapted from upstream source repository:
-
-https://github.com/libgd/libgd/commit/8067a8ac336dfe0acbe96ec2eb24572209a7f279
-
-(.gitignore change removed)
-
-From 8067a8ac336dfe0acbe96ec2eb24572209a7f279 Mon Sep 17 00:00:00 2001
-From: "Christoph M. Becker" <cmbecker69@gmx.de>
-Date: Fri, 23 Sep 2016 18:29:52 +0200
-Subject: [PATCH] Fix #309: gdImageGd2() writes wrong chunk sizes on boundaries
-
-(cherry picked from commit bb1998a16e30d542ab22eba5501911a9aa066edb)
----
- src/gd_gd2.c             |  4 ++--
- tests/gd2/CMakeLists.txt |  1 +
- tests/gd2/Makemodule.am  |  1 +
- tests/gd2/bug00309.c     | 37 +++++++++++++++++++++++++++++++++++++
- 4 files changed, 41 insertions(+), 2 deletions(-)
- create mode 100644 tests/gd2/bug00309.c
-
-diff --git a/src/gd_gd2.c b/src/gd_gd2.c
-index 75e5e1f..b9b2f93 100644
---- a/src/gd_gd2.c
-+++ b/src/gd_gd2.c
-@@ -938,8 +938,8 @@ _gdImageGd2 (gdImagePtr im, gdIOCtx * out, int cs, int fmt)
- 	};
- 
- 	/* Work out number of chunks. */
--	ncx = im->sx / cs + 1;
--	ncy = im->sy / cs + 1;
-+	ncx = (im->sx + cs - 1) / cs;
-+	ncy = (im->sy + cs - 1) / cs;
- 
- 	/* Write the standard header. */
- 	_gd2PutHeader (im, out, cs, fmt, ncx, ncy);
-diff --git a/tests/gd2/CMakeLists.txt b/tests/gd2/CMakeLists.txt
-index 3b650ad..247b466 100644
---- a/tests/gd2/CMakeLists.txt
-+++ b/tests/gd2/CMakeLists.txt
-@@ -1,5 +1,6 @@
- SET(TESTS_FILES
- 	bug_289
-+	bug00309
- 	gd2_empty_file
- 	gd2_im2im
- 	gd2_null
-diff --git a/tests/gd2/Makemodule.am b/tests/gd2/Makemodule.am
-index b8ee946..d69aee0 100644
---- a/tests/gd2/Makemodule.am
-+++ b/tests/gd2/Makemodule.am
-@@ -1,5 +1,6 @@
- libgd_test_programs += \
- 	gd2/bug_289 \
-+	gd2/bug00309 \
- 	gd2/gd2_empty_file \
- 	gd2/php_bug_72339 \
- 	gd2/gd2_read_corrupt
-diff --git a/tests/gd2/bug00309.c b/tests/gd2/bug00309.c
-new file mode 100644
-index 0000000..b649cdc
---- /dev/null
-+++ b/tests/gd2/bug00309.c
-@@ -0,0 +1,37 @@
-+/**
-+ * Regression test for <https://github.com/libgd/libgd/issues/309>.
-+ *
-+ * We test that an image with 64x64 pixels reports only a single chunk in the
-+ * GD2 image header when the chunk size is 64.
-+ */
-+
-+
-+#include "gd.h"
-+#include "gdtest.h"
-+
-+
-+int main()
-+{
-+    gdImagePtr im;
-+    unsigned char *buf;
-+    int size, word;
-+
-+    im = gdImageCreate(64, 64);
-+    gdImageColorAllocate(im, 0, 0, 0);
-+
-+    buf = gdImageGd2Ptr(im, 64, 1, &size);
-+
-+    gdImageDestroy(im);
-+
-+    word = buf[10] << 8 | buf[11];
-+    gdTestAssertMsg(word == 64, "chunk size is %d, but expected 64\n", word);
-+    word = buf[14] << 8 | buf[15];
-+    gdTestAssertMsg(word == 1, "x chunk count is %d, but expected 1\n", word);
-+    word = buf[16] << 8 | buf[17];
-+    gdTestAssertMsg(word == 1, "y chunk count is %d, but expected 1\n", word);
-+    gdTestAssertMsg(size == 5145, "file size is %d, but expected 5145\n", size);
-+
-+    gdFree(buf);
-+
-+    return gdNumFailures();
-+}
diff --git a/gnu/packages/patches/gd-fix-truecolor-format-correction.patch b/gnu/packages/patches/gd-fix-truecolor-format-correction.patch
deleted file mode 100644
index be3eff9..0000000
--- a/gnu/packages/patches/gd-fix-truecolor-format-correction.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-This fixes PHP bug #73159: https://bugs.php.net/bug.php?id=73159
-
-Patch lifted from upstream source repository:
-
-https://github.com/libgd/libgd/commit/e1f61a4141d2e0937a13b8bfb1992b9f29eb05f5
-
-From e1f61a4141d2e0937a13b8bfb1992b9f29eb05f5 Mon Sep 17 00:00:00 2001
-From: "Christoph M. Becker" <cmbecker69@gmx.de>
-Date: Mon, 15 Aug 2016 17:49:40 +0200
-Subject: [PATCH] Fix #289: Passing unrecognized formats to gdImageGd2 results
- in corrupted files
-
-We must not apply the format correction twice for truecolor images.
-
-(cherry picked from commit 09090c125658e23a4ae2a2e002646bb7278bd89e)
----
- src/gd_gd2.c             |  2 +-
- tests/gd2/CMakeLists.txt |  1 +
- tests/gd2/Makemodule.am  |  1 +
- tests/gd2/bug_289.c      | 33 +++++++++++++++++++++++++++++++++
- 4 files changed, 36 insertions(+), 1 deletion(-)
- create mode 100644 tests/gd2/bug_289.c
-
-diff --git a/src/gd_gd2.c b/src/gd_gd2.c
-index 86c881e..75e5e1f 100644
---- a/src/gd_gd2.c
-+++ b/src/gd_gd2.c
-@@ -918,7 +918,7 @@ _gdImageGd2 (gdImagePtr im, gdIOCtx * out, int cs, int fmt)
- 	/* Force fmt to a valid value since we don't return anything. */
- 	/* */
- 	if ((fmt != GD2_FMT_RAW) && (fmt != GD2_FMT_COMPRESSED)) {
--		fmt = im->trueColor ? GD2_FMT_TRUECOLOR_COMPRESSED : GD2_FMT_COMPRESSED;
-+		fmt = GD2_FMT_COMPRESSED;
- 	};
- 	if (im->trueColor) {
- 		fmt += 2;
-diff --git a/tests/gd2/CMakeLists.txt b/tests/gd2/CMakeLists.txt
-index 8aecacc..3b650ad 100644
---- a/tests/gd2/CMakeLists.txt
-+++ b/tests/gd2/CMakeLists.txt
-@@ -1,4 +1,5 @@
- SET(TESTS_FILES
-+	bug_289
- 	gd2_empty_file
- 	gd2_im2im
- 	gd2_null
-diff --git a/tests/gd2/Makemodule.am b/tests/gd2/Makemodule.am
-index 754a284..b8ee946 100644
---- a/tests/gd2/Makemodule.am
-+++ b/tests/gd2/Makemodule.am
-@@ -1,4 +1,5 @@
- libgd_test_programs += \
-+	gd2/bug_289 \
- 	gd2/gd2_empty_file \
- 	gd2/php_bug_72339 \
- 	gd2/gd2_read_corrupt
-diff --git a/tests/gd2/bug_289.c b/tests/gd2/bug_289.c
-new file mode 100644
-index 0000000..ad311e9
---- /dev/null
-+++ b/tests/gd2/bug_289.c
-@@ -0,0 +1,33 @@
-+/**
-+ * Passing an unrecognized format to gdImageGd2() should result in
-+ * GD2_FMT_TRUECOLOR_COMPRESSED for truecolor images.
-+ *
-+ * See <https://github.com/libgd/libgd/issues/289>.
-+ */
-+
-+#include "gd.h"
-+#include "gdtest.h"
-+
-+
-+#define GD2_FMT_UNRECOGNIZED 0
-+#define GD2_FMT_TRUECOLOR_COMPRESSED 4
-+
-+#define MSG "expected %s byte to be %d, but got %d\n"
-+
-+
-+int main()
-+{
-+    gdImagePtr im;
-+    char *buffer;
-+    int size;
-+
-+    im = gdImageCreateTrueColor(10, 10);
-+    gdTestAssert(im != NULL);
-+    buffer = (char *) gdImageGd2Ptr(im, 128, GD2_FMT_UNRECOGNIZED, &size);
-+    gdTestAssert(buffer != NULL);
-+    gdImageDestroy(im);
-+    gdTestAssertMsg(buffer[12] == 0, MSG, "1st", 0, buffer[12]);
-+    gdTestAssertMsg(buffer[13] == GD2_FMT_TRUECOLOR_COMPRESSED, MSG, "2nd", GD2_FMT_TRUECOLOR_COMPRESSED, buffer[13]);
-+
-+    return gdNumFailures();
-+}
diff --git a/gnu/packages/php.scm b/gnu/packages/php.scm
index 16b0985..0dfee36 100644
--- a/gnu/packages/php.scm
+++ b/gnu/packages/php.scm
@@ -50,21 +50,10 @@
   #:use-module (guix build-system gnu)
   #:use-module ((guix licenses) #:prefix license:))
 
-;; This fixes PHP bugs 73155 and 73159. Remove when gd
-;; is updated to > 2.2.3.
-(define gd-for-php
-  (package (inherit gd)
-           (source
-            (origin
-              (inherit (package-source gd))
-              (patches (search-patches
-                        "gd-fix-truecolor-format-correction.patch"
-                        "gd-fix-chunk-size-on-boundaries.patch"))))))
-
 (define-public php
   (package
     (name "php")
-    (version "7.0.14")
+    (version "7.1.2")
     (home-page "https://secure.php.net/")
     (source (origin
               (method url-fetch)
@@ -72,7 +61,7 @@
                                   name "-" version ".tar.xz"))
               (sha256
                (base32
-                "12ccgbrfchgvmcfb88rcknq7xmrf19c5ysdr4v8jxk51j9izy78g"))
+                "0wg9ng230w724rpwsrhcg4pw41xm1xhz0zx76haanyymkz1s05fq"))
               (modules '((guix build utils)))
               (snippet
                '(with-directory-excursion "ext"
@@ -179,6 +168,13 @@
                             "ext/standard/tests/general_functions/bug44667.phpt"
                             "ext/standard/tests/general_functions/proc_open.phpt")
                (("/bin/cat") (which "cat")))
+
+             ;; These tests fail because they include a file whose modification
+             ;; time is 0. Touch them to make the test pass. The issue is reported
+             ;; upstream as #74137.
+             (utime "sapi/phpdbg/tests/include.inc" 1 1)
+             (utime "sapi/phpdbg/tests/phpdbg_get_executable_stream_wrapper.inc" 1 1)
+
              ;; The encoding of this file is not recognized, so we simply drop it.
              (delete-file "ext/mbstring/tests/mb_send_mail07.phpt")
 
@@ -257,8 +253,10 @@
                          ;; The test expects an Array, but instead get the contents(?).
                          "ext/gd/tests/bug43073.phpt"
                          ;; imagettftext() returns wrong coordinates.
+                         "ext/gd/tests/bug48732-mb.phpt"
                          "ext/gd/tests/bug48732.phpt"
                          ;; Similarly for imageftbbox().
+                         "ext/gd/tests/bug48801-mb.phpt"
                          "ext/gd/tests/bug48801.phpt"
                          ;; Different expected output from imagecolorallocate().
                          "ext/gd/tests/bug53504.phpt"
@@ -291,10 +289,11 @@
        ("curl" ,curl)
        ("cyrus-sasl" ,cyrus-sasl)
        ("freetype" ,freetype)
-       ("gd" ,gd-for-php)
+       ("gd" ,gd)
        ("gdbm" ,gdbm)
        ("glibc" ,glibc)
        ("gmp" ,gmp)
+       ("gnutls" ,gnutls)
        ("libgcrypt" ,libgcrypt)
        ("libjpeg" ,libjpeg)
        ("libpng" ,libpng)
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: PHP on core-updates
  2017-03-03  9:28       ` julien lepiller
@ 2017-03-03 19:31         ` Leo Famulari
  0 siblings, 0 replies; 13+ messages in thread
From: Leo Famulari @ 2017-03-03 19:31 UTC (permalink / raw)
  To: julien lepiller; +Cc: guix-devel

On Fri, Mar 03, 2017 at 10:28:55AM +0100, julien lepiller wrote:
> I think they are good now. How could I investigate glib's failure?

I typically investigate hangs by attaching to the guix-daemon as root
with `strace -f -p $(pgrep guix-daemon | head -n1)` to see what it's
doing.

The output is extremely verbose, but it usually helps me figure out the
problem.

> From c6bede4feb365304d0cce71445070aa342d9db4d Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien@lepiller.eu>
> Date: Mon, 27 Feb 2017 11:09:11 +0100
> Subject: [PATCH 1/2] gnu: gd: Fix an issue with XBM decoding.
> 
> * gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch: New file.
> * gnu/local.scm (dist_patch_DATA): Add it.
> * gnu/packages/gd.scm (gd)[source]: Use it.

> From ebe4eb669f1cf4a87a961452425513a3185becbe Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien@lepiller.eu>
> Date: Mon, 27 Feb 2017 11:15:29 +0100
> Subject: [PATCH 2/2] gnu: php: Update to 7.1.2.
> 
> * gnu/packages/php.scm (php): Update to 7.1.2.
> [inputs]: Add gnutls.
> (gd-for-php): Remove variable.
> * gnu/packages/patches/gd-fix-chunk-size-on-boundaries.patch: Remove file.
> * gnu/packages/patches/*gd-fix-truecolor-format-correction.patch: Remove file.
> * gnu/local.mk (dist_patch_DATA): Remove them.

Pushed to core-updates!

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-03-03 19:31 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-26 20:46 PHP on core-updates Leo Famulari
2017-02-27 10:24 ` julien lepiller
     [not found]   ` <20170227210958.GB3643@jasmine>
2017-02-28  8:03     ` Julien Lepiller
  -- strict thread matches above, loose matches on Subject: below --
2017-03-01 15:34 julien lepiller
2017-03-01 16:25 ` Marius Bakke
2017-03-01 17:09   ` Leo Famulari
2017-03-01 17:22 ` Leo Famulari
2017-03-02 16:37 ` julien lepiller
2017-03-02 16:55   ` Marius Bakke
2017-03-02 17:18     ` Leo Famulari
2017-03-03  9:28       ` julien lepiller
2017-03-03 19:31         ` Leo Famulari
2017-03-02 17:17   ` Leo Famulari

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).