From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marius Bakke Subject: Re: PHP on core-updates Date: Wed, 01 Mar 2017 17:25:46 +0100 Message-ID: <87zih5yned.fsf@kirby.i-did-not-set--mail-host-address--so-tickle-me> References: <2bee7b80c8191cfb12bd4346100f841f@lepiller.eu> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cj74b-0002yN-Up for guix-devel@gnu.org; Wed, 01 Mar 2017 11:25:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cj74Y-0001zf-EG for guix-devel@gnu.org; Wed, 01 Mar 2017 11:25:53 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:35673) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cj74Y-0001xN-9R for guix-devel@gnu.org; Wed, 01 Mar 2017 11:25:50 -0500 In-Reply-To: <2bee7b80c8191cfb12bd4346100f841f@lepiller.eu> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: julien lepiller , guix-devel@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable julien lepiller writes: > I've "fixed" the glib failure by disabling a test. Attached are patches=20 > I would like to see in core-updates. If it's too late to add the patch=20 > for gd, then I would like to keep gd-for-php. This time I've tested them= =20 > 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 > 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")) >=20=20 > + ("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'.=20 > + > ("glib/tests/timer.c" > (;; fails if compiler optimizations are enabled, w= hich they > ;; are by default. > --=20 > 2.7.4 > > From 0aa21c67381203d7dfec325fdc85303f5d3db76e Mon Sep 17 00:00:00 2001 > From: Julien Lepiller > 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 =3D \ > %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.pat= ch \ > 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" > +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 b= een > +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 =3D 32768; > + } > + if (max_bit) { > +- bytes =3D (width * height / 8) + 1; > ++ bytes =3D (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 +=3D \ > ++ xbm/github_bug_109 \ > + xbm/github_bug_170 > + > + EXTRA_DIST +=3D \ > +- 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 ex= pected, > ++ * instead of an error message. > ++ * > ++ * See also . > ++ */ > ++ > ++ > ++#include "gd.h" > ++#include "gdtest.h" > ++ > ++ > ++int main() > ++{ > ++ gdImagePtr im; > ++ FILE *fp; > ++ char *path; > ++ > ++ fp =3D gdTestFileOpen2("xbm", "github_bug_109.xbm"); > ++ im =3D gdImageCreateFromXbm(fp); > ++ fclose(fp); > ++ gdTestAssert(im !=3D NULL); > ++ gdTestAssert(gdImageGetTrueColorPixel(im, 0, 0) =3D=3D 0); > ++ gdTestAssert(gdImageGetTrueColorPixel(im, 0, 1) =3D=3D 0xffffff); > ++ > ++ path =3D 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[] =3D { > ++ 0xFF, 0x03, 0x00, 0x00, 0xFF, 0x03, 0x00, 0x00, 0xFF, 0x03, 0x00, 0x0= 0, > ++ 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 > 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 printe= d error > When calculating the number of required bytes of an XBM image, we have > to take the line padding into account. >=20=20 > -This patch has been taken from the gd repository and binary files have b= een > -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=3D= 73968. > +php then reported it to gd in https://github.com/libgd/libgd/issues/109.= This > +patch is taken from commit 082c5444838ea0d84f9fb6441aefdb44d78d9bba of g= d. > +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:)) >=20=20 > -;; 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/bug446= 67.phpt" > "ext/standard/tests/general_functions/proc_o= pen.phpt") > (("/bin/cat") (which "cat"))) > + > + ;; These tests fail because they include a file whose modif= ication > + ;; time is 0. Touch them to make the test pass. The issue i= s reported > + ;; upstream as #74137. > + (utime "sapi/phpdbg/tests/include.inc" 1 1) > + (utime "sapi/phpdbg/tests/phpdbg_get_executable_stream_wrap= per.inc" 1 1) > + > ;; The encoding of this file is not recognized, so we simpl= y drop it. > (delete-file "ext/mbstring/tests/mb_send_mail07.phpt") >=20=20 > @@ -257,8 +253,10 @@ > ;; The test expects an Array, but instead get t= he 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 imagecolorall= ocate(). > "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 separat= e 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 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAli29goACgkQoqBt8qM6 VPpxTwgAyXDNE9ErIw0bl7/r0l07w4zSfJrRaBP2aeStlfxto+fq182SxEdiRN2Q JQJELNFDH9vgndZyXlvW2GM6kUDfvhaV2VsC+pz6+bJRqia6NKFOktNKlfd3Lx0J tFdZGDgMX7s7padltlSNpYPFJxhrqNJRICgrguaeAbrpy+M6k1FynkkYdTZQvSNH LaT7XMUFM3//ONjqdDPQmVwkjsmVdLAD0U7AX+VQw2FGqGexbg91FvBUIQEcjfX4 wA1kA85NQYthxjSvy8wNzRXBOrfmkRad2xcbEQgxdJFSmSKNh0uxV72C4Q/I8pJE wFlaN6vMcn6e6dX5KVrDnS+IjM2lVw== =CSpF -----END PGP SIGNATURE----- --=-=-=--