Problem/Motivation

#3055180: [META] Symfony 5 compatibility resolved Symfony 4 deprecations in Drupal 9 for Symfony 5. We want to keep resolving deprecations in Symfony 5 towards Symfony 6 compatibility. If it is feasible to move directly from Symfony 4 in Drupal 9 to Symfony 6 in Drupal 10, it would be useful to have that option.

Proposed resolution

Keep surfacing new deprecated APIs affecting Drupal as new Symfony deprecations are added in Symfony 5 versions. This issue is used to update Symfony 4 to Symfony 5 for testing purposes only. This is also a META tracking issue for individual fixes that should go into child issues. Repeat until Symfony 5.4 is available.

Remaining tasks

We have a problem with dev requirement Prophecy. It has to do with "static" return type hinting. See: https://github.com/phpspec/prophecy/issues/527

Must haves

None at this time.

Should have for Drupal 9/10, must have for Drupal 10/11

If we are to update to Symfony 6 in Drupal 10, we also need to bridge the gap somehow for deprecation checking and updates. See #3196027: Contrib support solution needed for potential Symfony 4 to 6 upgrade, Symfony 5 only deprecations are not available in Symfony 4.

API changes

Ideally none. See child issues.

Data model changes

None.

Release notes snippet

Drupal has been updated for compatibility with Symfony 5.4. This includes adding return type hints to some methods where we were unable to find any examples or use-cases for subclassing. However, should custom code subclass one of these methods, a return type hint can be added. A list is available in the change record

CommentFileSizeAuthor
#239 3161889-239.patch83.07 KBlongwave
#232 3161889-232.patch106.47 KBdaffie
#231 3161889-231.patch106.46 KBdaffie
#230 3161889-230.patch102.98 KBlongwave
#229 3161889-229.patch97.78 KBlongwave
#227 3161889-227.patch106.36 KBlongwave
#226 interdiff.3161889.224-226.txt12.05 KBlongwave
#226 3161889-226.patch106.36 KBlongwave
#224 3161889-224.patch99.12 KBlongwave
#223 3161889-223.patch100.14 KBlongwave
#222 3161889-222.patch91.86 KBlongwave
#221 3161889-221.patch90.84 KBlongwave
#204 3161889-204.patch250.05 KBdaffie
#203 3161889-203.patch250.59 KBdaffie
#203 interdiff-3161889-198-203.patch2.03 KBdaffie
#198 interdiff-3161889-196-198.patch5.19 KBdaffie
#198 3161889-198.patch253.21 KBdaffie
#196 3161889-196.patch248.04 KBlongwave
#191 3161889-191.patch329.7 KBdaffie
#188 3161889-188.patch262.45 KBlongwave
#186 3161889-186.patch247.12 KBlongwave
#184 3161889-184.patch244.64 KBlongwave
#180 3161889-180.patch233.49 KBlongwave
#179 3161889-179.patch233.49 KBlongwave
#177 interdiff.3161889.163-177.txt1.28 KBlongwave
#177 3161889-177.patch233.14 KBlongwave
#176 interdiff.3161889.163-175.txt1.06 KBlongwave
#176 3161889-175.patch232.92 KBlongwave
#175 interdiff.3161889.163-174.txt1.06 KBlongwave
#175 3161889-174.patch232.92 KBlongwave
#163 3161889-163.patch234.02 KBdaffie
#162 3161889-162.patch235.18 KBdaffie
#103 3161889-103.patch132.76 KBgábor hojtsy
#100 interdiff.3161889.97-100.txt12.6 KBlongwave
#100 3161889-100.patch135.52 KBlongwave
#97 3161889-97-sf5.2.3.patch125.25 KBlongwave
#96 3161889-96-sf5.2.3.patch125.5 KBlongwave
#79 interdiff.3161889.74-79.txt6.93 KBlongwave
#79 3161889-79.patch187.84 KBlongwave
#74 interdiff.3161889.71-74.txt7 KBlongwave
#74 3161889-74.patch183.15 KBlongwave
#71 interdiff.3161889.68-71.txt16.93 KBlongwave
#71 3161889-71.patch176.52 KBlongwave
#68 interdiff.3161889.66-68.txt7.23 KBlongwave
#68 3161889-68.patch183 KBlongwave
#67 interdiff.3161889.66-67.txt6.42 KBlongwave
#67 3161889-67.patch182.19 KBlongwave
#66 interdiff.3161889.65-66.txt1.19 KBlongwave
#66 3161889-66.patch175.77 KBlongwave
#65 3161889-65.patch175.6 KBlongwave
#64 interdiff.3161889.62-64.txt1.91 KBlongwave
#64 3161889-64.patch176.16 KBlongwave
#62 3161889-62.patch174.25 KBlongwave
#57 interdiff.txt341.44 KBgábor hojtsy
#57 3161889-57.patch471.2 KBgábor hojtsy
#53 3161889-53.patch276.32 KBgábor hojtsy
#52 3161889-52.patch276.28 KBgábor hojtsy
#46 interdiff.3161889.44-45.txt6.25 KBmikelutz
#46 3161889-45.drupal.patch134.47 KBmikelutz
#44 interdiff.3161889.41-44.txt462 bytesmikelutz
#44 3161889-44.drupal.patch130.89 KBmikelutz
#43 interdiff.3161889.42-43.txt708 bytesmikelutz
#43 3161889-43.drupal.patch130.56 KBmikelutz
3161889-42.drupal.patch131.25 KBmikelutz
interdiff.3161889.41-42.txt4.26 KBmikelutz
#41 interdiff.3161889.34-41.txt1.17 KBmikelutz
#41 3161889-41.drupal.patch129.52 KBmikelutz
#34 interdiff.3161889.31-34.txt3.46 KBmikelutz
#34 3161889-34.drupal.patch129.29 KBmikelutz
#32 Interdiff.3161889.30-31.txt2.65 KBmikelutz
#32 3161889-31.drupal.patch125.82 KBmikelutz
#31 interdiff.3161889.30-31.txt2.66 KBmikelutz
#31 3161889-31.drupal.patch125.83 KBmikelutz
#30 interdiff.3161889.29-30.txt948 bytesmikelutz
#30 3161889-30.drupal.patch125.2 KBmikelutz
#29 interdiff.3161889.28-29.txt2.46 KBmikelutz
#29 3161889-29.drupal.patch124.27 KBmikelutz
#28 interdiff.3161889.27-28.txt64.24 KBmikelutz
#28 3161889-28.drupal.patch121.81 KBmikelutz
#27 interdiff.3161889.26-27.txt854 bytesmikelutz
#27 3161889-27.drupal.patch139.44 KBmikelutz
#26 interdiff.3161889.24-26.txt1.65 KBmikelutz
#26 3161889-26.drupal.patch139.42 KBmikelutz
#24 3161889-23.patch137.71 KBcatch
#24 3161889-23.patch137.71 KBcatch
#22 3161889-18.patch138.35 KBcatch
#21 interdiff.3161889.20-21.txt6.54 KBmikelutz
#21 3161889-21.drupal.patch45.97 KBmikelutz
#20 interdiff.3161889.18-20.txt1.5 KBmikelutz
#20 3161889-20.drupal.patch41.68 KBmikelutz
#18 3161889-18.drupal.patch40.18 KBmikelutz
#14 3161889.patch217.64 KBcatch
#11 3161889.patch215.37 KBcatch
#11 interdiff.txt63.29 KBcatch
#10 3161889.patch152.32 KBcatch
#10 interdiff.txt541 bytescatch
#9 interdiff.txt551 bytescatch
#9 3161889.patch151.79 KBcatch
#8 3161889.patch151.26 KBcatch
#8 3161889-interdiff.txt6.77 KBcatch
#7 3161889-7.patch145.18 KBcatch
#6 3161889-6.patch146.94 KBcatch
#5 3055193-5.patch146.31 KBcatch
#5 interdiff.txt3.65 KBcatch
#4 3161889-4.patch121.09 KBcatch
3161889-4.patch4.33 KBcatch
#3 3161889-3.patch134.43 KBcatch

Issue fork drupal-3161889

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

catch created an issue. See original summary.

catch’s picture

StatusFileSize
new134.43 KB

Brute force approach, but see where this gets us:

- remove behat as a dependency
- exclude Functional and FunctionalJavaScript tests from test discovery.

Then we should be able to see what fails with unit and kernel tests.

catch’s picture

StatusFileSize
new121.09 KB
catch’s picture

catch’s picture

StatusFileSize
new146.94 KB
catch’s picture

StatusFileSize
new145.18 KB
catch’s picture

StatusFileSize
new6.77 KB
new151.26 KB

Removing some of the shims in ContainerAwareEventDispatcher that we just added.

catch’s picture

StatusFileSize
new151.79 KB
new551 bytes

Updating the typehint in AccountProxy::__construct(). We could split off a patch to remove that typehint in Drupal 9 so that there's less to update.

catch’s picture

StatusFileSize
new541 bytes
new152.32 KB
catch’s picture

StatusFileSize
new63.29 KB
new215.37 KB

Dozens more event dispatcher type hint changes.

catch’s picture

Issue summary: View changes
catch’s picture

StatusFileSize
new217.64 KB

Including some fixes from child issues.

catch’s picture

Title: [META] Resolve Symfony 5 deprecations (Symfony 6 compatibility) » [META] Symfony 6 compatibility
catch’s picture

Issue summary: View changes
catch’s picture

Issue summary: View changes
mikelutz’s picture

Assigned: Unassigned » mikelutz
StatusFileSize
new40.18 KB

I'm struggling to seperate out the recently committed stuff from #16 from some of the other needed changes to get Drupal running on 5.1, so for my own education, I'm going to try a fresh patch and see if I can figure out exactly what is missing. Expect a few broken things thrown against testbot while I work through this.

mikelutz’s picture

Status: Active » Needs work
mikelutz’s picture

StatusFileSize
new41.68 KB
new1.5 KB
mikelutz’s picture

StatusFileSize
new45.97 KB
new6.54 KB
catch’s picture

StatusFileSize
new138.35 KB

Started on my own re-roll and crossposting with @mikelutz - this is untested based on #14 with the committed patch hacked out and a new composer update symfony/*

mikelutz’s picture

Assigned: mikelutz » Unassigned

bah, Sorry, @catch. I didn't realize you were working on this today. I was trying to get myself up to speed, and go the other way. Start from scratch and work in the needed typehints from your interdiffs.

catch’s picture

StatusFileSize
new137.71 KB
new137.71 KB

@mikelutz no problem at all, patch here is very messy, once we've got something 'working' should probably split it into different sections so it's easier to re-roll next time.

mikelutz’s picture

I was going a different way anyway, more like what we did with SF4 and Drupal 8 where I didn't change the lock file, but ran the update in drupalci.yml. I'll let you finish, I know you've been working on it. I didn't mean to jump in, I thought you might be done for the night, and I wanted to play with it a bit.

mikelutz’s picture

StatusFileSize
new139.42 KB
new1.65 KB

Adding some deprecations to skip for now.

mikelutz’s picture

StatusFileSize
new139.44 KB
new854 bytes

Fix for the dispatcher that was breaking a lot of kernel tests.

mikelutz’s picture

StatusFileSize
new121.81 KB
new64.24 KB

Going to try going back to my method of updating, which also includes a fork of mink browser kit that might work. A number of the kernel tests are failing because they are loading traits from functional tests that aren't making it into the classloader.

mikelutz’s picture

StatusFileSize
new124.27 KB
new2.46 KB

Remove a broken legacy mime type guesser test class referencing the legacy guesser

mikelutz’s picture

StatusFileSize
new125.2 KB
new948 bytes

Response constructor won't take an array anymore. hacking HtmlResponse to try to get some Functional tests working.

mikelutz’s picture

StatusFileSize
new125.83 KB
new2.66 KB

Another deprecation, and a different fix for HtmlResponse.

mikelutz’s picture

StatusFileSize
new125.82 KB
new2.65 KB

Ooops, try this one.

mikelutz’s picture

mikelutz’s picture

StatusFileSize
new129.29 KB
new3.46 KB

Removing more legacy code from the mimetype system.

mikelutz’s picture

mikelutz’s picture

gábor hojtsy’s picture

Issue summary: View changes
Status: Needs work » Active

Updated issue summary since the blocking issue was resolved. Did not yet process the children issues in my head so did not do a comprehensive list just pointed to the sidebar.

mikelutz’s picture

I'm still working through the remaining test failures, I have a few RTBC patches that should address a number of them in D9, so I'm going to give it a day or two to see if they get committed before I re-roll the patch, but I think I can get this green in the next week or so. I'm taking next week off from $work, so I should have more time to dedicate to this.

The current patch is testing against SF5.1 stable, so once it's green, we can push up to 5.2-dev and try to get ahead of the current SF5 dev cycle. After that we can just keep on continual maintenance hopefully. So far, I don't see any SF5 deprecations we can't handle in D9, but they still have 3 more releases in the 5.x cycle to throw curveballs at us, and I feel like they like to put a lot of them in the X.4 release. I'm super happy we are ahead of the game early this time though. Once we are caught up with 5.x-dev, we can take a more active role in the SF6 development cycle, and try and work upstream to make SF6 in D10 happen more easily.

andypost’s picture

There's good overview of coming 5.2 https://speakerdeck.com/fabpot/symfony-5-dot-2

Looks we could reconsider current set of console applications and unify it for d10 ref #2242947: Integrate Symfony Console component to natively support command line operations

mikelutz’s picture

StatusFileSize
new129.52 KB
new1.17 KB

Here's a re-roll with the HtmlResponse changes removed (fixed in #3172410: Make HtmlResponse compatible with Symfony 5), plus a hack fix around the metapackage fail on my temporary mink fork. A couple other issue landed, so altogether a few more failures should be fixed.

@Gábor, did you mean to reset this to active instead of NW? I know it's technically a meta issue, maybe active makes more sense.

mikelutz’s picture

StatusFileSize
new130.56 KB
new708 bytes

And fixing the bad re-roll of HtmlResponse in #41...

mikelutz’s picture

StatusFileSize
new130.89 KB
new462 bytes

composer lock issue fix.

andypost’s picture

@mikelutz it looks great! Thank you

23 remaining failures are straight to fix

mikelutz’s picture

StatusFileSize
new134.47 KB
new6.25 KB

Fixing a few more, going to open more issues. Deleting one MimeType test for now because I can't convert it as is. It uses reflection on the MimeTypeGuesser class, whose equivalant in SF5 is final. We will need to look at how to replace that test.

gábor hojtsy’s picture

Status: Active » Needs work

@mikelutz: definitely no intention to change the status.

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

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

gábor hojtsy’s picture

Issue summary: View changes
Issue tags: -Symfony 5 +Symfony 6

Updated issue summary with individual issues linked and more info about how this issue is used.

gábor hojtsy’s picture

Issue summary: View changes

Fixed markup.

gábor hojtsy’s picture

Status: Needs work » Needs review
StatusFileSize
new276.28 KB

Rerolled the patch manually against 9.2.x. Some things already landed, eg. some places already use the Contracts interface from Symfony.

gábor hojtsy’s picture

StatusFileSize
new276.32 KB

Somehow missed a core/composer.json change in my manual fix where the symfony/mime package was added. Adding that in.

gábor hojtsy’s picture

Status: Needs review » Needs work

Hm, now we get a bazillion instances of Fatal error: Trait 'Prophecy\PhpUnit\ProphecyTrait' not found in /var/www/html/core/tests/Drupal/TestTools/PhpUnitCompatibility/PhpUnit9/TestCompatibilityTrait.php on line 12. It seems like my patch updates the phpunit version to 9 from 8, so that might have something to do with this. I am not really well versed around the phpunit update magic we have. Also we may not want to update the phpunit version here, but either way it should work with an updated phpunit.

Going to pass this to others who know this better :D

gábor hojtsy’s picture

Per @longwave in slack:

phpspec/prophecy-phpunit:^2 is required for phpunit 9. if you composer require that on your patch it should work

gábor hojtsy’s picture

Status: Needs work » Needs review
StatusFileSize
new471.2 KB
new341.44 KB

Well doing that adds quite a few more dependencies. Let's see.

Status: Needs review » Needs work

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

gábor hojtsy’s picture

I don't actually understand how I should read these fails :/ There are definitely two of these which are odd, because it says it requires that and it did find it but then it did not use it.

drupal/core-dev 9.2.99 requires behat/mink-browserkit-driver dev-SF5 as v1.3.4 -> found behat/mink-browserkit-driver[dev-SF5 dc566b2] but it does not match the constraint.

mikelutz’s picture

Hmm, Those composer validation issues are tricky. behat/mink-browserkit-driver dev-SF5 is my fork of browserkit that is compatible with SF5. We are cheating the system to use the fork, just to get tests running, but I'm not certain why it isn't happy, nor what to do long term about actually having a working supported mink browserkit. If I need to change anything in the fork, or if anybody wants access to commit changes to my fork, let me know. I'll try to look into it more when I have time.

gábor hojtsy’s picture

https://symfony.com/blog/symfony-5-2-0-released so this should be updated to 5.2 now, the patch uses 5.1 :) Thanks @andypost for the tip.

longwave’s picture

Status: Needs work » Needs review
StatusFileSize
new174.25 KB

This is #57 with Symfony 5.2 but with the PHPUnit upgrade removed as it's not needed here.

$ composer update drupal/core symfony/* behat/mink-browserkit-driver
...
$ composer-lock-diff --no-links
+------------------------------------+---------+---------+
| Production Changes                 | From    | To      |
+------------------------------------+---------+---------+
| symfony/console                    | v4.4.16 | v5.2.0  |
| symfony/debug                      | v4.4.16 | REMOVED |
| symfony/dependency-injection       | v4.4.16 | v5.2.0  |
| symfony/error-handler              | v4.4.16 | v5.2.0  |
| symfony/event-dispatcher           | v4.4.16 | v5.2.0  |
| symfony/event-dispatcher-contracts | v1.1.9  | v2.2.0  |
| symfony/http-foundation            | v4.4.16 | v5.2.0  |
| symfony/http-kernel                | v4.4.16 | v5.2.0  |
| symfony/mime                       | v5.1.8  | v5.2.0  |
| symfony/process                    | v4.4.16 | v5.2.0  |
| symfony/routing                    | v4.4.16 | v5.2.0  |
| symfony/serializer                 | v4.4.16 | v5.2.0  |
| symfony/translation                | v4.4.16 | v5.2.0  |
| symfony/validator                  | v4.4.16 | v5.2.0  |
| symfony/var-dumper                 | v5.1.8  | v5.2.0  |
| symfony/yaml                       | v4.4.16 | v5.2.0  |
| psr/event-dispatcher               | NEW     | 1.0.0   |
| symfony/deprecation-contracts      | NEW     | v2.2.0  |
| symfony/polyfill-intl-grapheme     | NEW     | v1.20.0 |
| symfony/string                     | NEW     | v5.2.0  |
+------------------------------------+---------+---------+

+------------------------------+---------+---------+
| Dev Changes                  | From    | To      |
+------------------------------+---------+---------+
| behat/mink-browserkit-driver | v1.3.4  | dc566b2 |
| symfony/browser-kit          | v4.4.16 | v5.2.0  |
| symfony/css-selector         | v4.4.16 | v5.2.0  |
| symfony/dom-crawler          | v4.4.16 | v5.2.0  |
| symfony/filesystem           | v4.4.16 | v5.2.0  |
| symfony/finder               | v4.4.16 | v5.2.0  |
| symfony/lock                 | v4.4.16 | v5.2.0  |
| symfony/phpunit-bridge       | v5.1.8  | v5.2.0  |
+------------------------------+---------+---------+
longwave’s picture

Looks like something has changed in the Symfony container between 5.1.8 and 5.2.0, as locally I run out of memory or segfault when compiling the container, and run-tests.sh crashes with

Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: The "module_handler" service or alias has been removed or inlined when the container was compiled. You should either make it public, or stop using the container directly and use dependency injection instead. in /var/www/html/drupal/vendor/symfony/dependency-injection/Container.php:266
Stack trace:
#0 /var/www/html/drupal/vendor/symfony/dependency-injection/Container.php(228): Symfony\Component\DependencyInjection\Container->make('module_handler', 1)
#1 /var/www/html/drupal/vendor/symfony/dependency-injection/ContainerBuilder.php(539): Symfony\Component\DependencyInjection\Container->get('module_handler')
#2 /var/www/html/drupal/core/lib/Drupal/Core/Test/TestRunnerKernel.php(77): Symfony\Component\DependencyInjection\ContainerBuilder->get('module_handler')
#3 /var/www/html/drupal/core/scripts/run-tests.sh(559): Drupal\Core\Test\TestRunnerKernel->boot()
#4 /var/www/html/drupal/core/scripts/run-tests.sh(51): simpletest_script_init()
#5 {main}Failed to execute command php core/scripts/run-tests.sh --list: exit status 2

Seems that services are really private by default now, and we are going to have to force public services even more than we do already: https://github.com/symfony/dependency-injection/compare/v5.1.9..v5.2.0

longwave’s picture

StatusFileSize
new176.16 KB
new1.91 KB

Explicitly setting services and aliases to public fixes at least some of the container issues, my local site and run-tests.sh both work now.

longwave’s picture

StatusFileSize
new175.6 KB

Try again without the DrupalCI container command.

longwave’s picture

StatusFileSize
new175.77 KB
new1.19 KB

And I forgot the deprecation notice.

longwave’s picture

StatusFileSize
new182.19 KB
new6.42 KB

Some more fixes, maybe enough to make the tests not blow up entirely.

We pretend that Symfony Constraint plugins are Drupal plugins, but the constructor is no longer compatible so we need to provide a new custom factory. This can probably be committed to Drupal 9/Symfony 4.

We also have to call setPublic(TRUE) all over the place for services. Not sure if this is the right way to go, or if we should be doing this at a lower level somewhere, but it does help some of the tests pass. Maybe we need to make sure we always use our Container/ContainerBuilder subclasses and handle it there if we are staying with public-by-default services.

longwave’s picture

StatusFileSize
new183 KB
new7.23 KB

One more setPublic() fix.

longwave’s picture

Issue summary: View changes

Opened #3185603: [Symfony 5] Symfony Constraint plugins are not strictly Drupal plugins to deal with the Constraint issue described in #67.

Status: Needs review » Needs work

The last submitted patch, 68: 3161889-68.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

longwave’s picture

Status: Needs work » Needs review
StatusFileSize
new176.52 KB
new16.93 KB

Fixed some of the container issues by forcing services to public.

+------------------------------------+---------+---------+
| Production Changes                 | From    | To      |
+------------------------------------+---------+---------+
| symfony/console                    | v4.4.16 | v5.2.0  |
| symfony/debug                      | v4.4.16 | REMOVED |
| symfony/dependency-injection       | v4.4.16 | v5.2.0  |
| symfony/error-handler              | v4.4.16 | v5.2.0  |
| symfony/event-dispatcher           | v4.4.16 | v5.2.0  |
| symfony/event-dispatcher-contracts | v1.1.9  | v2.2.0  |
| symfony/http-foundation            | v4.4.16 | v5.2.0  |
| symfony/http-kernel                | v4.4.16 | v5.2.0  |
| symfony/process                    | v4.4.16 | v5.2.0  |
| symfony/routing                    | v4.4.16 | v5.2.0  |
| symfony/serializer                 | v4.4.16 | v5.2.0  |
| symfony/translation                | v4.4.16 | v5.2.0  |
| symfony/validator                  | v4.4.16 | v5.2.0  |
| symfony/yaml                       | v4.4.16 | v5.2.0  |
| psr/event-dispatcher               | NEW     | 1.0.0   |
| symfony/polyfill-intl-grapheme     | NEW     | v1.20.0 |
| symfony/string                     | NEW     | v5.2.0  |
+------------------------------------+---------+---------+

+------------------------------+---------+---------+
| Dev Changes                  | From    | To      |
+------------------------------+---------+---------+
| behat/mink-browserkit-driver | v1.3.4  | dc566b2 |
| symfony/browser-kit          | v4.4.16 | v5.2.0  |
| symfony/css-selector         | v4.4.16 | v5.2.0  |
| symfony/dom-crawler          | v4.4.16 | v5.2.0  |
| symfony/filesystem           | v4.4.16 | v5.2.0  |
| symfony/finder               | v4.4.16 | v5.2.0  |
| symfony/lock                 | v4.4.16 | v5.2.0  |
+------------------------------+---------+---------+
andypost’s picture

psr/event-dispatcher | NEW | 1.0.0

Interesting how it compatible with pecl psr C extension https://pecl.php.net/package/psr

edit yes, it's https://github.com/jbboehr/php-psr/blob/master/psr_event_dispatcher.c#L23

Status: Needs review » Needs work

The last submitted patch, 71: 3161889-71.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

longwave’s picture

Status: Needs work » Needs review
StatusFileSize
new183.15 KB
new7 KB

A few more little fixes.

Status: Needs review » Needs work

The last submitted patch, 74: 3161889-74.patch, failed testing. View results

longwave’s picture

Issue summary: View changes

Opened #3187074: [Symfony 5] Services are private by default for the dependency injection changes.

longwave’s picture

Issue summary: View changes
gábor hojtsy’s picture

Issue tags: +Europe2020
longwave’s picture

Status: Needs work » Needs review
StatusFileSize
new187.84 KB
new6.93 KB

If my local testing is right, this should be green. This is #74 with fixes for all the tests:

longwave’s picture

gábor hojtsy’s picture

daffie’s picture

I have some problems with releasing D10 with Symfony 6. Symfony 6 is to be released in november 2021. A new minor version is to be released every 6 months, in may and november. Every major and minor version will 8 months of bug- and security fixes, with the exception of the last minor release of every major release. That one will get 3 years of bug fixes and 4 years of security fixes. See: https://symfony.com/doc/current/contributing/community/releases.html.
If everything does according to plan then D10 will be release in june 2022. In the previous month will Symfony 6.1 be released. Every Drupal minor release gets 6 months of bug fixes and 12 months of security fixes. For D10.0 that will result in that in januari 2023 it will be giving 4 more months of security fixes when Symfony has stopped giving any support version 6.1. This does not sound very exceptable to me. We can update the required Symfony version for D10.0 from 6.1 to 6.2 in december 2022 or januari 2023. Only there will a risk in doing that. For instance in Symfony 5.2 they made services fully private by default. See: #3187074: [Symfony 5] Services are private by default. Which would result in a big BC break. If we want to minimize the risk of creating BC breaks we will have to go with a release of Symfony that is a LTS release. Therefore for me releasing D10 with Symfony 6 is not a acceptable option.

catch’s picture

For D10.0 that will result in that in januari 2023 it will be giving 4 more months of security fixes when Symfony has stopped giving any support version 6.1.

This is true, but we have an agreement with Symfony's security team that if we are on a recently-out-of-support minor version, we can help them backport changes to the version we're using, only for components we're using, and they'll make an official security release of that version at the same time. So if they do a security release in that window, we have to do some extra work, but we don't get into a situation where we have to fork or upgrade to a minor release during a patch release.

We will need to go 6.1 -> 6.2, 6.2 -> 6.3 and 6.3 -> 6.4 in the respective minor Drupal releases, but we've done several Symfony minor releases (we even did Symfony 2 to Symfony 3) during the Drupal 8 cycle, and while they weren't problem-free, we have managed OK.

If we release on the Symfony 5.4 LTS, then we only get security support until November 2025, this will force us to release Drupal 11 by November 2024 (or ideally June 2024 - otherwise the Drupal 9 LTS release would not really be an LTS at all), which is about half the time between Drupal 8 and 9. Even if we wanted to move to shorter major release cycles, it would nice to be able to do this by choice instead of being determined entirely by dependency support cycles.

daffie’s picture

@catch Thank you your response and great to hear how the problem is solved. If releasing D10 with Symfony 6 is that important, can we then make all issues for getting there critical?

catch’s picture

@daffie yes IMO they can all be critical. If it turns out we can't release on Symfony 6 because we're unable to bridge the gap from 4, then we'd have to release on Symfony 5.4, but for me I think Symfony 6 should be the goal - and we have to do all that work at some point anyway.

andypost’s picture

Session usage will need review as SF deprecated session service finally https://github.com/symfony/symfony/pull/38616

longwave’s picture

#87: that only looks like it affects FrameworkBundle which we don't use, the changes in HttpFoundation (which we do use) only add a single method.

daffie’s picture

Priority: Major » Critical

I was wondering how we are going to add deprecation messages for stuff that gets deprecated in Symfony 5. We would like to use Symfony 6 in D10, only when we do that, we should add deprecation messages for that stuff in D9. And in D9 we use Symfony 4 and in that version in the stuff not jet deprecated. How can we fix this?
In #3162016: [Symfony 6] Retrieving a non-string value from "Symfony\Component\HttpFoundation\InputBag::get()" is deprecated we are fixing it for core, only we cannot add a deprecation message for contrib and custom modules. The when your D9 website works without getting deprecation messages your site will work in D10, is no longer valid. Is this acceptable or can we add deprecation messages in another way?

Changing the status to critical as we would like to release D10 with Symfony 6. Got the oke from @catch for this (comment #86).

Edit: Would it be possible to create a patch file that from Drupal core would update the method Symfony\Component\HttpFoundation\InputBag::get() and add deprecation message? Just an idea.

daffie’s picture

daffie’s picture

daffie’s picture

Issue summary: View changes

#3187074: [Symfony 5] Services are private by default also has landed. Also removed from the remaining tasks list.

gábor hojtsy’s picture

longwave’s picture

StatusFileSize
new125.5 KB

Now many of the compatibility fixes have been committed this is getting smaller. This is #79 rebased then upgraded to Symfony 5.2.3. The composer build tests will fail because I removed the minimum-stability changes, really we need a stable release of behat/mink-browserkit-driver.

longwave’s picture

StatusFileSize
new125.25 KB

Something went wrong when merging composer.lock, let's try again.

Status: Needs review » Needs work

The last submitted patch, 97: 3161889-97-sf5.2.3.patch, failed testing. View results

gábor hojtsy’s picture

Issue summary: View changes

#3161983: [Symfony 6] Update EventDispatcherInterface type hints in constructors landed, removing from issue summary. Great progress :) Looking forward to what new things we are still to find.

longwave’s picture

Status: Needs work » Needs review
StatusFileSize
new135.52 KB
new12.6 KB

Fixed two failing tests by removing MimeTypePass and another legacy test. Also testing out a deprecation fix by applying #3187857: [Symfony 6] Service deprecation messages require more fields.

Status: Needs review » Needs work

The last submitted patch, 100: 3161889-100.patch, failed testing. View results

daffie’s picture

gábor hojtsy’s picture

Status: Needs work » Needs review
StatusFileSize
new132.76 KB

Quick reroll of #100, it did not need #3187857: [Symfony 6] Service deprecation messages require more fields anymore, given that it landed.

Status: Needs review » Needs work

The last submitted patch, 103: 3161889-103.patch, failed testing. View results

xjm’s picture

longwave’s picture

Opened #3199691: [Symfony 6] Symfony no longer parses octal numbers starting with 0 alone which seems like a seldom used edge case but something we still have to deal with.

catch’s picture

Issue summary: View changes
greenreaper’s picture

Symfony 6 requires PHP 8.0, so #3173787: [policy] Require PHP 8.1 for Drupal 10.0 if a dependency does, otherwise require PHP 8.0. (up from 7.3 in Drupal 9) must be considered, #3109885: [meta] Ensure compatibility of Drupal 9 with PHP 8.0 (as it evolves) seems to indicate compatibility, but I'm unsure if testing with 7.x handles that.

Perhaps it was assumed that 8.x would be a requirement, but I don't see it mentioned. Debian 11 will have 7.4, but 8.x is obtainable.

gábor hojtsy’s picture

@GreenReaper: Drupal 10 is indeed planned to require PHP 8. See #3118147: [meta] Set Drupal 10 platform and browser requirements six months before the release. Upgrade Status is already checking for this requirement on Drupal 9 (#3202955: Start checking PHP 8 requirement on Drupal 9). PHP 7 end of life (November 2022) is only slightly later than Drupal 10's release date (June 2022 earliest).

gábor hojtsy’s picture

Issue tags: +NorthAmerica2021

longwave’s picture

Rerolled #103 into a merge request, updated Symfony components, applied #3162016: [Symfony 6] Retrieving a non-string value from "Symfony\Component\HttpFoundation\InputBag::get()" is deprecated, and removed all three Symfony 5 deprecations as they should now be fixed.

+------------------------------------+---------+---------+
| Production Changes                 | From    | To      |
+------------------------------------+---------+---------+
| symfony/console                    | v4.4.21 | v5.2.6  |
| symfony/debug                      | v4.4.20 | REMOVED |
| symfony/dependency-injection       | v4.4.21 | v5.2.6  |
| symfony/error-handler              | v4.4.21 | v5.2.6  |
| symfony/event-dispatcher           | v4.4.20 | v5.2.4  |
| symfony/event-dispatcher-contracts | v1.1.9  | v2.2.0  |
| symfony/http-foundation            | v4.4.20 | v5.2.4  |
| symfony/http-kernel                | v4.4.21 | v5.2.6  |
| symfony/process                    | v4.4.20 | v5.2.4  |
| symfony/routing                    | v4.4.20 | v5.2.6  |
| symfony/serializer                 | v4.4.20 | v5.2.4  |
| symfony/translation                | v4.4.21 | v5.2.6  |
| symfony/validator                  | v4.4.21 | v5.2.6  |
| symfony/yaml                       | v4.4.21 | v5.2.5  |
| psr/event-dispatcher               | NEW     | 1.0.0   |
| symfony/polyfill-intl-grapheme     | NEW     | v1.22.1 |
| symfony/string                     | NEW     | v5.2.6  |
+------------------------------------+---------+---------+

+------------------------------+---------+---------+
| Dev Changes                  | From    | To      |
+------------------------------+---------+---------+
| behat/mink-browserkit-driver | v1.3.4  | dc566b2 |
| symfony/browser-kit          | v4.4.20 | v5.2.4  |
| symfony/css-selector         | v4.4.20 | v5.2.4  |
| symfony/dom-crawler          | v4.4.20 | v5.2.4  |
| symfony/filesystem           | v4.4.21 | v5.2.6  |
| symfony/finder               | v4.4.20 | v5.2.4  |
| symfony/lock                 | v4.4.21 | v5.2.6  |
+------------------------------+---------+---------+
longwave’s picture

Opened #3209239: [Symfony 5] Symfony\Contracts\EventDispatcher\Event subclasses need return types and merged it here as that is the cause of many of the test failures.

catch’s picture

longwave’s picture

Opened #3209482: [Symfony 6] Update EventDispatcherInterface type hint in FileUploadResource constructor as that is the cause of most of the rest of the test failures.

longwave’s picture

Merged in #3209459: Switch to friends of behat MinkBrowserKitDriver for PHP 8 and Symfony 5 compatibility which should hopefully get us a green test run.

Next step is to try the 5.3 beta.

longwave’s picture

Lots of failures due to this change in symfony/http-kernel: https://github.com/symfony/symfony/pull/39893/files

Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'{"message":"No route found for \u0022GET \/not-found\u0022"}'
+'{"message":"No route found for \u0022GET http:\/\/localhost\/not-found\u0022"}'
longwave’s picture

Remaining two fails are a vendor hardening issue for #3209459: Switch to friends of behat MinkBrowserKitDriver for PHP 8 and Symfony 5 compatibility and ComposerProjectTemplatesTest refusing to allow non-stable dependencies which is #3186364: Allow pre-release dependencies in Drupal pre-release milestones.

andypost’s picture

There are other deprecations but does no effect, more interesting looks new helpers on request stack to get session https://github.com/symfony/http-foundation/blob/5.x/CHANGELOG.md

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

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.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

Updated the MR to Symfony 5.3.0-beta3.

longwave’s picture

symfony/dependency-injection appears to have a hard dependency on symfony/config when running on PHP 8, I can reproduce with a minimal test case:

$ composer require symfony/dependency-injection:^5.3@beta

$ cat test.php
<?php

require 'vendor/autoload.php';

new Symfony\Component\DependencyInjection\Compiler\PassConfig();

$ php8.0 test.php
PHP Fatal error:  Uncaught Error: Class "Symfony\Component\Config\Loader\FileLoader" not found in vendor/symfony/dependency-injection/Loader/FileLoader.php:32
longwave’s picture

Raised #124 over at https://github.com/symfony/symfony/issues/41169 to see what Symfony maintainers have to say here.

longwave’s picture

The three fails are all build related, one is #3186364: Allow pre-release dependencies in Drupal pre-release milestones because we are using a Symfony beta and the other two are related to the Symfony patch but will be resolved when the patch lands in a release.

andypost’s picture

andypost’s picture

longwave’s picture

Looking at the changelog I am not sure it is worth updating here again until 5.3.0 is out or 5.4 opens.

longwave’s picture

Status: Needs work » Needs review
$ composer-lock-diff --no-links --from=origin/9.3.x
+------------------------------------+---------+------------+
| Production Changes                 | From    | To         |
+------------------------------------+---------+------------+
| symfony/console                    | v4.4.24 | v5.3.0-RC1 |
| symfony/debug                      | v4.4.22 | REMOVED    |
| symfony/dependency-injection       | v4.4.24 | v5.3.0-RC1 |
| symfony/error-handler              | v4.4.23 | v5.3.0-RC1 |
| symfony/event-dispatcher           | v4.4.20 | v5.3.0-RC1 |
| symfony/event-dispatcher-contracts | v1.1.9  | v2.4.0     |
| symfony/http-foundation            | v4.4.23 | v5.3.0-RC1 |
| symfony/http-kernel                | v4.4.24 | v5.3.0-RC1 |
| symfony/mime                       | v5.2.9  | v5.3.0-RC1 |
| symfony/process                    | v4.4.22 | v5.3.0-RC1 |
| symfony/routing                    | v4.4.24 | v5.3.0-RC1 |
| symfony/serializer                 | v4.4.24 | v5.3.0-RC1 |
| symfony/translation                | v4.4.24 | v5.3.0-RC1 |
| symfony/validator                  | v4.4.24 | v5.3.0-RC1 |
| symfony/var-dumper                 | v5.2.8  | v5.3.0-RC1 |
| symfony/yaml                       | v4.4.24 | v5.3.0-RC1 |
| psr/event-dispatcher               | NEW     | 1.0.0      |
| symfony/polyfill-intl-grapheme     | NEW     | v1.22.1    |
| symfony/string                     | NEW     | v5.2.8     |
+------------------------------------+---------+------------+

+------------------------+---------+------------+
| Dev Changes            | From    | To         |
+------------------------+---------+------------+
| symfony/browser-kit    | v4.4.24 | v5.3.0-RC1 |
| symfony/css-selector   | v4.4.24 | v5.3.0-RC1 |
| symfony/dom-crawler    | v4.4.24 | v5.3.0-RC1 |
| symfony/filesystem     | v4.4.22 | v5.3.0-RC1 |
| symfony/finder         | v4.4.24 | v5.3.0-RC1 |
| symfony/lock           | v4.4.23 | v5.3.0-RC1 |
| symfony/phpunit-bridge | v5.2.9  | v5.3.0-RC1 |
+------------------------+---------+------------+
gábor hojtsy’s picture

Issue summary: View changes

Also given #3209459: Switch to friends of behat MinkBrowserKitDriver for PHP 8 and Symfony 5 compatibility landing earlier, removing this section from the issue summary, since it is not relevant anymore as far as I understand:

Also, it is currently not possible to run browser tests on Symfony 5, since Mink browser hasn't been updated for Symfony 5 yet:

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

gábor hojtsy’s picture

Issue summary: View changes
longwave’s picture

Thanks to @effulgentsia for lots of work on #3186364: Allow pre-release dependencies in Drupal pre-release milestones which means we are finally green on this MR with an RC release of Symfony.

catch’s picture

Issue summary: View changes

catch’s picture

Symfony 5.4 is branched, so reviving this one.

Started a new branch since it's a bit easier than rebasing the old one, but only got it to the point where tests will run (various deprecated Symfony classes we have to remove references to, to even be able to run tests).

longwave’s picture

Good news that Symfony has figured out deprecation notices for return type additions, we can surely borrow this technique ourselves.

daffie’s picture

Good news that Symfony has figured out deprecation notices for return type additions, we can surely borrow this technique ourselves.

@longwave: Do you have a link for that?

longwave’s picture

@daffie: Symfony's DebugClassLoader provides this functionality; there is no documentation yet but https://github.com/symfony/symfony/pull/42623 is the PR where this was added to SF 5.4.

catch’s picture

Quite a lot of return type hint deprecation messages from Guzzle vs. PSR-7, so incorporating #3104353: Upgrade to Guzzle 7.

catch’s picture

daffie’s picture

catch’s picture

Since a lot of the new return type hints require PHP 8, we probably need a Drupal 9 issue to suppress a load of these deprecation messages (could be one issue probably).
Edit: no we don't need that, because these are 5.3/5.4 deprecations and we don't need to update to that in Drupal 9. So it's fine to have a load of PHP 8-only PHP 10-only issues. If any of these affect base class methods we might need an issue to pass them down to contrib in Drupal 9 though (although to resolve the deprecation, contrib would have to require PHP 8).

daffie’s picture

Issue summary: View changes
daffie’s picture

Issue summary: View changes
daffie’s picture

Issue summary: View changes
daffie’s picture

Issue summary: View changes
catch’s picture

Issue summary: View changes
daffie’s picture

daffie’s picture

daffie’s picture

daffie’s picture

daffie’s picture

Moved #3232095: [Symfony 6] Refactor the "update.root" service to return an object not a string over to the update module. This issue needs special attention, because it is failing update tests.

daffie’s picture

Issue summary: View changes
daffie’s picture

Issue summary: View changes
daffie’s picture

StatusFileSize
new235.18 KB

The adds Symfony 5.4-dev package and a number of yet to be committed patches:

daffie’s picture

Issue summary: View changes
StatusFileSize
new234.02 KB

Status: Needs review » Needs work

The last submitted patch, 163: 3161889-163.patch, failed testing. View results

daffie’s picture

daffie’s picture

Issue summary: View changes
andypost’s picture

longwave’s picture

Version: 9.3.x-dev » 9.4.x-dev
Status: Needs work » Needs review

What do we need to do about the non-Symfony deprecations? Is it time to add a regex to skip these?

  1x: Method "IteratorAggregate::getIterator()" will return "\Traversable" as of its next major version. Doing the same in implementation "Drupal\Core\Entity\ContentEntityBase" will be required when upgrading.
    1x in EntityNormalizerTest::testNormalize from Drupal\Tests\serialization\Unit\Normalizer

  1x: Method "ArrayAccess::offsetExists()" will return "bool" as of its next major version. Doing the same in implementation "Drupal\Core\TypedData\Plugin\DataType\ItemList" will be required when upgrading.
    1x in ListNormalizerTest::setUp from Drupal\Tests\serialization\Unit\Normalizer

I am not sure these are guaranteed true about future changes in PHP itself, and even third party packages cannot be trusted here, surely?

  1x: Method "SebastianBergmann\Comparator\ObjectComparator::accepts()" will return "bool" as of its next major version. Doing the same in child class "Prophecy\Comparator\ProphecyComparator" will be required when upgrading.
    1x in ListNormalizerTest::testNormalize from Drupal\Tests\serialization\Unit\Normalizer
catch’s picture

Those are invented by DebugClassLoader and we didn't get a good response to #3232131: [Symfony 5] Symfony's DebugClassLoader triggers deprecation messages for missing return type hints, where there is no deprecation, so skipping them seems like the only option here.

longwave’s picture

StatusFileSize
new232.92 KB
new1.06 KB

Rerolled #163 and added a deprecation skip for DebugClassLoader warnings that don't explicitly refer to Symfony classes.

longwave’s picture

StatusFileSize
new232.92 KB
new1.06 KB

Fix coding standards.

longwave’s picture

StatusFileSize
new233.14 KB
new1.28 KB

Skip another set of false positives, things like:

  1x: The "Drupal\Core\Database\StatementPrefetch::setFetchMode()" method will require a new "$a1 An option depending of the fetch mode specified by $mode:" argument in the next major version of its interface "Drupal\Core\Database\StatementInterface", not defining it is deprecated.
    1x in DrupalSqlBaseTest::testSourceProviderNotActive from Drupal\Tests\migrate_drupal\Unit\source

  1x: The "Drupal\Core\Database\Query\Select::havingCondition()" method will require a new "$value The value to test the field against. In most cases, this is a scalar. For more complex options, it is an array. The meaning of each element in the array is dependent on the $operator." argument in the next major version of its interface "Drupal\Core\Database\Query\SelectInterface", not defining it is deprecated.
    1x in DrupalSqlBaseTest::testSourceProviderNotActive from Drupal\Tests\migrate_drupal\Unit\source

  1x: The "Drupal\Core\Database\Query\Select::fields()" method will require a new "$fields An indexed array of fields present in the specified table that should be included in this query. If not specified, $table_alias.*" argument in the next major version of its interface "Drupal\Core\Database\Query\SelectInterface", not defining it is deprecated.
    1x in DrupalSqlBaseTest::testSourceProviderNotActive from Drupal\Tests\migrate_drupal\Unit\source

The interface and the implementation match in all cases as far as I can see. This might be a bug that we should report upstream to Symfony, it is misreading our docblocks somehow - looks like it might be triggered by two $variables mentioned in one @param.

edit: raised at https://github.com/symfony/symfony/issues/43936

Status: Needs review » Needs work

The last submitted patch, 177: 3161889-177.patch, failed testing. View results

longwave’s picture

Status: Needs work » Needs review
StatusFileSize
new233.49 KB

Thanks @andypost for noticing that Symfony 5.4.0-beta1 is out, rerolled for that.

+------------------------------------+---------+--------------+
| Production Changes                 | From    | To           |
+------------------------------------+---------+--------------+
| guzzlehttp/guzzle                  | 6.5.5   | 7.3.0        |
| symfony/console                    | v4.4.33 | v5.4.0-BETA1 |
| symfony/debug                      | v4.4.31 | REMOVED      |
| symfony/dependency-injection       | v4.4.33 | v5.4.0-BETA1 |
| symfony/error-handler              | v4.4.30 | v5.4.0-BETA1 |
| symfony/event-dispatcher           | v4.4.30 | v5.4.0-BETA1 |
| symfony/event-dispatcher-contracts | v1.1.9  | v2.4.0       |
| symfony/http-foundation            | v4.4.33 | v5.4.0-BETA1 |
| symfony/http-kernel                | v4.4.33 | v5.4.0-BETA1 |
| symfony/mime                       | v5.3.8  | v5.4.0-BETA1 |
| symfony/process                    | v4.4.30 | v5.4.0-BETA1 |
| symfony/routing                    | v4.4.30 | v5.4.0-BETA1 |
| symfony/serializer                 | v4.4.33 | v5.4.0-BETA1 |
| symfony/translation                | v4.4.32 | v5.4.0-BETA1 |
| symfony/validator                  | v4.4.33 | v5.4.0-BETA1 |
| symfony/var-dumper                 | v5.3.10 | v5.4.0-BETA1 |
| symfony/yaml                       | v4.4.29 | v5.4.0-BETA1 |
| psr/event-dispatcher               | NEW     | 1.0.0        |
| psr/http-client                    | NEW     | 1.0.1        |
| symfony/polyfill-intl-grapheme     | NEW     | v1.23.1      |
| symfony/polyfill-php81             | NEW     | v1.23.0      |
| symfony/string                     | NEW     | v5.3.10      |
+------------------------------------+---------+--------------+

+------------------------+---------+--------------+
| Dev Changes            | From    | To           |
+------------------------+---------+--------------+
| symfony/browser-kit    | v4.4.27 | v5.4.0-BETA1 |
| symfony/css-selector   | v4.4.27 | v5.4.0-BETA1 |
| symfony/dom-crawler    | v4.4.30 | v5.4.0-BETA1 |
| symfony/filesystem     | v4.4.27 | v5.4.0-BETA1 |
| symfony/finder         | v4.4.30 | v5.4.0-BETA1 |
| symfony/lock           | v4.4.33 | v5.4.0-BETA1 |
| symfony/phpunit-bridge | v5.3.10 | v5.4.0-BETA1 |
+------------------------+---------+--------------+
longwave’s picture

StatusFileSize
new233.49 KB

Accidentally commented out a line.

Status: Needs review » Needs work

The last submitted patch, 180: 3161889-180.patch, failed testing. View results

longwave’s picture

Status: Needs work » Needs review

Merged #180 into 3161889-symfony-5-4 and added some more third-party deprecation skips and also a few compatibility fixes.

longwave’s picture

Not sure how I marked the MR as draft, nor how I can unmark it again.

longwave’s picture

StatusFileSize
new244.64 KB

Try again with patch workflow.

daffie’s picture

Status: Needs review » Needs work

I am missing the deprecation warnings for #3232095: [Symfony 6] Refactor the "update.root" service to return an object not a string? Any idea why they are not in the patch from #184. They are in the patch from #180.

longwave’s picture

Status: Needs work » Needs review
StatusFileSize
new247.12 KB

PHPUnit didn't even run in #184 because I got my core versions mixed up. I rebuilt composer.lock with the right version and also applied the patch from #3232095: [Symfony 6] Refactor the "update.root" service to return an object not a string.

Status: Needs review » Needs work

The last submitted patch, 186: 3161889-186.patch, failed testing. View results

longwave’s picture

Status: Needs work » Needs review
StatusFileSize
new262.45 KB

This patch removes the legacy event dispatcher and MIME type guesser support, which are failing because they are gone from Symfony 5.4. Also fixed a few other minor issues along the way.

Drupal\Tests\Core\Routing\RouterTest fails with

PHP Fatal error:  '\static' is an invalid class name in /var/www/html/drupal/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassCreator.php(49) : eval()'d code on line 8

Prophecy does not yet support static return type, this is tracked at https://github.com/phpspec/prophecy/issues/527

Status: Needs review » Needs work

The last submitted patch, 188: 3161889-188.patch, failed testing. View results

daffie’s picture

StatusFileSize
new329.7 KB

Just 3 fails left with the testbot. One is because we are not using a stable release with Symfony. The other 2 are because we are waiting for a fix with phpspec/prophecy-phpunit. See: https://github.com/phpspec/prophecy/issues/527

daffie’s picture

andypost’s picture

FYI SF released beta 3

longwave’s picture

Status: Needs work » Needs review
StatusFileSize
new248.04 KB

Reroll for latest changes and Symfony 5.4 beta3

Status: Needs review » Needs work

The last submitted patch, 196: 3161889-196.patch, failed testing. View results

daffie’s picture

Status: Needs work » Needs review
StatusFileSize
new253.21 KB
new5.19 KB

Fix for the failures in the patch from comment #196. They are all ckeditor5 related.

The last submitted patch, 198: 3161889-198.patch, failed testing. View results

daffie’s picture

daffie’s picture

Issue summary: View changes

Added the problem with Prophecy with the "static" return type hint. See: https://github.com/phpspec/prophecy/issues/527.

daffie’s picture

daffie’s picture

StatusFileSize
new2.03 KB
new250.59 KB

Fix the failures with Prophecy with "static" return type hinting.

daffie’s picture

StatusFileSize
new250.05 KB

Fix for the style code violation.

daffie’s picture

Issue summary: View changes
gábor hojtsy’s picture

Reparenting to #3251854: [META] Requirements for tagging Drupal 10.0.0-alpha1 which is where we plan to solve this now. Issue summary only lists things to do on the Drupal 10 branch which is open for business now :)

gábor hojtsy’s picture

Opened #3252757: Update Drupal 10 to depend on Symfony 6.0 to do the actual update later. That though will not happen in alpha1 as we plan to update to 5.4 in alpha1 and later update to 6.0, so people can use alpha1 as a deprecation testing target.

catch’s picture

Just saving the issue summary to see where we are.

daffie’s picture

Issue summary: View changes
daffie’s picture

Issue summary: View changes
daffie’s picture

Issue summary: View changes
catch’s picture

Issue summary: View changes
gábor hojtsy’s picture

Issue summary: View changes

The two listed must haves were committed.

gábor hojtsy’s picture

Issue summary: View changes

Adding #3255245: [Symfony 6] Revert 3231603 to use our own TranslatorInterface as must-have since the other two must haves also landed.

catch’s picture

Issue summary: View changes

I've moved #3258380: [Symfony 6][Second try] A number of methods of the class Drupal\Core\TypedData\Validation\ExecutionContext are considered internal and Drupal should not override them. to a should-have. It's something that might cause problems in the future, but it's not deprecated for removal, so doesn't actually stop us updating to Symfony 6.

gábor hojtsy’s picture

longwave’s picture

I tried an experimental update to Symfony 6 but failed because of a dependency clash:

    - drupal/core 10.0.x-dev requires stack/builder ^1.0 -> satisfiable by stack/builder[v1.0.0, ..., 1.0.x-dev].
    - stack/builder[v1.0.6, ..., 1.0.x-dev] require symfony/http-foundation ~2.1|~3.0|~4.0|~5.0 -> satisfiable by symfony/http-foundation[v2.1.0, ..., 2.8.x-dev, v3.0.0-BETA1, ..., 3.4.x-dev, v4.0.0-BETA1, ..., 4.4.x-dev, v5.0.0-BETA1, ..., 5.4.x-dev].

Core uses stack/builder but that only currently supports Symfony 2.x through 5.x: https://github.com/stackphp/builder/blob/master/composer.json#L14-L15

catch’s picture

Posted https://github.com/stackphp/builder/pull/29

edit: longwave posted https://github.com/stackphp/builder/pull/30

edit again: Added #3258902: [Symfony 6] Bring stackphp/builder into core for Symfony 6 compatibility and remove it as a dependency to track this.

We probably won't actually update to Symfony 6 until we've released an alpha with all/most Drupal deprecations removed. To unblock prep work we can probably point to longwave's fork in patches/MRs for now.

longwave’s picture

StatusFileSize
new90.84 KB
$ composer-lock-diff --no-links
+-------------------------------+--------+---------+
| Production Changes            | From   | To      |
+-------------------------------+--------+---------+
| asm89/stack-cors              | v2.0.5 | v2.1.0  |
| psr/container                 | 1.1.2  | 2.0.2   |
| stack/builder                 | v1.0.6 | 0a4fbb7 |
| symfony/console               | v5.4.2 | v6.0.2  |
| symfony/dependency-injection  | v5.4.2 | v6.0.2  |
| symfony/deprecation-contracts | v2.5.0 | v3.0.0  |
| symfony/error-handler         | v5.4.2 | v6.0.2  |
| symfony/event-dispatcher      | v5.4.0 | v6.0.2  |
| symfony/http-foundation       | v5.4.2 | v6.0.2  |
| symfony/http-kernel           | v5.4.2 | v6.0.2  |
| symfony/mime                  | v5.4.2 | v6.0.2  |
| symfony/process               | v5.4.2 | v6.0.2  |
| symfony/routing               | v5.4.0 | v6.0.1  |
| symfony/serializer            | v5.4.2 | v6.0.2  |
| symfony/service-contracts     | v2.5.0 | v3.0.0  |
| symfony/validator             | v5.4.2 | v6.0.2  |
| symfony/var-dumper            | v5.4.2 | v6.0.2  |
| symfony/yaml                  | v5.4.2 | v6.0.2  |
+-------------------------------+--------+---------+

+------------------------+--------+---------+
| Dev Changes            | From   | To      |
+------------------------+--------+---------+
| behat/mink             | v1.9.0 | a91ab98 |
| composer/composer      | 2.2.4  | 2.1.12  |
| symfony/browser-kit    | v5.4.2 | v6.0.1  |
| symfony/css-selector   | v5.4.2 | v6.0.2  |
| symfony/dom-crawler    | v5.4.2 | v6.0.2  |
| symfony/filesystem     | v5.4.0 | v6.0.0  |
| symfony/finder         | v5.4.2 | v6.0.2  |
| symfony/lock           | v5.4.2 | v6.0.2  |
| symfony/phpunit-bridge | v5.4.0 | v6.0.0  |
+------------------------+--------+---------+

As noted in #220 this requires a modified stack/builder for the time being.

At least one unit, kernel and functional test passed with the attached patch, but I expect a large number of fails here.

It turns out that the Symfony return type checker skips the cases where we provided our own docblock instead of using inheritdoc, so there's a whole bunch more return types to add.

longwave’s picture

StatusFileSize
new91.86 KB

run-tests.sh still uses the deprecated app.root service, opened #3258995: run-tests.sh uses the deprecated app.root service

longwave’s picture

StatusFileSize
new100.14 KB

A few more fixes, will spin some of these out to individual issues soon.

longwave’s picture

daffie’s picture

Status: Needs review » Needs work
+++ b/core/lib/Drupal/Core/Command/DbToolsApplication.php
@@ -19,7 +19,7 @@ public function __construct() {
+  protected function getDefaultCommands(: array {

This change is missing ")", just before ": array"

longwave’s picture

Status: Needs work » Needs review
StatusFileSize
new106.36 KB
new12.05 KB

Thank you @daffie, fixed here plus another round of fixes.

Not sure what to do about Router::matchCollection(), where we declare:

   * @return array|null
   *   An array of parameters. NULL when there is no match.

but the parent return type is now just array and NULL is not allowed. Maybe we have to use exceptions instead?

     * @throws ResourceNotFoundException If the resource could not be found
longwave’s picture

StatusFileSize
new106.36 KB

Status: Needs review » Needs work

The last submitted patch, 227: 3161889-227.patch, failed testing. View results

longwave’s picture

Status: Needs work » Needs review
StatusFileSize
new102.98 KB

Another round. The following still need work:

  • Composer doesn't yet have a released version that fully supports symfony/console 6, I assume this will be Composer 2.3.
  • Composer tests are also failing because we have two dev branches in composer.lock, this will go away when we resolve the issues with stack/builder and Behat.
  • asm89/stack-cors needs updating for Symfony 6 but now one of the CORS tests fails.
  • PhpArrayDumperTest is failing for service references, I guess Symfony changed something?
daffie’s picture

StatusFileSize
new106.46 KB

The patch updates all Symfony packages to version 6.0, with the exception of "symfony/console". Composer is extending classes from the package "symfony/console" and Composer has not yet added the required return type hints.
Second is that the package "behat/mink" now must use the "dev-master" version. Therefor the test ComposerProjectTemplatesTest needs a couple of temporary fixes.

daffie’s picture

StatusFileSize
new106.47 KB

Style guide fixes.

Status: Needs review » Needs work

The last submitted patch, 232: 3161889-232.patch, failed testing. View results

longwave’s picture

While it makes the tests pass I am not sure the fix to PhpArrayDumperTest is correct, we need to understand if service references have changed somehow in Symfony 6.

daffie’s picture

While it makes the tests pass I am not sure the fix to PhpArrayDumperTest is correct, we need to understand if service references have changed somehow in Symfony 6.

The change to the test core/tests/Drupal/Tests/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumperTest.php is necessary, because of the added parameter type hint to the method Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::set().

In Symfony 5.4 it is:

public function set(string $name, $value) {
  $this->parameters[$name] = $value;
}

In Symfony 6.0 it has changed to:

public function set(string $name, array|bool|string|int|float|null $value) {
  $this->parameters[$name] = $value;
}

In Symfony 6.1 it will changed to:

public function set(string $name, array|bool|string|int|float|\UnitEnum|null $value) {
  $this->parameters[$name] = $value;
}

The parameter $value has the value to an instance of Symfony\Component\DependencyInjection\Reference and an object is not part of the added parameter type hint.

longwave’s picture

@daffie thanks for the explanation. So I guess the question is: do we actually need to support service references as container parameters? If not, I think we should just drop this test case from the data provider as it makes no sense:

        [
          ['reference' => new Reference('referenced_service')],
          ['reference' => $this->getServiceCall('referenced_service')],
          TRUE,
        ],

I went back to the original commit and issue for this and found that this code was added in #2497243-154: Replace Symfony container with a Drupal one, stored in cache. Next step is to figure out if this was a nice-to-have at the time or if this was a Symfony feature that we ported over.

My suspicion is that we don't need to support this any more, as as you found container parameters cannot be objects (as opposed to services which must now be objects, as we found a while back with the app.root service).

longwave’s picture

Did a bit more research into the Symfony side of things. As far as I can see Symfony has never supported objects in ParameterBags; for example here is their test fixture from Symfony 3.4: https://github.com/symfony/dependency-injection/blob/3.4/Tests/Fixtures/...

As far as I can see we have never had a use for feature that in core either, so to me the correct fix here is to drop that test case from the data provider.

longwave’s picture

Looks like this is actually inconsistent in Symfony!

The PHP dumper does not support references here:

https://github.com/symfony/dependency-injection/blob/6c566c7b29e36daa806...

            } elseif ($value instanceof Reference) {
                throw new InvalidArgumentException(sprintf('You cannot dump a container with parameters that contain references to other services (reference to service "%s" found in "%s").', $value, $path.'/'.$key));

but the YAML dumper does support them:

https://github.com/symfony/dependency-injection/blob/6c566c7b29e36daa806...

            } elseif ($value instanceof Reference || \is_string($value) && str_starts_with($value, '@')) {
                $value = '@'.$value;
            }
longwave’s picture

StatusFileSize
new83.07 KB

Similar to the way we switched from behat/mink-browserkit-driver to friends-of-behat/mink-browserkit-driver, we can do the same for behat/mink to friends-of-behat/mink where there is a PHP 8/Symfony 6 compatible release already.

I also added the patch from #3262853: [Symfony 6] Drop support for services as container parameters which should be the only outstanding blocker.

Note that symfony/console is still on 5.x because there is no stable release of Composer that supports Symfony 6.

+-------------------------------+--------+--------+
| Production Changes            | From   | To     |
+-------------------------------+--------+--------+
| asm89/stack-cors              | v2.0.5 | v2.1.1 |
| psr/container                 | 1.1.2  | 2.0.2  |
| symfony/console               | v5.4.2 | v5.4.3 |
| symfony/dependency-injection  | v5.4.2 | v6.0.3 |
| symfony/deprecation-contracts | v2.5.0 | v3.0.0 |
| symfony/error-handler         | v5.4.2 | v6.0.3 |
| symfony/event-dispatcher      | v5.4.0 | v6.0.3 |
| symfony/http-foundation       | v5.4.2 | v6.0.3 |
| symfony/http-kernel           | v5.4.2 | v6.0.4 |
| symfony/mime                  | v5.4.2 | v6.0.3 |
| symfony/process               | v5.4.2 | v6.0.3 |
| symfony/routing               | v5.4.0 | v6.0.3 |
| symfony/serializer            | v5.4.2 | v6.0.3 |
| symfony/service-contracts     | v2.5.0 | v3.0.0 |
| symfony/string                | v6.0.2 | v6.0.3 |
| symfony/validator             | v5.4.2 | v6.0.3 |
| symfony/var-dumper            | v5.4.2 | v6.0.3 |
| symfony/yaml                  | v5.4.2 | v6.0.3 |
+-------------------------------+--------+--------+

+------------------------+--------+---------+
| Dev Changes            | From   | To      |
+------------------------+--------+---------+
| behat/mink             | v1.9.0 | REMOVED |
| symfony/browser-kit    | v5.4.2 | v6.0.3  |
| symfony/css-selector   | v5.4.2 | v6.0.3  |
| symfony/dom-crawler    | v5.4.2 | v6.0.3  |
| symfony/filesystem     | v5.4.0 | v6.0.3  |
| symfony/finder         | v5.4.2 | v6.0.3  |
| symfony/lock           | v5.4.2 | v6.0.3  |
| symfony/phpunit-bridge | v5.4.0 | v6.0.3  |
| friends-of-behat/mink  | NEW    | v1.10.0 |
+------------------------+--------+---------+
daffie’s picture

Similar to the way we switched from behat/mink-browserkit-driver to friends-of-behat/mink-browserkit-driver, we can do the same for behat/mink to friends-of-behat/mink where there is a PHP 8/Symfony 6 compatible release already.

@longwave: Sounds as a great idea. Do you have an issue for it?

daffie’s picture

longwave’s picture

gábor hojtsy’s picture

Published the change record draft, since it was for 9.3.0 already: https://www.drupal.org/node/3236232

Also in #3252757: Update Drupal 10 to depend on Symfony 6.0 @longwave says there is nothing actionable left in this one. I guess that will be proven in part based on the test runs there.

xjm’s picture

Status: Needs work » Fixed

It's in!

Any followups should be re-parented to #3118149: [meta] Requirements for tagging Drupal 10.0.0-beta1.

Thanks everyone; this is awesome!

Status: Fixed » Closed (fixed)

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