Problem/Motivation

#2712647: Update Symfony components to ~3.2 and #2871253: Update Symfony components to 3.2.8 updated the Symfony components to 3.2.* but with 3.3.0 due out in May 2017 we should make sure Drupal 8.4.0 can ship with this.

Proposed resolution

Update composer.json once 3.3.0 has been tagged.

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#91 interdiff.txt816 bytesslasher13
#91 update_symfony-2874909-91.patch61.92 KBslasher13
#89 interdiff.txt21.05 KBslasher13
#89 update_symfony-2874909-89.patch61.12 KBslasher13
#77 interdiff.txt3.64 KBslasher13
#77 update_symfony-2874909-78.patch58.54 KBslasher13
#75 interdiff.txt6.31 KBslasher13
#75 update_symfony-2874909-75.patch59.17 KBslasher13
#72 interdiff.txt2.73 KBslasher13
#72 update_symfony-2874909-72.patch54.58 KBslasher13
#71 interdiff.txt2.57 KBslasher13
#71 update_symfony-2874909-71.patch54.92 KBslasher13
#67 interdiff.txt2.17 KBslasher13
#67 update_symfony-2874909-67.patch54.52 KBslasher13
#65 interdiff.txt1.49 KBslasher13
#65 update_symfony-2874909-65.patch53.77 KBslasher13
#64 update_symfony-2874909-62.patch52.28 KBslasher13
#57 update_symfony-2874909-57.patch54.74 KBjibran
#57 interdiff-e9b120.txt28.73 KBjibran
#52 interdiff-78411b.txt16.8 KBjibran
#52 update_symfony-2874909-52.patch54.04 KBjibran
#48 update_symfony-2874909-48.patch51.27 KBslasher13
#48 interdiff.txt38.91 KBslasher13
#40 update_symfony-2874909-40.patch50.97 KBjibran
#40 interdiff-1100ed.txt3.43 KBjibran
#37 2874909-37.patch81.02 KBpk188
#34 2874909-34.patch81.02 KBjofitz
#27 drupal-update_symfony_3.3-2874909-27.patch81.07 KBhswong3i
#25 update_symfony-2874909-25.patch48.28 KBjibran
#25 interdiff-a9e483.txt3.16 KBjibran
#23 2874909-23.patch45.12 KBjibran
#23 interdiff-583834.txt7.25 KBjibran
#21 interdiff-15-21.txt20.86 KBmpdonadio
#21 2874909-21.patch37.85 KBmpdonadio
#18 2874909.18-update-dependencies.patch62.29 KBdeviantintegral
#15 update_symfony-2874909-15.patch37.99 KBjibran
#12 2874909-12-B.patch43.44 KBmpdonadio
#12 2874909-12.patch36.94 KBmpdonadio
#10 2874909-10.patch68.13 KBmpdonadio
#8 interdiff-06-08.txt639 bytespritish.kumar
#8 2874909-08.patch35.11 KBpritish.kumar
#6 interdiff-02-06.txt1.94 KBmpdonadio
#6 2874909-06.patch35.11 KBmpdonadio
#2 2874909-02.patch33.17 KBmpdonadio
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

timmillwood created an issue. See original summary.

mpdonadio’s picture

Status: Active » Needs review
FileSize
33.17 KB

Let's see if anything breaks with 3.3-beta1.

jibran’s picture

Nice one @mpdonadio.

timmillwood’s picture

Thanks for adding the beta patch. Hopefully we can keep on the ball with the symfony updates and move to 4.* in November ready for 8.5.x. Although that would mean shifting Drupal to depend on php7

Status: Needs review » Needs work

The last submitted patch, 2: 2874909-02.patch, failed testing.

mpdonadio’s picture

Status: Needs work » Needs review
FileSize
35.11 KB
1.94 KB

This fixes the proxy fail, and updates some related deprecations in 3.3. The larger problem is Request::setTrustedHeaderName() is deprecated now in favor of the X-Forwarded-* headers or the new RFC7239 Forwarded header, instead of allowing you to specify your own header names. Not sure how we handle BC with those settings in the long run.

I don't know enough about the low level container details to know what is really happening in those fails, or why just those two tests fail and everything doesn't implode. Nothing in http://symfony.com/blog/symfony-3-3-0-beta1-released jumped out at me.

Status: Needs review » Needs work

The last submitted patch, 6: 2874909-06.patch, failed testing.

pritish.kumar’s picture

Status: Needs work » Needs review
FileSize
35.11 KB
639 bytes

Fixed the coding standard issue in ReverseProxyMiddleware.php

Status: Needs review » Needs work

The last submitted patch, 8: 2874909-08.patch, failed testing.

mpdonadio’s picture

Status: Needs work » Needs review
FileSize
68.13 KB

Reroll b/c #2488860: Bring phpunit bridge into drupal and use it for unit tests and simpletest to handle Deprecation.

#2871253: Update Symfony components to 3.2.8 will also likely require a reroll when it lands.

Tagging out on this for the time being; the container fails are over my head.

jibran’s picture

Status: Needs review » Needs work

I think you forgot to rebase the local branch to 8.4.x.

mpdonadio’s picture

Status: Needs work » Needs review
FileSize
36.94 KB
43.44 KB

Sigh. That was my failed attempt to do a simple rebase and forgetting to fresh start the branch I was in.

This is the fresh start. But, upon watching composer run and closer examination of composer.lock, I noticed that specifying this way isn't pulling in the 3.3-beta1 versions of Symfony dependencies that aren't explicit in the core/composer.json (symfony/debug, symfony/dom-crawler, and symfony/browser-kit). I am not sure if that matters with these:

$ composer show -i | grep symfony
symfony-cmf/routing 1.4.0 Extends the Symfony2 routing component for dynami...
symfony/browser-kit v3.2.8 Symfony BrowserKit Component
symfony/class-loader v3.3.0-BETA1 Symfony ClassLoader Component
symfony/console v3.3.0-BETA1 Symfony Console Component
symfony/css-selector v3.3.0-BETA1 Symfony CssSelector Component
symfony/debug v3.2.8 Symfony Debug Component
symfony/dependency-injection v3.3.0-BETA1 Symfony DependencyInjection Component
symfony/dom-crawler v3.2.8 Symfony DomCrawler Component
symfony/event-dispatcher v3.3.0-BETA1 Symfony EventDispatcher Component
symfony/http-foundation v3.3.0-BETA1 Symfony HttpFoundation Component
symfony/http-kernel v3.3.0-BETA1 Symfony HttpKernel Component
symfony/phpunit-bridge v3.3.0-BETA1 Symfony PHPUnit Bridge
symfony/polyfill-iconv v1.3.0 Symfony polyfill for the Iconv extension
symfony/polyfill-mbstring v1.3.0 Symfony polyfill for the Mbstring extension
symfony/process v3.3.0-BETA1 Symfony Process Component
symfony/psr-http-message-bridge v1.0.0 PSR HTTP message bridge
symfony/routing v3.3.0-BETA1 Symfony Routing Component
symfony/serializer v3.3.0-BETA1 Symfony Serializer Component
symfony/translation v3.3.0-BETA1 Symfony Translation Component
symfony/validator v3.3.0-BETA1 Symfony Validator Component
symfony/yaml v3.3.0-BETA1 Symfony Yaml Component

Attached is a B patch, where those are added to force those to beta for the time being:

$ composer show -i | grep symfony
symfony-cmf/routing 1.4.0 Extends the Symfony2 routing component for dynami...
symfony/browser-kit v3.3.0-BETA1 Symfony BrowserKit Component
symfony/class-loader v3.3.0-BETA1 Symfony ClassLoader Component
symfony/console v3.3.0-BETA1 Symfony Console Component
symfony/css-selector v3.3.0-BETA1 Symfony CssSelector Component
symfony/debug v3.3.0-BETA1 Symfony Debug Component
symfony/dependency-injection v3.3.0-BETA1 Symfony DependencyInjection Component
symfony/dom-crawler v3.3.0-BETA1 Symfony DomCrawler Component
symfony/event-dispatcher v3.3.0-BETA1 Symfony EventDispatcher Component
symfony/http-foundation v3.3.0-BETA1 Symfony HttpFoundation Component
symfony/http-kernel v3.3.0-BETA1 Symfony HttpKernel Component
symfony/phpunit-bridge v3.3.0-BETA1 Symfony PHPUnit Bridge
symfony/polyfill-iconv v1.3.0 Symfony polyfill for the Iconv extension
symfony/polyfill-mbstring v1.3.0 Symfony polyfill for the Mbstring extension
symfony/process v3.3.0-BETA1 Symfony Process Component
symfony/psr-http-message-bridge v1.0.0 PSR HTTP message bridge
symfony/routing v3.3.0-BETA1 Symfony Routing Component
symfony/serializer v3.3.0-BETA1 Symfony Serializer Component
symfony/translation v3.3.0-BETA1 Symfony Translation Component
symfony/validator v3.3.0-BETA1 Symfony Validator Component
symfony/yaml v3.3.0-BETA1 Symfony Yaml Component

jibran’s picture

+++ b/core/composer.json
@@ -32,7 +32,10 @@
+        "symfony/debug": "3.3-beta1",
+        "symfony/dom-crawler": "3.3-beta1",
+        "symfony/browser-kit": "3.3-beta1"

No need to add these to composer.json just update these packages using cli and it'd update composer.lock.

Status: Needs review » Needs work

The last submitted patch, 12: 2874909-12-B.patch, failed testing.

jibran’s picture

Status: Needs work » Needs review
FileSize
37.99 KB

Status: Needs review » Needs work

The last submitted patch, 15: update_symfony-2874909-15.patch, failed testing.

deviantintegral’s picture

Status: Needs work » Needs review
FileSize
62.29 KB

Running with updated dependencies is causing some functional tests to fail against 8.4.x. 8.3.x is fine. I found this with a test for the Amazon SNS module, but it happens with core tests too.

docroot sudo -u www-data vendor/bin/phpunit -c core/phpunit.xml -vvv --group node --testsuite functional --debug --stop-on-failure
PHPUnit 4.8.35 by Sebastian Bergmann and contributors.

Runtime:	PHP 7.0.18-1+deb.sury.org~trusty+1
Configuration:	/var/www/docroot/core/phpunit.xml

Testing

Starting test 'Drupal\Tests\node\Functional\Migrate\d7\NodeMigrateDeriverTest::testBuilder'.
.
Starting test 'Drupal\Tests\node\Functional\MultiStepNodeFormBasicOptionsTest::testMultiStepNodeFormBasicOptions'.
E

Time: 34.68 seconds, Memory: 42.00MB

There was 1 error:

1) Drupal\Tests\node\Functional\MultiStepNodeFormBasicOptionsTest::testMultiStepNodeFormBasicOptions
Exception: Warning: Class __PHP_Incomplete_Class has no unserializer
Symfony\Component\Routing\Route->unserialize()() (Line: 120)


/var/www/docroot/core/lib/Drupal/Core/Test/HttpClientMiddleware/TestHttpClientMiddleware.php:44
/var/www/docroot/vendor/guzzlehttp/promises/src/Promise.php:203
/var/www/docroot/vendor/guzzlehttp/promises/src/Promise.php:156
/var/www/docroot/vendor/guzzlehttp/promises/src/TaskQueue.php:47
/var/www/docroot/vendor/guzzlehttp/promises/src/Promise.php:246
/var/www/docroot/vendor/guzzlehttp/promises/src/Promise.php:223
/var/www/docroot/vendor/guzzlehttp/promises/src/Promise.php:267
/var/www/docroot/vendor/guzzlehttp/promises/src/Promise.php:225
/var/www/docroot/vendor/guzzlehttp/promises/src/Promise.php:62
/var/www/docroot/vendor/guzzlehttp/guzzle/src/Client.php:129
/var/www/docroot/vendor/fabpot/goutte/Goutte/Client.php:155
/var/www/docroot/vendor/symfony/browser-kit/Client.php:315
/var/www/docroot/vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php:144
/var/www/docroot/vendor/behat/mink/src/Session.php:148
/var/www/docroot/core/tests/Drupal/Tests/BrowserTestBase.php:306
/var/www/docroot/core/tests/Drupal/Tests/BrowserTestBase.php:446
/var/www/docroot/core/modules/node/tests/src/Functional/NodeTestBase.php:32

FAILURES!
Tests: 2, Assertions: 18, Errors: 1.

This patch does nothing but run composer update. I expect this would break for anyone trying to use 8.4.x with a composer-based workflow.

Status: Needs review » Needs work

The last submitted patch, 18: 2874909.18-update-dependencies.patch, failed testing. View results

mpdonadio’s picture

#18 seems to be missing composer.json and the changes to ReverseProxyMiddleware.

mpdonadio’s picture

Status: Needs work » Needs review
FileSize
37.85 KB
20.86 KB

Ok, back to tildes in composer.json, which results in 3.3.2 in the lockfile after `composer update 'symfony/*'`.

Interdiff is against #15. Didn't see anything odd in the lockfile.

Still expect fails because deprecations from phpunit-bridge, and other quirks.

Status: Needs review » Needs work

The last submitted patch, 21: 2874909-21.patch, failed testing. View results

jibran’s picture

Status: Needs review » Needs work

The last submitted patch, 23: 2874909-23.patch, failed testing. View results

jibran’s picture

Status: Needs work » Needs review
FileSize
3.16 KB
48.28 KB

We have a @see to https://github.com/symfony/symfony/pull/12521 in \Drupal\Tests\Component\EventDispatcher\ContainerAwareEventDispatcherTest and
[EventDispatcher] Add Drupal EventDispatcher is closed in favor of [DI][EventDispatcher] Add & wire closure-proxy argument type. Any suggestions how to fix The Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher class is deprecated since version 3.3 and will be removed in 4.0.

Status: Needs review » Needs work

The last submitted patch, 25: update_symfony-2874909-25.patch, failed testing. View results

hswong3i’s picture

hswong3i’s picture

Status: Needs work » Needs review
cilefen’s picture

timmillwood’s picture

Looks like if this gets in to 8.4.x we'll need to increase the minimum PHP requirement to 5.6 (currently it's 5.5.9).

Queuing some tests to be sure.

Status: Needs review » Needs work

The last submitted patch, 27: drupal-update_symfony_3.3-2874909-27.patch, failed testing. View results

timmillwood’s picture

Issue tags: +Needs reroll

ok, we can check this after reroll.

jofitz’s picture

Status: Needs review » Needs work

The last submitted patch, 34: 2874909-34.patch, failed testing. View results

Eric_A’s picture

pk188’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
81.02 KB

Re rolled.

Status: Needs review » Needs work

The last submitted patch, 37: 2874909-37.patch, failed testing. View results

timmillwood’s picture

Status: Needs work » Postponed

Not sure it's worth doing anymore re-rolls until we've moved Drupal to have a minimum PHP version of 5.6

jibran’s picture

composer show symfony/*
symfony/browser-kit             v3.3.2 Symfony BrowserKit Component
symfony/class-loader            v3.3.2 Symfony ClassLoader Component
symfony/console                 v3.3.2 Symfony Console Component
symfony/css-selector            v3.3.2 Symfony CssSelector Component
symfony/debug                   v3.3.2 Symfony Debug Component
symfony/dependency-injection    v3.3.2 Symfony DependencyInjection Component
symfony/dom-crawler             v3.3.2 Symfony DomCrawler Component
symfony/event-dispatcher        v3.3.2 Symfony EventDispatcher Component
symfony/http-foundation         v3.3.2 Symfony HttpFoundation Component
symfony/http-kernel             v3.3.0 Symfony HttpKernel Component
symfony/phpunit-bridge          v3.3.2 Symfony PHPUnit Bridge
symfony/polyfill-iconv          v1.4.0 Symfony polyfill for the Iconv extension
symfony/polyfill-mbstring       v1.4.0 Symfony polyfill for the Mbstring extension
symfony/process                 v3.3.2 Symfony Process Component
symfony/psr-http-message-bridge v1.0.0 PSR HTTP message bridge
symfony/routing                 v3.3.2 Symfony Routing Component
symfony/serializer              v3.3.2 Symfony Serializer Component
symfony/translation             v3.3.2 Symfony Translation Component
symfony/validator               v3.3.2 Symfony Validator Component
symfony/yaml                    v3.3.2 Symfony Yaml Component
timmillwood’s picture

It seems the following libraries depend on PHP 5.6:

  • doctrine/annotations
  • doctrine/collections
  • doctrine/common
  • zendframework/zend-feed
  • zendframework/zend-stdlib
jibran’s picture

Yup, those are all listed in #2864037: [META] Update core PHP dependencies.

Status: Needs review » Needs work

The last submitted patch, 40: update_symfony-2874909-40.patch, failed testing. View results

Eric_A’s picture

Issue tags: +Needs reroll
jibran’s picture

Mile23’s picture

slasher13’s picture

- use caret over tilde in composer.json
- update symfony/* to 3.3.5

Status: Needs review » Needs work

The last submitted patch, 48: update_symfony-2874909-48.patch, failed testing. View results

Mile23’s picture

From the test results: https://www.drupal.org/pift-ci-job/720562

The Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher class is deprecated since version 3.3 and will be removed in 4.0. Use EventDispatcher with closure factories instead: 8x

That looks quite non-trivial.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Status: Needs review » Needs work

The last submitted patch, 52: update_symfony-2874909-52.patch, failed testing. View results

Mile23’s picture

We need to be careful about symfony/phpunit-bridge as long as we're using phpunit 4.8.*: #2882826: Constrain symfony/phpunit-bridge to 3.2.*

dawehner’s picture

@jibran asked me a have a look at it:

  • I don't think we should update twig in this issue
  • Symfony seems to be broken, but I haven't managed to reproduce it properly as a PR in symfony
jibran’s picture

> I don't think we should update twig in this issue
I agree, updating to 3.3.6 was not possible until I updated the twig. This is blocked on #2864031: Update twig/twig from v1.25.0 to v1.32.0 which is green now.
> Symfony seems to be broken, but I haven't managed to reproduce it properly as a PR in symfony
Can you please elaborate on that?

And thanks for having a look.

jibran’s picture

Yet another reroll.

Status: Needs review » Needs work

The last submitted patch, 57: update_symfony-2874909-57.patch, failed testing. View results

Mile23’s picture

+++ b/core/composer.json
@@ -46,8 +46,8 @@
-        "symfony/phpunit-bridge": "~3.2.8"
...
+        "symfony/phpunit-bridge": "~3.3.9"

Like I said in #54... :-)

#2882826: Constrain symfony/phpunit-bridge to 3.2.*

We could change it here if this patch goes in before that one.

TJacksonVA’s picture

Shouldn't this now be changed to update to Symfony 3.4, as Symfony 3.4 is currently in beta3 and will be released on a production basis at the end of November? Especially since Symfony 3.4 is a long-term support version (through November 2021).

Mile23’s picture

catch’s picture

We need to get onto the Symfony 3 LTS release before doing anything with Symfony 4. It took us a long time to get from Symfony 2 to 3, and the change was disruptive to drush and at least a couple of modules once we did.

It'd be fine to open a new issue for Symfony 4 beta to see how disruptive the changes are though. From previous announcements it looked like all the big changes were around bundles which we don't even use, but there could well be smaller changes to components that affect things we rely on.

deviantintegral’s picture

From previous announcements it looked like all the big changes were around bundles which we don't even use, but there could well be smaller changes to components that affect things we rely on.

We also need to consider contrib or site-specific code that itself relies on Symfony 3 components. If I use a 3.4 LTS component in a module that isn't in core, I would still expect that module to remain compatible with all future Drupal 8 releases.

slasher13’s picture

Version: 8.4.x-dev » 8.5.x-dev
Status: Needs work » Needs review
FileSize
52.28 KB

re-roll

slasher13’s picture

skip deprecation messages

The last submitted patch, 64: update_symfony-2874909-62.patch, failed testing. View results

slasher13’s picture

The last submitted patch, 65: update_symfony-2874909-65.patch, failed testing. View results

jibran’s picture

+++ b/core/tests/Drupal/Tests/Core/StackMiddleware/ReverseProxyMiddlewareTest.php
@@ -47,6 +47,10 @@ public function testNoProxy() {
+   * @expectedDeprecation The "Symfony\Component\HttpFoundation\Request::setTrustedHeaderName()" method is deprecated since version 3.3 and will be removed in 4.0. Use the $trustedHeaderSet argument of the Request::setTrustedProxies() method instead.

Can we add this error message to the skipped deprecation as well?

Status: Needs review » Needs work

The last submitted patch, 67: update_symfony-2874909-67.patch, failed testing. View results

slasher13’s picture

Status: Needs work » Needs review
FileSize
54.92 KB
2.57 KB
slasher13’s picture

The last submitted patch, 71: update_symfony-2874909-71.patch, failed testing. View results

Status: Needs review » Needs work

The last submitted patch, 72: update_symfony-2874909-72.patch, failed testing. View results

slasher13’s picture

Status: Needs work » Needs review
FileSize
59.17 KB
6.31 KB

- update phpunit-bridge
- add expected deprecations
- revert #72

Mile23’s picture

Status: Needs review » Needs work
+++ b/core/tests/Drupal/Tests/Component/EventDispatcher/ContainerAwareEventDispatcherTest.php
@@ -193,4 +194,52 @@ public function testGetListenerPriorityWithServices()
+     * @expectedDeprecation The Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher class is deprecated since version 3.3 and will be removed in 4.0. Use EventDispatcher with closure factories instead.

+++ b/core/tests/Drupal/Tests/Component/Serialization/YamlTest.php
@@ -80,6 +81,8 @@ public function testYamlFiles($file) {
+   * @expectedDeprecation Using the unquoted scalar value "!php/object "O:8:\"stdClass\":1:{s:3:\"foo\";s:3:\"bar\";}"" is deprecated since version 3.3 and will be considered as a tagged value in 4.0. You must quote it on line 2.

+++ b/core/tests/Drupal/Tests/Core/StackMiddleware/ReverseProxyMiddlewareTest.php
@@ -47,6 +47,10 @@ public function testNoProxy() {
+   * @expectedDeprecation The "Symfony\Component\HttpFoundation\Request::setTrustedHeaderName()" method is deprecated since version 3.3 and will be removed in 4.0. Use the $trustedHeaderSet argument of the Request::setTrustedProxies() method instead.

+++ b/core/tests/Drupal/Tests/Listeners/DeprecationListener.php
@@ -42,6 +42,15 @@ public function endTest(\PHPUnit_Framework_Test $test, $time) {
+      'The Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher class is deprecated since version 3.3 and will be removed in 4.0. Use EventDispatcher with closure factories instead.',
+      'Using the unquoted scalar value "!php/object "O:8:\"stdClass\":1:{s:3:\"foo\";s:3:\"bar\";}"" is deprecated since version 3.3 and will be considered as a tagged value in 4.0. You must quote it.',
...
+      'The "Symfony\Component\HttpFoundation\Request::setTrustedHeaderName()" method is deprecated since version 3.3 and will be removed in 4.0. Use the $trustedHeaderSet argument of the Request::setTrustedProxies() method instead.',

If we're adding the deprecation message to the list of skipped messages, then we shouldn't modify the test.

slasher13’s picture

Status: Needs work » Needs review
FileSize
58.54 KB
3.64 KB

#76 done

Mile23’s picture

I meant: Don't add @group legacy or expected deprecations to the tests, please. :-)

We don't want the tests to expect deprecation errors. That way when it comes time to fix the deprecations we only have to remove the messages from the ignore list.

slasher13’s picture

The deprecation listener doesn't work for some tests see e.g. #71 and #72.

Mile23’s picture

Aha. That's a bug: #2922887: Drupal DeprecationListener only works for process-isolated tests

In that case, we can move forward here with the expected exceptions and then be sure to fix them in the other issue, or some other follow-up.

mpdonadio’s picture

#80, it would probably be worth it to explicitly add @todo pointing to #2922887: Drupal DeprecationListener only works for process-isolated tests in those cases.

alexpott’s picture

Status: Needs review » Needs work
+++ b/core/tests/Drupal/Tests/Listeners/DeprecationListener.php
@@ -42,6 +42,12 @@ public function endTest(\PHPUnit_Framework_Test $test, $time) {
+      'Using the unquoted scalar value "!php/object "O:8:\"stdClass\":1:{s:3:\"foo\";s:3:\"bar\";}"" is deprecated since version 3.3 and will be considered as a tagged value in 4.0. You must quote it.',
+      'The Symfony\Component\DependencyInjection\Container::isFrozen() method is deprecated since version 3.3 and will be removed in 4.0. Use the isCompiled() method instead.',
+      'The Symfony\Component\DependencyInjection\DefinitionDecorator class is deprecated since version 3.3 and will be removed in 4.0. Use the Symfony\Component\DependencyInjection\ChildDefinition class instead.',
+      'The Symfony\Component\ClassLoader\ApcClassLoader class is deprecated since version 3.3 and will be removed in 4.0. Use `composer install --apcu-autoloader` instead.',
+      'Using the X-Status-Code header is deprecated since version 3.3 and will be removed in 4.0. Use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent::allowCustomResponseCode() instead.',
+      'The Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher class is deprecated since version 3.3 and will be removed in 4.0. Use EventDispatcher with closure factories instead.',

This is the entire point of #2870194: Ensure that process-isolated tests can use Symfony's PHPunit bridge to catch usages of deprecated code. We should definitely not be adding to this array. We need to do the work here in the upgrade to not accrue the technical debt.

Where the deprecations are expected in a test, we should maintain the deprecation and test for it using @group legacy and @expectedDeprecation.

catch’s picture

Priority: Normal » Critical

I misread #60 as talking about Symfony 4, not Symfony 3.4. I still think we should try to get this done asap then move onto Symfony 3.4. However if Symfony 3.4 has a stable release before we do that, when we can just skip 3.3. It'd be absolutely fine for someone to start a separate 3.4 issue now stacked on this issue if they want though.

On the deprecations stuff:

If we follow the current plan in #2607260: [meta] Core deprecation message introduction, contrib testing etc. we should do the following:

1. Fix deprecations in core before/as part of this issue.

2. Commit the patch with the DeprecationListener additions so that contrib doesn't start failing without a warning

3. When 8.6.x is opened (i.e. when there's a tagged Drupal 8.4.x release with the new Symfony 3.3 APIs available), commit a follow-up issue that removes those lines from the DeprecationListener so that contrib tests start to fail and they're encouraged to update.

This needs to be balanced with getting onto Symfony 3.3 before security support is dropped for Symfony 3.2, which is January 2018. So if there's something intractable we might have to live with using the deprecated stuff to avoid dropping out of security support.

I'm bumping this to critical, since two months isn't long.

catch’s picture

Status: Needs work » Needs review

Given those two months and the schedule for 8.5.x, I think we should actually not fix the deprecations here and do them in a follow-up. Even when this patch lands in 8.5.x, we've still got January-March 7th 2018 where Symfony could theoretically do a security release and we'd have no obvious way to do a corresponding Drupal 8 release.

xjm’s picture

Issue tags: +Triaged D8 critical

@plach, @catch, @larowlan, @effulgentsia, and I discussed this issue today. We agreed it should be critical and that it's pretty urgent given that there are only six weeks until our version of Symfony loses security support, which in turn might force us to roll this potentially disruptive change out with zero warning in a security release if something gets disclosed.

mpdonadio’s picture

Status: Needs review » Needs work
Issue tags: +Needs followup

#84 mentions a f/up, so tagging.

+++ b/composer.lock
@@ -1250,20 +1299,20 @@
-                "php": ">=5.5.9"
+                "php": "^5.5.9|>=7.0.8"

This appears in a lot of the Symfony dependencies. We need to take this into account for people who commit/deploy vendor or use the tarball.

At a minimum, we need to tweak the installer and system_requirements, however we don't really have a mechanism in place for it (both just do min version checks). Not sure if we also want to mirror in core/composer.json

For a cleaner history, do we want a side issue to do the installer and system_requirements change to use SemVer::satisfies() instead of version_compare()?

mpdonadio’s picture

Adding some related issues, both of which could probably be adapted to semver instead of min-version.

slasher13’s picture

slasher13’s picture

Status: Needs work » Needs review
FileSize
61.12 KB
21.05 KB

#86 done

update symfony

Status: Needs review » Needs work

The last submitted patch, 89: update_symfony-2874909-89.patch, failed testing. View results

slasher13’s picture

Status: Needs work » Needs review
FileSize
61.92 KB
816 bytes

Status: Needs review » Needs work

The last submitted patch, 91: update_symfony-2874909-91.patch, failed testing. View results

dawehner’s picture

+++ b/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php
@@ -104,8 +104,11 @@ public function dispatch($event_name, Event $event = NULL) {
+          if (is_array($definition['callable']) && isset($definition['callable'][0]) && $definition['callable'][0] instanceof \Closure) {
+            $definition['callable'][0] = $definition['callable'][0]();
+          }
 
-          $definition['callable']($event, $event_name, $this);
+          call_user_func($definition['callable'], $event, $event_name, $this);

I'm a bit confused, we need to call both?

effulgentsia’s picture

From #83:

if Symfony 3.4 has a stable release before we do that, when we can just skip 3.3

There is one now. There's even a 3.4.1. I'm equally ok with finishing this issue for 3.3 and then opening a new one for 3.4, or skipping 3.3 and rescoping this one to 3.4. For the people working on this issue, which approach would be easier for you?

Mile23’s picture

+++ b/core/tests/Drupal/Tests/Listeners/DeprecationListener.php
@@ -42,6 +42,12 @@ public function endTest(\PHPUnit_Framework_Test $test, $time) {
   public static function getSkippedDeprecations() {
     return [
+      'Using the unquoted scalar value "!php/object "O:8:\"stdClass\":1:{s:3:\"foo\";s:3:\"bar\";}"" is deprecated since version 3.3 and will be considered as a tagged value in 4.0. You must quote it.',
+      'The Symfony\Component\DependencyInjection\Container::isFrozen() method is deprecated since version 3.3 and will be removed in 4.0. Use the isCompiled() method instead.',
+      'The Symfony\Component\DependencyInjection\DefinitionDecorator class is deprecated since version 3.3 and will be removed in 4.0. Use the Symfony\Component\DependencyInjection\ChildDefinition class instead.',
+      'The Symfony\Component\ClassLoader\ApcClassLoader class is deprecated since version 3.3 and will be removed in 4.0. Use `composer install --apcu-autoloader` instead.',
+      'Using the X-Status-Code header is deprecated since version 3.3 and will be removed in 4.0. Use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent::allowCustomResponseCode() instead.',
+      'The Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher class is deprecated since version 3.3 and will be removed in 4.0. Use EventDispatcher with closure factories instead.',
       'As of 3.1 an Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface is used to resolve arguments. In 4.0 the $argumentResolver becomes the Symfony\Component\HttpKernel\Controller\ArgumentResolver if no other is provided instead of using the $resolver argument.',
       'Symfony\Component\HttpKernel\Controller\ControllerResolver::getArguments is deprecated as of 3.1 and will be removed in 4.0. Implement the Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface and inject it in the HttpKernel instead.',
       'The Twig_Node::getLine method is deprecated since version 1.27 and will be removed in 2.0. Use getTemplateLine() instead.',

I get that we might end up needing to add some messages here for 3.3, but are there not any that we can remove along with this change? See also #82.

alexpott’s picture

+++ b/core/tests/Drupal/Tests/Component/EventDispatcher/ContainerAwareEventDispatcherTest.php
@@ -23,6 +23,7 @@
+ * @group legacy

@@ -193,4 +194,52 @@ public function testGetListenerPriorityWithServices()
+    /**
+     * @expectedDeprecation The Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher class is deprecated since version 3.3 and will be removed in 4.0. Use EventDispatcher with closure factories instead.
+     */
+    public function testAddAListenerService() {
+      parent::testAddAListenerService();
+    }
+
+    /**
+     * @expectedDeprecation The Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher class is deprecated since version 3.3 and will be removed in 4.0. Use EventDispatcher with closure factories instead.
+     */
+    public function testPreventDuplicateListenerService() {
+      parent::testPreventDuplicateListenerService();
+    }
+
+    /**
+     * @expectedDeprecation The Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher class is deprecated since version 3.3 and will be removed in 4.0. Use EventDispatcher with closure factories instead.
+     */
+    public function testAddASubscriberService() {
+      parent::testAddASubscriberService();
+    }
+
+    /**
+     * @expectedDeprecation The Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher class is deprecated since version 3.3 and will be removed in 4.0. Use EventDispatcher with closure factories instead.
+     */
+    public function testHasListenersOnLazyLoad() {
+      parent::testHasListenersOnLazyLoad();
+    }
+
+    /**
+     * @expectedDeprecation The Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher class is deprecated since version 3.3 and will be removed in 4.0. Use EventDispatcher with closure factories instead.
+     */
+    public function testGetListenersOnLazyLoad() {
+      parent::testGetListenersOnLazyLoad();
+    }
+
+    /**
+     * @expectedDeprecation The Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher class is deprecated since version 3.3 and will be removed in 4.0. Use EventDispatcher with closure factories instead.
+     */
+    public function testRemoveAfterDispatch() {
+      parent::testRemoveAfterDispatch();
+    }
+
+    /**
+     * @expectedDeprecation The Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher class is deprecated since version 3.3 and will be removed in 4.0. Use EventDispatcher with closure factories instead.
+     */
+    public function testRemoveBeforeDispatch() {
+      parent::testRemoveBeforeDispatch();
+    }

+++ b/core/tests/Drupal/Tests/Component/Serialization/YamlTest.php
@@ -12,6 +12,7 @@
+ * @group legacy

@@ -80,6 +81,8 @@ public function testYamlFiles($file) {
+   *
+   * @expectedDeprecation Using the unquoted scalar value "!php/object "O:8:\"stdClass\":1:{s:3:\"foo\";s:3:\"bar\";}"" is deprecated since version 3.3 and will be considered as a tagged value in 4.0. You must quote it on line 2.

If the whole test is not legacy then we should put only the method that is testing the deprecation in the legacy group - so we just need to move the @group to the method not the class

cilefen’s picture

Re #94, #2927746: Update Symfony components to 3.4.*, exists and has patches. I don't see that we should continue chasing 3.3 when 3.4 is stable and is an LTS. Let's close this, or, close #2927746 and re-scope this issue now.

jibran’s picture

The idea was to give people time to adapt the BC break/API changes.

From: https://symfony.com/roadmap?version=3.3

Symfony 3.3 is a stable release whose support will end in July 2018.

Given above info, I think now it is ok to close this issue and fix #2927746: Update Symfony components to 3.4.*.

We should move the credits to the 3.4 issue as well.

mpdonadio’s picture

Assigned: Unassigned » cilefen
Related issues: +#2927746: Update Symfony components to 3.4.*

Agreed. Going to let a @cilefen close this so he can update credits on the other issue, as needed.

cilefen’s picture

Status: Needs work » Closed (duplicate)

Good idea @mpdonadio. I'm taking care of that now.

slasher13’s picture

Status: Closed (duplicate) » Needs work

In https://www.drupal.org/project/drupal/issues/2927746#comment-12383036 you see some of symfony 3.4 breaking changes.
I think we need a own BC layer to handle these changes.

I would prefer to start with the much less breaking version 3.3.

cilefen’s picture

The reasoning behind the comment is understandable of course. However 3.3 loses security support in July.

I respect very much the work you've done on this issue. But nobody replied directly to comment #94 one month ago, which is why I decided to close this one. At the same time I don't want to discourage anyone!

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

jibran’s picture

Status: Needs work » Closed (duplicate)
Issue tags: -Needs followup