Problem/Motivation

Drupal 9 should release on Symfony 4.4. Since that is not yet released, we should lock to a good -dev commit for development, and update to the full release after it comes out in November.

Proposed resolution

Heres a composer update --dry-run ran on php 7.2. Note, the symfony versions are actually getting updated to 4.4-dev.

I expect other non-symfony dependencies will need to be adjusted now that we can support php 7.2, but I think we should get this issue committed and then break out other dependency changes to their own issues.

 - Uninstalling symfony/polyfill-php70 (v1.12.0)
  - Uninstalling paragonie/random_compat (v9.99.99)
  - Uninstalling phpunit/phpunit-mock-objects (5.0.10)
  - Updating symfony/css-selector (v3.4.32) to symfony/css-selector (4.4.x-dev 1f8fa58)
  - Updating symfony/phpunit-bridge (v3.4.32) to symfony/phpunit-bridge (4.4.x-dev ed7630d)
  - Updating symfony/filesystem (v3.4.32) to symfony/filesystem (4.4.x-dev f903e39)
  - Updating symfony/finder (v3.4.32) to symfony/finder (4.4.x-dev 30898bb)
  - Updating symfony/lock (v3.4.32) to symfony/lock (4.4.x-dev 03d9a1d)
  - Updating symfony/dom-crawler (v3.4.32) to symfony/dom-crawler (v4.3.5)
  - Updating symfony/browser-kit (v3.4.32) to symfony/browser-kit (4.4.x-dev eeade40)
  - Updating symfony/yaml (v3.4.32) to symfony/yaml (4.4.x-dev 8caed6e)
  - Updating symfony/process (v3.4.32) to symfony/process (4.4.x-dev 5ec7407)
  - Installing symfony/translation-contracts (v1.1.7)
  - Updating symfony/validator (v3.4.32) to symfony/validator (4.4.x-dev 137d3f6)
  - Updating symfony/translation (v3.4.32) to symfony/translation (4.4.x-dev 01a25cb)
  - Updating symfony/serializer (v3.4.32) to symfony/serializer (4.4.x-dev c7e56d8)
  - Installing symfony/event-dispatcher-contracts (v1.1.7)
  - Updating symfony/event-dispatcher (v3.4.32) to symfony/event-dispatcher (4.4.x-dev c73bdef)
  - Installing symfony/service-contracts (v1.1.7)
  - Updating symfony/dependency-injection (v3.4.32) to symfony/dependency-injection (4.4.x-dev 556a6b3)
  - Installing symfony/polyfill-php73 (v1.12.0)
  - Updating symfony/console (v3.4.32) to symfony/console (4.4.x-dev aa43e86)
  - Updating jcalderonzumba/gastonjs (v1.0.2) to jcalderonzumba/gastonjs (v1.2.0)
  - Updating jcalderonzumba/mink-phantomjs-driver (v0.3.2) to jcalderonzumba/mink-phantomjs-driver (v0.3.3)
  - Updating sebastian/resource-operations (1.0.0) to sebastian/resource-operations (2.0.1)
  - Updating sebastian/environment (3.1.0) to sebastian/environment (4.2.2)
  - Updating sebastian/diff (2.0.1) to sebastian/diff (3.0.2)
  - Updating sebastian/comparator (2.1.3) to sebastian/comparator (3.0.2)
  - Updating phpunit/php-timer (1.0.9) to phpunit/php-timer (2.1.2)
  - Updating phpunit/php-file-iterator (1.4.5) to phpunit/php-file-iterator (2.0.2)
  - Updating phpunit/php-token-stream (2.0.2) to phpunit/php-token-stream (3.1.1)
  - Updating phpunit/php-code-coverage (5.3.2) to phpunit/php-code-coverage (6.1.4)
  - Updating phpdocumentor/reflection-common (1.0.1) to phpdocumentor/reflection-common (2.0.0)
  - Updating phpdocumentor/type-resolver (0.5.1) to phpdocumentor/type-resolver (1.0.1)
  - Updating doctrine/instantiator (1.0.5) to doctrine/instantiator (1.2.0)
  - Updating phar-io/version (1.0.1) to phar-io/version (2.0.1)
  - Updating phar-io/manifest (1.0.1) to phar-io/manifest (1.0.3)
  - Updating myclabs/deep-copy (1.7.0) to myclabs/deep-copy (1.9.3)
  - Updating phpunit/phpunit (6.5.14) to phpunit/phpunit (7.5.16)
  - Updating justinrainbow/json-schema (5.2.8) to justinrainbow/json-schema (5.2.9)
  - Updating squizlabs/php_codesniffer (3.5.0) to squizlabs/php_codesniffer (3.5.1)
  - Updating doctrine/lexer (1.0.2) to doctrine/lexer (1.1.0)
  - Updating doctrine/annotations (v1.4.0) to doctrine/annotations (v1.8.0)
  - Installing doctrine/reflection (v1.0.0)
  - Installing doctrine/event-manager (v1.0.0)
  - Updating doctrine/collections (v1.4.0) to doctrine/collections (v1.6.2)
  - Updating doctrine/cache (v1.6.2) to doctrine/cache (v1.8.0)
  - Installing doctrine/persistence (1.1.1)
  - Updating doctrine/inflector (v1.2.0) to doctrine/inflector (v1.3.0)
  - Updating doctrine/common (v2.7.3) to doctrine/common (v2.11.0)
  - Installing symfony/polyfill-php72 (v1.12.0)
  - Installing symfony/polyfill-intl-idn (v1.12.0)
  - Installing symfony/mime (v4.3.5)
  - Updating symfony/http-foundation (v3.4.32) to symfony/http-foundation (4.4.x-dev 002d69d)
  - Updating symfony/debug (v3.4.32) to symfony/debug (4.4.x-dev 25fd3ba)
  - Installing symfony/error-renderer (4.4.x-dev fca8c29)
  - Installing symfony/error-handler (dev-master b9953ac)
  - Updating symfony/http-kernel (v3.4.32) to symfony/http-kernel (4.4.x-dev a228a47)
  - Updating symfony/routing (v3.4.32) to symfony/routing (4.4.x-dev 9e472b4)
  - Updating symfony-cmf/routing (1.4.1) to symfony-cmf/routing (2.1.0)
  - Updating masterminds/html5 (2.3.0) to masterminds/html5 (2.7.0)
  - Updating symfony/psr-http-message-bridge (v1.1.2) to symfony/psr-http-message-bridge (v1.2.0)
symfony/event-dispatcher-contracts suggests installing psr/event-dispatcher

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Drupal 9 is now updated from Symfony 3.4.32 to a development version of Symfony 4.4. Because Symfony 4.4 is not yet released, known working git commits have been chosen to support testing Drupal with Symfony 4.4 packages. Later on Symfony 4.4 will be updated to tagged releases as they become available.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikelutz created an issue. See original summary.

mikelutz’s picture

Assigned: mikelutz » Unassigned
Status: Active » Needs review

Alright, so this updates symfony to ^4.4 in composer.json and runs composer update with php 7.2

There are so many interconnected dependencies around php >7.1 and symfony 3/4 that I really needed to update everything to be able to pull in SF4. just doing composer update "symfony/*" --with-dependencies failed to upgrade most of symfony due to conflicts with older versions of other dependencies.

So this includes the needed skipped deprecations, and the composer changes. We have one modification to a test to disable APCU which will need a follow-up (see #2976394-246: Allow Symfony 4.4 to be installed in Drupal 8 and #2976394-252: Allow Symfony 4.4 to be installed in Drupal 8 restoring apcu for that test is dependent on #3074585: [Symfony 5] Replace app.root and site.path string services with container parameters

mikelutz’s picture

Oh, you actually want the patch file? Okay, fine...

mikelutz’s picture

Removing the class-loader component is really part of a deprecation removal followup.

mikelutz’s picture

mikelutz’s picture

+++ b/core/composer.json
@@ -19,24 +19,24 @@
+        "symfony-cmf/routing": "^1.4|^2.1",

Some self review - this can just be ~2.1.0 we only needed 1.4 around when we were testing this with D8

mikelutz’s picture

FileSize
153.5 KB
472 bytes

Here's that small update.

mikelutz’s picture

Status: Needs review » Needs work
+++ b/composer.lock
@@ -879,10 +1130,16 @@
             "name": "drupal/core-vendor-hardening",
             "version": "9.0.x-dev",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/drupal/core-vendor-hardening.git",
+                "reference": "d1309afa44f6f5de427ec9d2d577906f2f2da6fd"
+            },
             "dist": {
-                "type": "path",
-                "url": "composer/Plugin/VendorHardening",
-                "reference": "2db54f089065dedbe4a040b01f7b527f2bad68f6"
+                "type": "zip",
+                "url": "https://api.github.com/repos/drupal/core-vendor-hardening/zipball/d1309afa44f6f5de427ec9d2d577906f2f2da6fd",
+                "reference": "d1309afa44f6f5de427ec9d2d577906f2f2da6fd",
+                "shasum": ""
             },
             "require": {

These changes in the lock file concerned me, and after discussing them with the composer team, I see I need to regenerate the lock file.

mikelutz’s picture

mikelutz’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
154.95 KB
7.44 KB

Here's the reroll, plus fixing the vendor hardening problem. One or two other small adjustments to composer.json to update minimum versions to match the ones installed with sf4.

mikelutz’s picture

Issue summary: View changes
mikelutz’s picture

Berdir’s picture

Here's my try with minimal updates. Beside symfony, I only had to update masterminds/html5 and symfony-cmf/routing. The first is a bit tricky, see #3040037: Update masterminds/html5 to 2.7.5 but we don't have a choice now. Maybe a bit of pressure will help to get lullabot/amp updated ;)

+------------------------------------+----------+-----------+
| Production Changes                 | From     | To        |
+------------------------------------+----------+-----------+
| masterminds/html5                  | 2.3.0    | 2.7.0     |
| paragonie/random_compat            | v9.99.99 | REMOVED   |
| symfony-cmf/routing                | 1.4.1    | 2.1.0     |
| symfony/console                    | v3.4.32  | 4.4.x-dev |
| symfony/debug                      | v3.4.32  | 4.4.x-dev |
| symfony/dependency-injection       | v3.4.32  | 4.4.x-dev |
| symfony/event-dispatcher           | v3.4.32  | 4.4.x-dev |
| symfony/http-foundation            | v3.4.32  | 4.4.x-dev |
| symfony/http-kernel                | v3.4.32  | 4.4.x-dev |
| symfony/polyfill-php70             | v1.12.0  | REMOVED   |
| symfony/process                    | v3.4.32  | 4.4.x-dev |
| symfony/psr-http-message-bridge    | v1.1.2   | v1.2.0    |
| symfony/routing                    | v3.4.32  | 4.4.x-dev |
| symfony/serializer                 | v3.4.32  | 4.4.x-dev |
| symfony/translation                | v3.4.32  | 4.4.x-dev |
| symfony/validator                  | v3.4.32  | 4.4.x-dev |
| symfony/yaml                       | v3.4.32  | 4.4.x-dev |
| symfony/error-handler              | NEW      | b9953ac   |
| symfony/error-renderer             | NEW      | 4.4.x-dev |
| symfony/event-dispatcher-contracts | NEW      | v1.1.7    |
| symfony/mime                       | NEW      | v4.3.5    |
| symfony/polyfill-intl-idn          | NEW      | v1.12.0   |
| symfony/polyfill-php72             | NEW      | v1.12.0   |
| symfony/polyfill-php73             | NEW      | v1.12.0   |
| symfony/service-contracts          | NEW      | v1.1.7    |
| symfony/translation-contracts      | NEW      | v1.1.7    |
+------------------------------------+----------+-----------+

+------------------------+---------+-----------+
| Dev Changes            | From    | To        |
+------------------------+---------+-----------+
| symfony/browser-kit    | v3.4.32 | 4.4.x-dev |
| symfony/css-selector   | v3.4.32 | 4.4.x-dev |
| symfony/dom-crawler    | v3.4.32 | 4.4.x-dev |
| symfony/filesystem     | v3.4.32 | 4.4.x-dev |
| symfony/finder         | v3.4.32 | 4.4.x-dev |
| symfony/lock           | v3.4.32 | 4.4.x-dev |
| symfony/phpunit-bridge | v3.4.32 | 4.4.x-dev |
+------------------------+---------+-----------+

interdiff is only composer.json, had to add dom-crawler there otherwise composer-lock-diff reported it as a non-dev dependency, not sure why.

alexpott’s picture

+++ b/composer.lock
@@ -3709,6 +4171,9 @@
+            "bin": [
+                "bin/composer"
+            ],

So this is sneaking back in. I think this happens when you've not rm -rf vendor && composer install for a while. People need to do that before attempting dependency updates atm.

alexpott’s picture

+++ b/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php
@@ -69,7 +69,7 @@ protected function deprecationEndTest($test, $time) {
-        if (in_array($deprecation[1], static::getSkippedDeprecations())) {
+        if (in_array($deprecation[1], static::getSkippedDeprecations()) || preg_filter(static::getSkippedDynamicDeprecations(), '$0', $deprecation[1])) {

@@ -100,6 +100,25 @@ private function willBeIsolated($test) {
+  /**
+   * Provides a list of deprecation message patterns to skip as regex.
+   *
+   * @return array
+   *   An array of regular expressions to compare to deprecation messages and
+   *   skip.
+   */
+  public static function getSkippedDynamicDeprecations() {

@@ -159,7 +202,7 @@ public static function getSkippedDeprecations() {
-      if ($type === E_USER_DEPRECATED && in_array($msg, self::getSkippedDeprecations(), TRUE)) {
+      if ($type === E_USER_DEPRECATED && (in_array($msg, self::getSkippedDeprecations(), TRUE) || preg_filter(static::getSkippedDynamicDeprecations(), '$0', $msg))) {

I think we should change this to add a new isDeprecationSkipped($message): bool method because then we have the logic nicely encapsulated. Also whilst we still have WebTestBase we need to do the dynamic deprecation skipping for it too. Also we could choose to backport the new method and solve the Drupal 10 deprecation skipping in D8 if we choose.

mikelutz’s picture

+1 on the approach and +1 to rtbc

jibran’s picture

Status: Needs review » Reviewed & tested by the community

I was concerned about adding | symfony/error-handler | NEW | b9953ac | but then I realiaze everything is in -dev so all good. Patch seems fine to me sot RTBC.

I wish we could just remove symfony-cmf/routing but we can't, not as is at least.

Gábor Hojtsy’s picture

Yay! As the massive work of #2976394: Allow Symfony 4.4 to be installed in Drupal 8 lead up to this issue and this was split from there, it would be nice to credit the contributors who were there but not here, since that issue will not receive a commit I assume anymore.

alexpott credited Mile23.

alexpott credited andypost.

alexpott credited catch.

alexpott credited dawehner.

alexpott’s picture

alexpott’s picture

Created the follow-up to move off non-development versions - #3088754: Update to Drupal 9 to Symfony 4.4.0

Gábor Hojtsy’s picture

Title: Update to Drupal 9 to Symfony 4.4-dev » Update Drupal 9 to Symfony 4.4-dev
Issue summary: View changes
Issue tags: -Needs change record, -Needs release note +9.0.0 release notes, +9.0.0 highlights

I added the following release notes snippet:

Drupal 9 is now updated from Symfony 3.4.32 to a development version of Symfony 4.4. Because Symfony 4.4 is not yet released, known working git commits have been chosen to support testing Drupal with Symfony 4.4 packages. Later on Symfony 4.4 will be updated to tagged releases as they become available.

Change record was already at https://www.drupal.org/node/3088712, updated with the same text.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Note that this leaves us on Symfony 3.4 for the classloader, because that's been removed in Symfony 4 entirely, but since it's self-contained there's no particular issue being in that situation except it going out of support, and we have a separate critical issue to resolve that.

Committed 1c9842d and pushed to 9.0.x. Thanks!

  • catch committed 1c9842d on 9.0.x
    Issue #3088369 by mikelutz, alexpott, Berdir, Gábor Hojtsy, andypost,...
catch’s picture

Gábor Hojtsy’s picture

Published change record at https://www.drupal.org/node/3088712 :)

DamienMcKenna’s picture

Wasn't this a duplicate of #3009219: Update Symfony to 4.4 in Drupal 9.0? Should that issue and its sub-issues be closed now?

mikelutz’s picture

Yup. Transferring credit and closing the other one.

DamienMcKenna’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Krzysztof Domański’s picture

I added tags to #3088754: Update to Drupal 9 to Symfony 4.4.0. They are no longer needed here.