[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#853071: unblock: symfony/2.8.7+dfsg-1.1



Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

Please unblock package symfony

This fixes the RC bug #832858 (caused by PHP 7.0/7.1 changes), as well
as fixing the FTBFS when building in 2017 (and future years). Both are
backports of upstream patches. Debdiff attached.

unblock symfony/2.8.7+dfsg-1.1

-- System Information:
Debian Release: 9.0
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable'), (1, 'experimental-
debug'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
diff -Nru symfony-2.8.7+dfsg/debian/changelog symfony-2.8.7+dfsg/debian/changelog
--- symfony-2.8.7+dfsg/debian/changelog	2016-06-08 01:52:05.000000000 +0100
+++ symfony-2.8.7+dfsg/debian/changelog	2017-01-29 13:54:28.000000000 +0000
@@ -1,3 +1,12 @@
+symfony (2.8.7+dfsg-1.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix PHP 7.0/7.1 related failures (Closes: #832858)
+  * Do not depend on a fixed date in layout tests (fixes FTBFS in 2017 and
+    beyond)
+
+ -- James Clarke <jrtc27@debian.org>  Sun, 29 Jan 2017 13:54:28 +0000
+
 symfony (2.8.7+dfsg-1) unstable; urgency=medium
 
   [ Fabien Potencier ]
diff -Nru symfony-2.8.7+dfsg/debian/patches/do-not-depend-on-a-fixed-date-in-layout- symfony-2.8.7+dfsg/debian/patches/do-not-depend-on-a-fixed-date-in-layout-
--- symfony-2.8.7+dfsg/debian/patches/do-not-depend-on-a-fixed-date-in-layout-	1970-01-01 01:00:00.000000000 +0100
+++ symfony-2.8.7+dfsg/debian/patches/do-not-depend-on-a-fixed-date-in-layout-	2017-01-29 13:54:28.000000000 +0000
@@ -0,0 +1,163 @@
+From: Christian Flothmann <christian.flothmann@sensiolabs.de>
+Date: Sun, 1 Jan 2017 13:18:05 +0100
+X-Dgit-Generated: 2.8.7+dfsg-1.1 804ee09c5a98f4ff4ed1132b68bf4c4afa17facc
+Subject: Do not depend on a fixed date in layout tests
+
+By default, the `DateType` as well as the `DateTimeType` set the choices
+being available for the year to a range starting five years in the past.
+After some time, this will make tests fail when the year of the fixed
+date being used as the initial data is before the first year being part
+of the choices.
+
+Origin: backport, https://github.com/symfony/symfony/commit/97b7fabf519b48333b772924b141f84efdb44c1e
+
+---
+
+--- symfony-2.8.7+dfsg.orig/src/Symfony/Component/Form/Tests/AbstractBootstrap3LayoutTest.php
++++ symfony-2.8.7+dfsg/src/Symfony/Component/Form/Tests/AbstractBootstrap3LayoutTest.php
+@@ -1346,7 +1346,7 @@ abstract class AbstractBootstrap3LayoutT
+ 
+     public function testDateTime()
+     {
+-        $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', '2011-02-03 04:05:06', array(
++        $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', date('Y').'-02-03 04:05:06', array(
+             'input' => 'string',
+             'with_seconds' => false,
+         ));
+@@ -1365,7 +1365,7 @@ abstract class AbstractBootstrap3LayoutT
+         /following-sibling::select
+             [@id="name_date_year"]
+             [@class="form-control"]
+-            [./option[@value="2011"][@selected="selected"]]
++            [./option[@value="'.date('Y').'"][@selected="selected"]]
+         /following-sibling::select
+             [@id="name_time_hour"]
+             [@class="form-control"]
+@@ -1420,7 +1420,7 @@ abstract class AbstractBootstrap3LayoutT
+ 
+     public function testDateTimeWithHourAndMinute()
+     {
+-        $data = array('year' => '2011', 'month' => '2', 'day' => '3', 'hour' => '4', 'minute' => '5');
++        $data = array('year' => date('Y'), 'month' => '2', 'day' => '3', 'hour' => '4', 'minute' => '5');
+ 
+         $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', $data, array(
+             'input' => 'array',
+@@ -1442,7 +1442,7 @@ abstract class AbstractBootstrap3LayoutT
+         /following-sibling::select
+             [@id="name_date_year"]
+             [@class="form-control"]
+-            [./option[@value="2011"][@selected="selected"]]
++            [./option[@value="'.date('Y').'"][@selected="selected"]]
+         /following-sibling::select
+             [@id="name_time_hour"]
+             [@class="form-control"]
+@@ -1459,7 +1459,7 @@ abstract class AbstractBootstrap3LayoutT
+ 
+     public function testDateTimeWithSeconds()
+     {
+-        $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', '2011-02-03 04:05:06', array(
++        $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', date('Y').'-02-03 04:05:06', array(
+             'input' => 'string',
+             'with_seconds' => true,
+         ));
+@@ -1479,7 +1479,7 @@ abstract class AbstractBootstrap3LayoutT
+         /following-sibling::select
+             [@id="name_date_year"]
+             [@class="form-control"]
+-            [./option[@value="2011"][@selected="selected"]]
++            [./option[@value="'.date('Y').'"][@selected="selected"]]
+         /following-sibling::select
+             [@id="name_time_hour"]
+             [@class="form-control"]
+@@ -1569,7 +1569,7 @@ abstract class AbstractBootstrap3LayoutT
+ 
+     public function testDateChoice()
+     {
+-        $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateType', '2011-02-03', array(
++        $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateType', date('Y').'-02-03', array(
+             'input' => 'string',
+             'widget' => 'choice',
+         ));
+@@ -1589,7 +1589,7 @@ abstract class AbstractBootstrap3LayoutT
+         /following-sibling::select
+             [@id="name_year"]
+             [@class="form-control"]
+-            [./option[@value="2011"][@selected="selected"]]
++            [./option[@value="'.date('Y').'"][@selected="selected"]]
+     ]
+     [count(./select)=3]
+ '
+--- symfony-2.8.7+dfsg.orig/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php
++++ symfony-2.8.7+dfsg/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php
+@@ -1251,7 +1251,7 @@ abstract class AbstractLayoutTest extend
+ 
+     public function testDateTime()
+     {
+-        $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', '2011-02-03 04:05:06', array(
++        $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', date('Y').'-02-03 04:05:06', array(
+             'input' => 'string',
+             'with_seconds' => false,
+         ));
+@@ -1270,7 +1270,7 @@ abstract class AbstractLayoutTest extend
+                     [./option[@value="3"][@selected="selected"]]
+                 /following-sibling::select
+                     [@id="name_date_year"]
+-                    [./option[@value="2011"][@selected="selected"]]
++                    [./option[@value="'.date('Y').'"][@selected="selected"]]
+             ]
+         /following-sibling::div
+             [@id="name_time"]
+@@ -1330,7 +1330,7 @@ abstract class AbstractLayoutTest extend
+ 
+     public function testDateTimeWithHourAndMinute()
+     {
+-        $data = array('year' => '2011', 'month' => '2', 'day' => '3', 'hour' => '4', 'minute' => '5');
++        $data = array('year' => date('Y'), 'month' => '2', 'day' => '3', 'hour' => '4', 'minute' => '5');
+ 
+         $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', $data, array(
+             'input' => 'array',
+@@ -1351,7 +1351,7 @@ abstract class AbstractLayoutTest extend
+                     [./option[@value="3"][@selected="selected"]]
+                 /following-sibling::select
+                     [@id="name_date_year"]
+-                    [./option[@value="2011"][@selected="selected"]]
++                    [./option[@value="'.date('Y').'"][@selected="selected"]]
+             ]
+         /following-sibling::div
+             [@id="name_time"]
+@@ -1371,7 +1371,7 @@ abstract class AbstractLayoutTest extend
+ 
+     public function testDateTimeWithSeconds()
+     {
+-        $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', '2011-02-03 04:05:06', array(
++        $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', date('Y').'-02-03 04:05:06', array(
+             'input' => 'string',
+             'with_seconds' => true,
+         ));
+@@ -1390,7 +1390,7 @@ abstract class AbstractLayoutTest extend
+                     [./option[@value="3"][@selected="selected"]]
+                 /following-sibling::select
+                     [@id="name_date_year"]
+-                    [./option[@value="2011"][@selected="selected"]]
++                    [./option[@value="'.date('Y').'"][@selected="selected"]]
+             ]
+         /following-sibling::div
+             [@id="name_time"]
+@@ -1477,7 +1477,7 @@ abstract class AbstractLayoutTest extend
+ 
+     public function testDateChoice()
+     {
+-        $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateType', '2011-02-03', array(
++        $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateType', date('Y').'-02-03', array(
+             'input' => 'string',
+             'widget' => 'choice',
+         ));
+@@ -1493,7 +1493,7 @@ abstract class AbstractLayoutTest extend
+             [./option[@value="3"][@selected="selected"]]
+         /following-sibling::select
+             [@id="name_year"]
+-            [./option[@value="2011"][@selected="selected"]]
++            [./option[@value="'.date('Y').'"][@selected="selected"]]
+     ]
+     [count(./select)=3]
+ '
diff -Nru symfony-2.8.7+dfsg/debian/patches/fix-php-7.1-related-failures symfony-2.8.7+dfsg/debian/patches/fix-php-7.1-related-failures
--- symfony-2.8.7+dfsg/debian/patches/fix-php-7.1-related-failures	1970-01-01 01:00:00.000000000 +0100
+++ symfony-2.8.7+dfsg/debian/patches/fix-php-7.1-related-failures	2017-01-29 13:54:28.000000000 +0000
@@ -0,0 +1,125 @@
+From: Nicolas Grekas <nicolas.grekas@gmail.com>
+Date: Tue, 19 Jul 2016 08:52:31 +0200
+X-Dgit-Generated: 2.8.7+dfsg-1.1 d29b2011e906f2f6ab43996abfce73ff6723f758
+Subject: Fix PHP 7.1 related failures
+
+Origin: backport, https://github.com/symfony/symfony/commit/07467ed3a3aca5bd8760060e4472cf519b7812c5
+Bug-Debian: https://bugs.debian.org/832858
+
+---
+
+--- symfony-2.8.7+dfsg.orig/.travis.yml
++++ symfony-2.8.7+dfsg/.travis.yml
+@@ -26,8 +26,9 @@ matrix:
+         - php: 5.4
+         - php: 5.5
+         - php: 5.6
+-          env: deps=high
+         - php: 7.0
++          env: deps=high
++        - php: 7.1
+           env: deps=low
+     fast_finish: true
+ 
+@@ -50,13 +51,12 @@ before_install:
+     - if [[ ! $skip ]]; then echo session.gc_probability = 0 >> $INI_FILE; fi
+     - if [[ ! $skip && $PHP = 5.* ]]; then echo extension = mongo.so >> $INI_FILE; fi
+     - if [[ ! $skip && $PHP = 5.* ]]; then echo extension = memcache.so >> $INI_FILE; fi
+-    - if [[ ! $skip && $PHP = 5.* ]]; then (echo yes | pecl install -f apcu-4.0.10 && echo apc.enable_cli = 1 >> $INI_FILE); fi
+-    - if [[ ! $skip && $PHP = 7.* ]]; then (echo yes | pecl install -f apcu-5.1.2 && echo apc.enable_cli = 1 >> $INI_FILE); fi
++    - if [[ ! $skip && $PHP = 5.* ]]; then (echo yes | pecl install -f apcu-4.0.11 && echo apc.enable_cli = 1 >> $INI_FILE); fi
++    - if [[ ! $skip && $PHP = 7.0 ]]; then (echo yes | pecl install -f apcu-5.1.5 && echo apc.enable_cli = 1 >> $INI_FILE); fi
+     - if [[ ! $deps && $PHP = 5.* ]]; then (cd src/Symfony/Component/Debug/Resources/ext && phpize && ./configure && make && echo extension = $(pwd)/modules/symfony_debug.so >> $INI_FILE); fi
+     - if [[ ! $skip && $PHP = 5.* ]]; then pecl install -f memcached-2.1.0; fi
+     - if [[ ! $skip && ! $PHP = hhvm* ]]; then echo extension = ldap.so >> $INI_FILE; fi
+-    - if [[ ! $skip && ! $PHP = hhvm* ]]; then phpenv config-rm xdebug.ini; fi
+-    - if [[ ! $skip ]]; then composer self-update --stable; fi
++    - if [[ ! $skip && ! $PHP = hhvm* ]]; then phpenv config-rm xdebug.ini || echo "xdebug not available"; fi
+     - if [[ ! $skip ]]; then cp .composer/* ~/.composer/; fi
+     - if [[ ! $skip ]]; then ./phpunit install; fi
+     - if [[ ! $skip ]]; then export PHPUNIT=$(readlink -f ./phpunit); fi
+--- symfony-2.8.7+dfsg.orig/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/php/lazy_service_structure.txt
++++ symfony-2.8.7+dfsg/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/php/lazy_service_structure.txt
+@@ -23,5 +23,5 @@ class ProjectServiceContainer extends Co
+     }
+ }
+ 
+-class stdClass_%s extends \stdClass implements \ProxyManager\%s
+-{%a}%A
+\ No newline at end of file
++class stdClass_%s extends %SstdClass implements \ProxyManager\%s
++{%a}%A
+--- symfony-2.8.7+dfsg.orig/src/Symfony/Component/Console/Helper/Table.php
++++ symfony-2.8.7+dfsg/src/Symfony/Component/Console/Helper/Table.php
+@@ -448,7 +448,7 @@ class Table
+                 }
+ 
+                 // create a two dimensional array (rowspan x colspan)
+-                $unmergedRows = array_replace_recursive(array_fill($line + 1, $nbLines, ''), $unmergedRows);
++                $unmergedRows = array_replace_recursive(array_fill($line + 1, $nbLines, array()), $unmergedRows);
+                 foreach ($unmergedRows as $unmergedRowKey => $unmergedRow) {
+                     $value = isset($lines[$unmergedRowKey - $line]) ? $lines[$unmergedRowKey - $line] : '';
+                     $unmergedRows[$unmergedRowKey][$column] = new TableCell($value, array('colspan' => $cell->getColspan()));
+--- symfony-2.8.7+dfsg.orig/src/Symfony/Component/DependencyInjection/Tests/CrossCheckTest.php
++++ symfony-2.8.7+dfsg/src/Symfony/Component/DependencyInjection/Tests/CrossCheckTest.php
+@@ -34,7 +34,7 @@ class CrossCheckTest extends \PHPUnit_Fr
+         $loaderClass = 'Symfony\\Component\\DependencyInjection\\Loader\\'.ucfirst($type).'FileLoader';
+         $dumperClass = 'Symfony\\Component\\DependencyInjection\\Dumper\\'.ucfirst($type).'Dumper';
+ 
+-        $tmp = tempnam('sf_service_container', 'sf');
++        $tmp = tempnam(sys_get_temp_dir(), 'sf');
+ 
+         file_put_contents($tmp, file_get_contents(self::$fixturesPath.'/'.$type.'/'.$fixture));
+ 
+--- symfony-2.8.7+dfsg.orig/src/Symfony/Component/Form/Util/OrderedHashMap.php
++++ symfony-2.8.7+dfsg/src/Symfony/Component/Form/Util/OrderedHashMap.php
+@@ -140,7 +140,7 @@ class OrderedHashMap implements \ArrayAc
+                     ? 0
+                     // Imitate PHP's behavior of generating a key that equals
+                     // the highest existing integer key + 1
+-                    : max($this->orderedKeys) + 1;
++                    : 1 + (int) max($this->orderedKeys);
+             }
+ 
+             $this->orderedKeys[] = $key;
+--- symfony-2.8.7+dfsg.orig/src/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmer.php
++++ symfony-2.8.7+dfsg/src/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmer.php
+@@ -20,7 +20,7 @@ abstract class CacheWarmer implements Ca
+ {
+     protected function writeCacheFile($file, $content)
+     {
+-        $tmpFile = tempnam(dirname($file), basename($file));
++        $tmpFile = @tempnam(dirname($file), basename($file));
+         if (false !== @file_put_contents($tmpFile, $content) && @rename($tmpFile, $file)) {
+             @chmod($file, 0666 & ~umask());
+ 
+--- symfony-2.8.7+dfsg.orig/src/Symfony/Component/Validator/Constraints/File.php
++++ symfony-2.8.7+dfsg/src/Symfony/Component/Validator/Constraints/File.php
+@@ -88,20 +88,22 @@ class File extends Constraint
+ 
+     private function normalizeBinaryFormat($maxSize)
+     {
++        $sizeInt = (int) $maxSize;
++
+         if (ctype_digit((string) $maxSize)) {
+-            $this->maxSize = (int) $maxSize;
++            $this->maxSize = $sizeInt;
+             $this->binaryFormat = null === $this->binaryFormat ? false : $this->binaryFormat;
+         } elseif (preg_match('/^\d++k$/i', $maxSize)) {
+-            $this->maxSize = $maxSize * 1000;
++            $this->maxSize = $sizeInt * 1000;
+             $this->binaryFormat = null === $this->binaryFormat ? false : $this->binaryFormat;
+         } elseif (preg_match('/^\d++M$/i', $maxSize)) {
+-            $this->maxSize = $maxSize * 1000000;
++            $this->maxSize = $sizeInt * 1000000;
+             $this->binaryFormat = null === $this->binaryFormat ? false : $this->binaryFormat;
+         } elseif (preg_match('/^\d++Ki$/i', $maxSize)) {
+-            $this->maxSize = $maxSize << 10;
++            $this->maxSize = $sizeInt << 10;
+             $this->binaryFormat = null === $this->binaryFormat ? true : $this->binaryFormat;
+         } elseif (preg_match('/^\d++Mi$/i', $maxSize)) {
+-            $this->maxSize = $maxSize << 20;
++            $this->maxSize = $sizeInt << 20;
+             $this->binaryFormat = null === $this->binaryFormat ? true : $this->binaryFormat;
+         } else {
+             throw new ConstraintDefinitionException(sprintf('"%s" is not a valid maximum size', $this->maxSize));
diff -Nru symfony-2.8.7+dfsg/debian/patches/series symfony-2.8.7+dfsg/debian/patches/series
--- symfony-2.8.7+dfsg/debian/patches/series	2016-06-08 01:52:05.000000000 +0100
+++ symfony-2.8.7+dfsg/debian/patches/series	2017-01-29 13:54:28.000000000 +0000
@@ -3,3 +3,5 @@
 Increasing-timeout-in-test-AbstractProcessTest-testS.patch
 FrameworkBundle-SecurityBundle-Don-t-try-to-include-.patch
 HttpFoundation-Fix-incompatibility-with-php-memcache.patch
+fix-php-7.1-related-failures
+do-not-depend-on-a-fixed-date-in-layout-

Reply to: