Postponed awaiting Symfony 5.4 changes that may require core changes.

Problem/Motivation

Drupal 9 was released with Symfony 4.4. Drupal 10 is planned to adopt either Symfony 5.4 (#3197482: Update Drupal 10 to depend on Symfony 5.4 (as a stepping stone to Symfony 6, for deprecation checking support)) or Symfony 6 (#3197483: Evaluate the potential update of Drupal 10 to Symfony 6 and do it if possible). Either way deprecated API uses in Symfony 4 need to be resolved and incompatibilities with Symfony 5 releases need to be resolved. If a Symfony 6 update is done, we need to bridge the gap as well with Symfony 5 somehow, see #3196027: Contrib support solution needed for potential Symfony 4 to 6 upgrade, Symfony 5 only deprecations are not available in Symfony 4.

This issue is for any outstanding compatibility issues with Symfony 5.

See #2976394: Allow Symfony 4.4 to be installed in Drupal 8 for prior art with Symfony 4 on Drupal 8.

Proposed resolution

See children issues.

Remaining tasks

None at this time.

User interface changes

None.

API changes

TBD

Data model changes

TBD

Release notes snippet

TBD

Comments

mikelutz created an issue. See original summary.

mikelutz’s picture

Here is a copy of the most recent green patch from #2976395: check if my custom config entity is being updated/modified. Individual child issues should start by posting this patch, with the appropriate deprecation suppression removed to show the failures,

gábor hojtsy’s picture

Title: [Meta] Make Drupal 8 work with Symfony 5 (along with Symfony 3 and 4) » [META] Make Drupal 8 work with Symfony 5 (along with Symfony 3 and 4)

This sounds like a duplicate of #3009255: [META] Symfony 5.0 compatibility, but we can close that as duplicate and keep this, just need to parent / tag properly.

gábor hojtsy’s picture

Carrying over this single comment from @andypost from there:

SF5 could change how session will be used https://github.com/symfony/symfony/issues/10557

gábor hojtsy’s picture

Status: Active » Needs review

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

mikelutz’s picture

Title: [META] Make Drupal 8 work with Symfony 5 (along with Symfony 3 and 4) » [META] Make Drupal 9 work with Symfony 5 (along with Symfony 4)
Issue tags: +Needs issue summary update
gábor hojtsy’s picture

Just committed #3114785: [Symfony 5] Update deprecated short factory configurators in Yaml which was an easy quick win. Any other such quick wins? :)

Updated the issue summary to be current.

gábor hojtsy’s picture

Version: 8.9.x-dev » 9.0.x-dev
martin107’s picture

I think the ProxyBuilder needs to be updated to be compatible with Synfony5's new interfaces which are starting to use for example "string" as a parameter type or return type.

So I created this issue.

xjm’s picture

Issue tags: +beta target
xjm’s picture

Issue tags: -beta target +Drupal 10
daffie’s picture

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

Needs a reroll.

catch’s picture

Title: [META] Make Drupal 9 work with Symfony 5 (along with Symfony 4) » [META] Resolve Symfony 4 deprecations (Symfony 5 compatibility)

Retitling slightly since we'll need issues for Symfony 5.0 + higher deprecations.

catch’s picture

Issue summary: View changes
Status: Needs work » Active

Updated the issue summary, there are currently three patches required.

Would be good to do an updated patch here to check that's all that's remaining.

With EventDispatcher we can't make core 100% compatible, only provide forward-compatibility layers to support the continuous upgrade path, so there will be some core changes required apart from just the composer update itself. We should probably open a Drupal 10 'Update to Symfony 5' issue a patch for those changes (the code we need to change is unlikely to change a lot more before the branch opens, unless there are further changes in Symfony itself).

gábor hojtsy’s picture

Status: Active » Needs work

@mikelutz: can you help with what are the steps to generate this patch? It sounds like we may have all Symfony 5 issues resolved now :)

catch’s picture

#3055193: [Symfony 5] The "Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser" class is deprecated since Symfony 4.3, use "Symfony\Component\Mime\MimeTypes" instead. still needs work for the last Symfony 4 deprecations.

After that's committed, there are some changes required to actually update to Symfony 5, and some of our dependencies aren't compatible yet - notes and in-progress patches at:

#3161889: [META] Symfony 6 compatibility

catch’s picture

Issue summary: View changes

Added the upstream MinkBrowserKit issues to the issue summary.

catch’s picture

Category: Task » Plan
Status: Needs work » Postponed

Now that #3055193: [Symfony 5] The "Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser" class is deprecated since Symfony 4.3, use "Symfony\Component\Mime\MimeTypes" instead. is RTBC there's nothing to do here, but hesitant to actually close this given the Mink issues (which have been open for months), so moving to plan/postponed since we may need to try to push those along upstream if they're still open when we want to open the Drupal 10 branch.

gábor hojtsy’s picture

Issue summary: View changes
Issue tags: -Drupal 9, -Needs reroll

Aw, celebrated too early then. Updated the issue summary. How do we know these are the only ones left?

mikelutz’s picture

The SF5 test patch is down to 26 test failures, and I found these two issues while reviewing those tests. We really don't have to fix them here, but they met the criteria, so I added them here.

One of them is a skipped deprecation that we just didn't make an issue for. All the remaining skipped SF4 deprecations are around the Event and MimeTypeGuesser changes, and those need to stay in Drupal 9, as we still need to use the legacy classes for now, despite having wrapper code and a plan to switch over to the new classes in D10, so we aren't skipping any other deprecations that should cause a problem.

The symfony/Lock deprecation for some reason doesn't trigger a deprecation error, it only has an annotation. I assume a mistake on symfony's part, so I think these will be the last two, unless somehow I trace another of the remaining test failures to another SF4 deprecation, but I don't expect to.

longwave’s picture

Issue summary: View changes
Status: Postponed » Needs work

Version: 9.0.x-dev » 9.1.x-dev

Drupal 9.0.10 was released on December 3, 2020 and is the final full bugfix release for the Drupal 9.0.x series. Drupal 9.0.x will not receive any further development aside from security fixes. Sites should update to Drupal 9.1.0 to continue receiving regular bugfixes.

Drupal-9-only bug reports should be targeted for the 9.1.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.2.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

gábor hojtsy’s picture

Issue summary: View changes
Status: Needs work » Postponed

Back to postponed again since #3185603: [Symfony 5] Symfony Constraint plugins are not strictly Drupal plugins landed and there are no other blockers listed.

daffie’s picture

Status: Postponed » Needs work

We also need #3187074: [Symfony 5] Services are private by default. The issue is ready for a review.

gábor hojtsy’s picture

Issue summary: View changes

Good point, added that to the issue summary though :)

gábor hojtsy’s picture

Issue summary: View changes
Status: Needs work » Postponed
gábor hojtsy’s picture

xjm’s picture

longwave’s picture

catch’s picture

#3209239: [Symfony 5] Symfony\Contracts\EventDispatcher\Event subclasses need return types is in now.

Was going to mark this back to postponed, but there is still no movement on either of the MinkBrowserKitDriver PRs, so I've gone ahead and opened an issue to start tracking that more actively, and potentially switch to a fork in the meantime: #3209459: Switch to friends of behat MinkBrowserKitDriver for PHP 8 and Symfony 5 compatibility.

catch’s picture

Title: [META] Resolve Symfony 4 deprecations (Symfony 5 compatibility) » [META] Symfony 5 compatibility

Re-titling since all known Symfony 4 deprecations are dealt with, but we still have the potential for Symfony 5.4 introducing a breaking change.

gábor hojtsy’s picture

Issue summary: View changes
Status: Active » Postponed

Given #3209459: Switch to friends of behat MinkBrowserKitDriver for PHP 8 and Symfony 5 compatibility landing, going to remove this section from the issue summary:

Additionally, Drupal's test dependencies are not yet compatible with Symfony 5, see

https://github.com/minkphp/MinkBrowserKitDriver/issues/139
https://github.com/minkphp/MinkBrowserKitDriver/pull/151
https://github.com/minkphp/MinkBrowserKitDriver/pull/142

Also updating the text in general and postponing awaiting Symfony 5.4 later this year.

gábor hojtsy’s picture

Adding to release highlights.

andypost’s picture

It could be marked as fixed I guess

catch’s picture

I don't think there are any outstanding issues remaining, however we haven't got Symfony 5.4 to test with yet, so we can keep this open to track those issues once we do.

Version: 9.1.x-dev » 9.3.x-dev

Drupal 9.1.10 (June 4, 2021) and Drupal 9.2.10 (November 24, 2021) were the last bugfix releases of those minor version series. Drupal 9 bug reports should be targeted for the 9.3.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

longwave’s picture

Status: Postponed » Active

Symfony 5.4.0 is out. Discussed briefly in Slack with @andypost and @Gábor Hojtsy, next steps here are a new child issue to upgrade Drupal 10.0.x to Symfony 5.4, and then if all is well this can be closed as done.

edit: #3197482: Update Drupal 10 to depend on Symfony 5.4 (as a stepping stone to Symfony 6, for deprecation checking support) already existed, let's use that

gábor hojtsy’s picture

Status: Active » Fixed

I don't believe we have any outstanding Symfony 5.4 issues other than actually updating to it in #3197482: Update Drupal 10 to depend on Symfony 5.4 (as a stepping stone to Symfony 6, for deprecation checking support), so this one is more Fixed than Active. Thanks all!

Status: Fixed » Closed (fixed)

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