Problem/Motivation
Drupal 9 will release with Symfony 4.4, see #3009219: Update Symfony to 4.4 in Drupal 9.0. In order to be able to do that, we should make Drupal 8 compatible with Symfony 4.4 first as much as possible. We cannot allow Symfony 4.4 to be installed from a simple composer update command, as current ways to install Drupal with composer would not protect production sites from switching to Symfony 4.4 which is unintended. That also means that until there is a Drupal 9 branch, there will be no easy way to test contrib with Symfony 4.4.
Proposed resolution
- Resolve and commit the remaining issues needed to make Symfony 4 pass tests.
- Provide a script or instructions on how to adjust the various
composer.jsonfiles for those adventurous souls who wish to try it with contrib, but it should not happen by default on a simple update.
Focus on Symfony 4.4 here. All Symfony 5 releated work is in #3055180: [META] Symfony 5 compatibility.
Remaining tasks
The following outstanding issues must be resolved to make the tests pass:
- A test fail related to apcu caching on the testbot whose solution is still being determined.
User interface changes
None.
API changes
Symfony 4.4 API will be supported.
Data model changes
None
Release notes snippet
Drupal now supports Symfony 4.4.
| Comment | File | Size | Author |
|---|---|---|---|
| #270 | interdiff.2976394.268-270.txt | 18.74 KB | mikelutz |
| #270 | 2976394-270.drupal.Plus3074585.patch | 207.98 KB | mikelutz |
| #270 | 2976394-270.drupal.RevertAPCU change.patch | 192.4 KB | mikelutz |
| #268 | interdiff.2976394.260-268.txt | 252.16 KB | mikelutz |
| #268 | 2976394-268.drupal.Allow-Symfony-44-to-be-installed-in-Drupal-8.patch | 192.95 KB | mikelutz |
Comments
Comment #2
martin107 commentedComment #3
martin107 commentedThe is far from the last word in Drupal8's construction of a response to Symphony4
It really is a mad slash with a chain saw ..
but hey "drush site install" works! which was unexpected.
here is
composer install
Comment #4
martin107 commentedThat was unexpected, so looking for problem I did some digging
Taking one symfony component as a signal that things have gone wrong
locally when I reported the updates above I see
but in the build artifact
https://dispatcher.drupalci.org/job/drupal_patches/59880/consoleText
I see
Which means that I did not trigger the change I wanted ... oh rats
Just compiling changes here for the next iteration
php -- we should force the version to be 7.x as that is a given for Drupal9
twig -- needs to be adjusted to be updated .. as it may affect the decision tree for some symfony components
Also but not sure -- does that rule apply for doctrine as well ?
back to the drawing board
Comment #5
martin107 commentedThis may require a special testbot run for the changes here to be picked up ... but in this comment I am going to focus on changes to the repo only.
A) Looking at the link below I have driven the php version up to >=7.1.3
https://symfony.com/doc/current/reference/requirements.html
B) I have relaxed more symfony component to *
I am also going to hold back on changes to twig and doctrine .. because I want to identify response to small changes and to slowly build up to a more complete solution.
Comment #6
catchThe reason the testbot isn't picking up changes is because the patch is only to composer.json - composer.lock is also in version control, so needs to be updated too here, then it should explode as expected.
Also, thanks for picking this up!
Comment #7
martin107 commentedThanks, that was clumsy of me.
composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 6 updates, 0 removals
- Updating symfony/debug (v3.4.11 => v4.1.0): Downloading (100%)
- Updating symfony/http-kernel (v3.4.11 => v4.1.0): Downloading (100%)
- Updating symfony/routing (v3.4.11 => v4.1.0): Downloading (100%)
- Updating symfony-cmf/routing (1.4.1 => 2.1.0-RC1): Downloading (100%)
- Updating symfony/css-selector (v3.4.11 => v4.1.0): Downloading (100%)
- Updating symfony/phpunit-bridge (v3.4.11 => v4.1.0): Downloading (100%)
symfony-cmf/routing -> 2.1.0-RC1 ... Release candidate one ... that is funny. ( well makes me smile )
Comment #9
martin107 commentederr this is what I mean.
Comment #11
martin107 commentedThe php7.2 test output is the only thing worth looking at
Here is a potted summary of errors I can see
A) Most are of the form :-
B) I can see about 30 errors which seems related to Symfony4 routing changes.
Here is one test in particular which fails hard.
Drupal\KernelTests\Core\Routing\RouteProviderTest with 17 fails.
Comment #12
martin107 commentedRegarding #11B
As symfony jumpes from 3.2 to 4.0 auto handling of utf8 routes was deprecated ( made explicit )
We can sweep all auto handling out of D8 core code in preparation for D9 today
Here is a issue that reflects that thought.
Comment #13
martin107 commentedA common pain point to many errors is AssertLegacyTrait.php
#2970831: Fix "AssertLegacyTrait::getRawContent() is scheduled for removal in Drupal 9.0.0. Use $this->getSession()->getPage()->getContent() instead."
#2970052: Fix "assertNoPattern() is deprecated and scheduled for removal in Drupal 9.0.0. Use $this->assertSession()->responseNotMatches($pattern) instead"
So my cunning plan is to rerun testbot on this patch after getting those two issues home..
I don't think future analysis is productive until then.
Comment #14
martin107 commentedThe latest patches associated with those issue are now passing... so I am applying those ontop of that from #9
Let us see what shakes.
Comment #17
martin107 commenteda) #2970831: Fix "AssertLegacyTrait::getRawContent() is scheduled for removal in Drupal 9.0.0. Use $this->getSession()->getPage()->getContent() instead." has landed.
b) Drupal D.7.x is now the development target.
c) Since I last posted, to my mind a lot of work has going into resolving technical debt.
so I am starting over with a new patch :-
Setting all symfony sub components to * in composer.json
"composer clear-cache" because annoyingly I have discovered this can sometimes affect the dependency calculations
"composer install" to update composer.lock
and then pushing the patch
I expected the responseNotMatches() issue to linger ( see #14) ... but the resulting catalog of errors might usefully expose something new.
I can say that Drupal install works and the standard landing page appears ..
I can login and see the admin menu bar... the status report page, but that is about the limit of my manual testing
Comment #18
martin107 commentedMy bad ....
now with composer update
Comment #19
martin107 commentedA partial summary of what has been updated
symfony/class-loader v3.4.15
symfony/http-foundation v3.4.15
symfony/console: v4.1.4
symfony/http-kernel v4.0.14
Comment #21
martin107 commentedI have been able to relate many, if not all, of the errors back to a known issue.
#2948700: Casting $text value to string in responseContains/responseNotContains methods
assertRaw() containing t() calls -- is what I see in many failures.
quoting from the issue
which will cause
Anyway I hope this is useful insight.
Comment #22
jibranIt would be great if we can try the combined patch from #2948700: Casting $text value to string in responseContains/responseNotContains methods and this issue.
Comment #23
martin107 commentedI think my bias is clear ... I want D9 as soon as possible.
but I listen to and find rational the broader community consensus that D9 will take more time...
IF we could find a way partial way of adopting symfony/http-kernel v4.0.14 -- while holding other symfony component at 3.x ... then that would fit the aim of doing as much as possible in D8
But my voice is just one and my analysis is not too deep... and others might kick in reasonable objections.
In short I will help out on the other issue where possible.
Comment #24
martin107 commentedAs per jibran suggestion:
This next patch is just a test of my thinking that most of the errors can be solved if the patch from
#2948700: Casting $text value to string in responseContains/responseNotContains methods
is applied after the patch from this issue ( see #18 )
Comment #26
martin107 commentedThis issue is looking for the unexpected...
So the good news is that the 64 fails can be mapped to this existing issue.
#2961688: Fix "Using UTF-8 route patterns without setting the "utf8" option" deprecation
It is an issue .. which I think has been pushed to completion...it does now need a little review.
If anyone has a pet issue which is in need of attention....I am up for trading reviews :)
Comment #27
jibranLet's create another combine patch with the utf8 issue also upload the review the only patch which I assume is uploaded in #18.
Comment #28
martin107 commentedThe patch from #24 is now outdated ( this was committed #2948700: Casting $text value to string in responseContains/responseNotContains methods )
So regarding #27 I am folding in the utf-8 issue ( 2961688-9.patch )
onto the patch from our last known good patch 2976394-18.patch
Comment #30
martin107 commentedThere are several errors in the test results of this form
I am just pooling information here, so others do not have to ... in Drupal land this is a known issue
here is a change record.
https://www.drupal.org/node/2959408
Here is the Symfony4 upgrade documentation
https://github.com/symfony/symfony/blob/4.1/UPGRADE-4.0.md
I am still forming an opinion as to the best way forward
As always I want to map problems back to existing D8.7 issues -- this seems to be the closest.
#2916310: Deprecate Drupal core ArgumentsResolver class?
Comment #31
martin107 commented1)
After looking I don't think there much doing in regard to resolving the getArguments in D8 for D9.
Every way forward involves breaking changes.
thinking about the drush submodule
Drush\Drupal\DrupalKernel extends Drupal\Core\DrupalKernel
It would be appropriate to signal to contrib that the arguments of the DrupaKernel constructor are deprecated/scheduled for change in D9... but there a hundred of D9 design decisions to be made I can't predict the final shape of the constructor to say anything meaningful.
2)
There are several errors of this form
This annotation below is apposite ... does anyone know if there is a quick code trick to prevent testbot from running through legacy code ?
Comment #32
martin107 commentedThe interdiff is unreviewable
I am just including phpunit.xml file which differs from phpunit.xml.dist in only one regard
‘Messrs Moony, Wormtail, Padfoot and Prongs’ solemnly swear they are up to no good - when they turn off legacy tests.
Comment #34
catchIt's fine to deprecate constructor arguments and trigger the deprecation in a minor, and a change record is enough. It doesn't matter if the constructor changes again in another minor.
Comment #35
martin107 commentedWhen I read the Symfony blogs -- suggesting that for large complex applications, Symfony4 is twice as fast.
There seem to be three key area for the gains.
1) A refactoring of routing, a better understanding based on simultaneous parsing of a single mega regular expression
https://symfony.com/blog/new-in-symfony-4-1-fastest-php-router
2) A side effect of autowiring, which means that orphaned services, which is not utilised/called get automatically left out of the compiled services definition.
3) Just the fact of dropping all their legacy code.
a) less parsing given a reduced code footprint,
b) less branching to contend with.
c) the new way was designed specifically 'cos it was faster.
I don't claim to have encyclopedic knowledge of all the architecture and performance reasons for departing from the Symfony kernel...
But to me, given 1 and 2 and maybe 3 means that as a group we need to profile/benchmark again for D9 ... I don't want to speak heresy.. but maybe the DrupalKernel simply goes away after we pick up symfony4
or at least looks so different that all the pre optimisation and deprecation that I want to do here is just meaningless.
Comment #36
catchWe don't actually use Symfony's routing logic at all at this point, just some interfaces and the Route class.
This was done to be scalable with large number of routes (i.e. the problem they claim to have solved). So any comparison would have to be between our database-based router and the new version of Symfony's router - i.e. it will require a separate issue to undo our customisations and then test.
Comment #37
martin107 commentedThank you for fixing my broken thinking..
My attempts to turn off legacy tests failed miserably....Many of the failing tests are legacy test but I have found and corrected a non legacy test...
Drupal\Tests\Core\EventSubscriber\CustomPageExceptionHtmlSubscriberTest::testHandleWithPostRequest
TypeError: Argument 3 passed to Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent::__construct() must be of the type integer, string given, called in /var/www/html/core/tests/Drupal/Tests/Core/EventSubscriber/CustomPageExceptionHtmlSubscriberTest.php on line 141
I have spun off a new issue.
Comment #39
martin107 commentedI have broadened the scope of
#2997771: GetResponseForExceptionEvent: Prepare for Drupal9
that fixes more issues here... now I just feeding back the results. Here is a list of the files affected.
core/modules/serialization/tests/src/Unit/EventSubscriber/DefaultExceptionSubscriberTest.php
core/tests/Drupal/Tests/Core/EventSubscriber/ExceptionJsonSubscriberTest.php
core/tests/Drupal/Tests/Core/EventSubscriber/FinalExceptionSubscriberTest.php
Comment #41
jibranSome of the fails in the last patch have been fixed in #2992113: Update core dependencies before 8.6.2
Comment #42
martin107 commentedCool thanks for the info....
just for the record .. it is the "Content-Disposition" stuff.
Comment #43
andypostWhat about rewrite
\Drupal\Core\DrupalKernel::initializeSettings()which using deprecated\Symfony\Component\ClassLoader\ApcClassLoaderref https://symfony.com/doc/3.3/components/class_loader/cache_class_loader.htmlIt means whole
symfony/class-loaderdependency must be removedComment #44
andypostLooks related issue could be fixed in minor release but not sure about removal of dependency
Comment #45
tim.plunkettSee also #2917331: Decouple from Symfony CMF
Comment #46
martin107 commentedandypost, tim.plunkett thank you for broadening my perspective.
In previous patches, I had folded in issues that are now fixed. Plus I had some dead code that did not do what I wanted.
So I am starting again - with only changes to composer.lock core/composer.json and core/composer.lock
I am still expecting lots of failures - but with so many recent changes I am curious, again, to know the state of play.
Comment #48
catchNice. Remaining fails are variations on this:
If we can make the assertion a bit more agnostic that might be enough?
Comment #49
martin107 commenteda)
This relates to #41-#42 so I am just going to wait for
#2992113: Update core dependencies before 8.6.2
which is RTBC
b)
The changes here are a response to #43 which pointed out that the tail of
\Drupal\Core\DrupalKernel::initializeSettings()
contains calls to three deprecated classloaders ... which are dropped in favour of an entry in a composer config section.
Comment #51
voleger#48 - #3001542: Update Guzzle from 6.3.0 to 6.3.3
Comment #52
martin107 commentedReroll.
Comment #54
andypostLooks only classloader & #48 tests are need fix now
Comment #55
martin107 commentedreroll.
Comment #57
wim leers#48: interesting failure! I agree with .
… at least I agreed based on the assumption that a Symfony change caused the exception message to change. But both exceptions (and their messages) are thrown by Drupal code (
\Drupal\file\Plugin\rest\resource\FileUploadResource::validateAndParseContentDispositionHeader()). Which means that Symfony changed something.This is the relevant code:
So the test failures are occurring because a request with
Foo:had$request->headers->has('foo')return FALSE in Symfony 3 but TRUE in Symfony 4.Comment #59
wim leersFrom 8 to 4 failures. #57 worked :) The remaining 4 failures are in the class loader, composer integration and kernel.
Comment #60
andypostBoth versions mostly identical, the only change in SF not related to has() implementation
Comment #61
catchThe DrupalKernel test failure is testing for the apcu classloader which we no longer attempt to register, so we probably just need to remove that test entirely.
Also
For the purposes of this we need to bump our PHP requirements to 7.1, another option would be to remove that test.
Theoretically gets us down to two fails. Also had to re-roll a composer.json change.
Comment #62
catchRe #57 we already had to deal with a similar issue in #2992113-17: Update core dependencies before 8.6.2.
Comment #65
catchActual PHP requirement needs to be 7.1.3 not 7.1.
Comment #66
wim leersAha, my bad! It's introduced by Guzzle
6.3.0->6.3.3then.Comment #68
berdirDo we need to test the impact of this somehow? Or find an alternative?
I imagine a lot of users aren't going to be using --optimize-classloader. At the same time, wondering if it might actually be faster without this for those that *do*, or did we already skip it then, not sure I fully understand the check here righ tnow.
One thing though, if we remove this, we can also remove "$class_loader_class = get_class($this->classLoader);" a few lines above.
Comment #69
catch@Berdir: "Do we need to test the impact of this somehow? Or find an alternative?"
The patch currently does this, but yeah we need to see what's going on and might have to make our own apcu classloader if this is no good.
Nothing stops us adding our own apcu classloader to 8.x if we need to.
Comment #70
catchThis is what's left and a real problem:
Comment #71
andypost@catch does it mean that 8.x should use some shim/bridge to current classloader interface while 9.x should be composer-based #1818628: Use Composer's optimized ClassLoader for Core/Component classes where in #95 I filed that apcu is not the best now
Probably better to deprecate
class_loader_auto_detectsettings?Comment #72
catch@andypost not sure yet, we should open an issue to discuss this separately from this one, but just a note #2704571: Add an APCu classloader with a single entry has been open for two years and needs reviews.
Comment #73
catchI'm unable to reproduce the fail in #70 locally, would be useful if someone else could try running that with the latest patch.
Comment #74
dawehnerThis change looks like something which could be a problem in more spaces, we just don't have the needed test coverage.
Comment #75
catchComment #76
gábor hojtsyComment #77
jibranIf we are bumping PHP version here then #2992116: Bump core dependencies minimum version to PHP 7.0 is a duplicate.
Comment #78
martin107 commented.. then xyz is a duplicate.
When I created this issue I wanted this to be a simple test - a pipe cleaning exercise exercise - which we need to periodically update and recheck.
The PHP bump occurs here only out of necessity- to get the thing to work.
Bumping the PHP version as a candidate for committing ( Which I support ) should be dealt with as a separate isolated issue.
Comment #79
martin107 commentedSorry my time for open source is limited at the moment
but given Symfony 5 is the thing we really want!
From https://dri.es/plan-for-drupal-9
When I find the time I want to re-jig our composer files and pull the latest version of Symfony5 dev -- not yet released.
Maybe someone want to beat me to it?
Comment #80
gábor hojtsy@martin107: there is not even a branch yet for Symfony 5 at https://github.com/symfony/symfony! As per the same blog post, let's focus on supporting Symfony 4 as a stepping stone to Symfony 5, so we don't need to do all the work at closer to the finish line and frontload some effort as much as we can. The Symfony 5 issue is at #3009255: [META] Symfony 5.0 compatibility by the way.
Comment #81
catchFor now I re-rolled over at #3020303: Consider using Symfony flex to allow switching between major Symfony versions and discovered new test failures due to newly introduced deprecations in Symfony 4.2.
Comment #82
catchCross-post - and agreed with Gabor. Symfony 5 will probably branch around the same time as Symfony 4.4 does, until then we need to track Symfony 4 minor updates which we may also have to adapt for.
Comment #83
catchOK there are multiple new issues introduced with Symfony 4.2, so moving back here to flush them out, but will keep opening sub-issues.
Current state of the patch:
1. Keeps symfony-classloader pinned at 3.4, that's all we need to do to enable Symfony 4, although we'll need to replace it in time for 9.x in #3020296: Remove Symfony's classloader as it does not exist in Symfony 4
2. Incorporates the patch from #3020385: Symfony 3 and Symfony ^4.2 JsonEncode constructors are incompatible.
3. Incorporates #3020301: Remove composer integration PHP version test (rely on DrupalCI PHP version runs instead).
I'm adding these as children under #2937984: [META] Symfony 4.0 compatibility.
Comment #84
catchComment #86
catchNew combi patch - I'm splitting out sub-issues as I go, so see the child issues of #2937984: [META] Symfony 4.0 compatibility for specifics.
Comment #87
catchAnd with #3020550: Passing commands as a string to Process is deprecated in Symfony 4.
Comment #90
catchIncorporating #3020579: TypeError: Argument 3 passed to Symfony\Component\HttpKernel\Event\FilterResponseEvent::__construct() must be of the type integer, string given [Symfony 4]
Comment #92
jibranAre planning to commit this patch to D8 at some point? Can we please make the expectation clear in IS? Because as it stands composer install is failing on PHP 7.0 which means we can't commit this patch to Drupal 8.8 unless we fix it.
Comment #93
catchOnly the spin-off issues should be committed, this issue is mostly for testing. I updated the issue summary.
Comment #94
catchRe-rolled.
Comment #96
catchDoctrine needs to be at 2.10.
Comment #98
catchNow including #3021236: Page cache test fails with Symfony 3.4.19 and above.
Comment #99
catchThis now just contains the composer changes and #3020301: Remove composer integration PHP version test (rely on DrupalCI PHP version runs instead).
Comment #101
catchRe-rolled. Will still fail with one test failure until #3020301: Remove composer integration PHP version test (rely on DrupalCI PHP version runs instead) lands.
Comment #103
effulgentsia commentedI committed #3020301: Remove composer integration PHP version test (rely on DrupalCI PHP version runs instead) and queued a retest.
Comment #104
effulgentsia commentedDoesn't look like every component got updated to 4.x for the test run. E.g.,
And others.
Comment #105
catchA few components are still specifying <4.0.0 so we need to update those too. Good spot. New patch.
Comment #107
catchCruft.
Comment #108
catchAnd including #2961861: Remove usage of WriteCheckSessionHandler.
Comment #111
gábor hojtsyLooking at various fails, this pattern is repeating:
There are also other fails, some of which look like could be side effects of this (ie. when a webtest checks site output and the page fails with the exception).
Comment #112
catchOpened #3027835: [symfony 4] Argument 1 passed to Symfony\Component\HttpFoundation\Response::setCharset() must be of the type string, null given with a patch.
Comment #113
gábor hojtsyThat uncovered two more issues:
#3027871: [symfony 5] Symfony\Component\Validator\Constraints\Email::$strict property is deprecated since Symfony 4.1
and
#3027872: [symfony 4] The default value of the "$secure" and "$samesite" arguments of "Symfony\Component\HttpFoundation\Cookie::__construct"'s constructor will change
Those two "only" result in a total of 269 fails.
Comment #114
jibranUploading the combine patch with #3027871: [symfony 5] Symfony\Component\Validator\Constraints\Email::$strict property is deprecated since Symfony 4.1
Comment #115
jibranShould we upgrade these libraries as well?
Comment #116
catchThere's a lot of errors like
No time to spin an issue out right now though, but that seems like it'd clear a lot of the remaining 200 maybe.
Comment #117
gábor hojtsy@jibran: re #115 I think so yeah. Now that #3027871: [symfony 5] Symfony\Component\Validator\Constraints\Email::$strict property is deprecated since Symfony 4.1 landed, this will need a reroll. That in itself will not raise new issues, but #115 may.
@catch: interesting, most fails are in messages, but I don't see the pattern, so not sure what to open an issue about. This message fail from a JS test may help find the reason:
Comment #118
jibranAddressed #115.
Comment #120
gábor hojtsyOpened #3029197: [symfony 5] Class implements "Symfony\Component\DependencyInjection\ResettableContainerInterface" that is deprecated since Symfony 4.2, use "Symfony\Contracts\Service\ResetInterface" instead and #3029199: [symfony 5] Calling "Symfony\Component\HttpFoundation\Request::getSession()" when no session has been set is deprecated since Symfony 4.1 both of which may be relatively easy to fix and are a huge part of the fails.
Comment #121
mikelutzgiven
Those look to be related to #2937542: Not setting the strict option of the Choice constraint to true is deprecated since Symfony 3.4 and will throw an exception in 4.0
I'm a bit curious. This patch adds #3029197: [symfony 5] Class implements "Symfony\Component\DependencyInjection\ResettableContainerInterface" that is deprecated since Symfony 4.2, use "Symfony\Contracts\Service\ResetInterface" instead and #3029199: [symfony 5] Calling "Symfony\Component\HttpFoundation\Request::getSession()" when no session has been set is deprecated since Symfony 4.1 to the deprecation ignore list and includes the patch from #2937542: Not setting the strict option of the Choice constraint to true is deprecated since Symfony 3.4 and will throw an exception in 4.0 . I'm curious how much that cleans up.
Comment #122
gábor hojtsyYay, thanks, fingers crossed. #3029199: [symfony 5] Calling "Symfony\Component\HttpFoundation\Request::getSession()" when no session has been set is deprecated since Symfony 4.1 is patchable and has a patch RTBC now :) #3029197: [symfony 5] Class implements "Symfony\Component\DependencyInjection\ResettableContainerInterface" that is deprecated since Symfony 4.2, use "Symfony\Contracts\Service\ResetInterface" instead should indeed go on the ignore list, proposed a patch there.
Comment #123
mikelutzA good chunk of the remaining functional test failures seem to be due to escaping Constraint Violation messages. The test is looking for
A feed named <em class="placeholder">iD5qjReymv</em> already exists. Enter a unique title.and the response containsA feed named <em class="placeholder">iD5qjReymv</em> already exists. Enter a unique title.I'm only starting to dig into why that might be happening, but I thought I would mention it in case it triggered any ideas with anyone who has been working with this more than I have. It's definitly coming through as
A feed named <em class="placeholder">iD5qjReymv</em> already exists. Enter a unique title.on the output page without the upgraded dependencies.Comment #124
alexpott#123 is being caused by type coercion. \Symfony\Component\Validator\ConstraintViolation::__construct() causes the TranslatableMarkup object to be casted into a string and therefore Twig no longer considers this as a safe string and will escape the HTML. The only thing we can do here is sub class
\Symfony\Component\Validator\ConstraintViolationand use that in \Drupal\Core\TypedData\Validation\ExecutionContext::addViolation()... but the Symfony class uses privates... not going to be pretty.Comment #125
gábor hojtsyAlso, now a big chunk of the fails are our own deprecations :D Opened #3029500: Drupal\Core\Database\Query\Select::hasAllTags() and hasAnyTag() will require a new "$tags" argument in the next major version of its parent class.
Comment #126
mikelutzThis is a combo test with #3029197: [symfony 5] Class implements "Symfony\Component\DependencyInjection\ResettableContainerInterface" that is deprecated since Symfony 4.2, use "Symfony\Contracts\Service\ResetInterface" instead, #3029540: [Symfony 4] Sub class \Symfony\Component\Validator\ConstraintViolation and use that in \Drupal\Core\TypedData\Validation\ExecutionContext::addViolation(), and #2937542: Not setting the strict option of the Choice constraint to true is deprecated since Symfony 3.4 and will throw an exception in 4.0
Comment #127
gábor hojtsyThis rolls in #3029500-10: Drupal\Core\Database\Query\Select::hasAllTags() and hasAnyTag() will require a new "$tags" argument in the next major version of its parent class as well.
Comment #129
catchRe-rolling, and also using the most recent patch from #3029197: [symfony 5] Class implements "Symfony\Component\DependencyInjection\ResettableContainerInterface" that is deprecated since Symfony 4.2, use "Symfony\Contracts\Service\ResetInterface" instead because the alternative approach there is not yet covering all of those deprecations.
Comment #130
catchOpened #3029697: [Symfony 4] Exception: Notice: A non well formed numeric value encountered.
Comment #132
catchOpened #3029979: [Symfony 4] ClassFinder test is broken by Symfony's debug classloader.
Comment #133
catchOpened #3029991: [Symfony 4] Container tests failing due to invalid exception argument type. with a patch.
Comment #134
gábor hojtsyRerolled. The only patch that was in this one was #3029500: Drupal\Core\Database\Query\Select::hasAllTags() and hasAnyTag() will require a new "$tags" argument in the next major version of its parent class. Other things that landed since then should improve the passing rate.
Comment #136
berdir> Error: Call to undefined method Symfony\Component\HttpFoundation\Request::setTrustedHeaderName()
https://symfony.com/blog/fixing-the-trusted-proxies-configuration-for-sy...
Looks like they forgot to mark that as deprecated in 3.3?
Comment #137
gábor hojtsy@berdir: ReverseProxyMiddlewareTest has an @expectedDeprecation for setTrustedHeaderName() so we hid it for ourselves.
I went through all the fails and I think this covers it all:
This combined patch currently contains:
- #3029540: [Symfony 4] Sub class \Symfony\Component\Validator\ConstraintViolation and use that in \Drupal\Core\TypedData\Validation\ExecutionContext::addViolation()
- #3029197: [symfony 5] Class implements "Symfony\Component\DependencyInjection\ResettableContainerInterface" that is deprecated since Symfony 4.2, use "Symfony\Contracts\Service\ResetInterface" instead
The fails that it produces are covered by:
- #3029979: [Symfony 4] ClassFinder test is broken by Symfony's debug classloader
- #3030474: Drupal\Core\TypedData\Validation\ExecutionContext uses internal methods from Symfony\Component\Validator\Context\ExecutionContextInterface (new)
- #3030485: [Symfony 5] The "Drupal\Core\Validation\TranslatorInterface" interface extends "Symfony\Component\Translation\TranslatorInterface" that is deprecated since Symfony 4.2, use Symfony\Contracts\Translation\TranslatorInterface instead. (new)
- #3030494: [Twig 3] The "Drupal\Core\Template\Loader\StringLoader" class implements "Twig_ExistsLoaderInterface" and "Twig_SourceContextLoaderInterface" that are deprecated since 1.12 and 1.27 (to be removed in 3.0). (new)
- #3030501: [Symfony 4] Drupal\Core\StackMiddleware\ReverseProxyMiddleware calls Symfony\Component\HttpFoundation\Request::setTrustedHeaderName() which does not exist (new)
I think the combination of those cover ALL the fails we are seeing in #134.
Comment #138
gábor hojtsyAdditionally to the above, the following two Symfony 4 deprecation messages are made to disappear in Drupal\Tests\Listeners\DeprecationListenerTrait:
I also looked at
@expectedDeprecationinstances in core based on finding out that those were hiding an issue in #3030501. There are these in Drupal\Tests\Component\EventDispatcher\ContainerAwareEventDispatcherTest:Comment #139
gábor hojtsy#3030501: [Symfony 4] Drupal\Core\StackMiddleware\ReverseProxyMiddleware calls Symfony\Component\HttpFoundation\Request::setTrustedHeaderName() which does not exist just landed, yay!
As for the classloader skipped deprecation messages uncovered in #138 I believe #3020296: Remove Symfony's classloader as it does not exist in Symfony 4 will deal with them, but that seems to be possible to do independent of Symfony 4 compatibility as we can independently stick to the old class loader versions at least alongside Symfony 4.
I don't know what to do about the @expectedDeprecation's around ContainerAwareEventDispatcher.
Comment #140
gábor hojtsy#3030485: [Symfony 5] The "Drupal\Core\Validation\TranslatorInterface" interface extends "Symfony\Component\Translation\TranslatorInterface" that is deprecated since Symfony 4.2, use Symfony\Contracts\Translation\TranslatorInterface instead. and #3029197: [symfony 5] Class implements "Symfony\Component\DependencyInjection\ResettableContainerInterface" that is deprecated since Symfony 4.2, use "Symfony\Contracts\Service\ResetInterface" instead also landed. Working on a reroll now.
Comment #141
gábor hojtsyThe only other patch this contains now is #3029540: [Symfony 4] Sub class \Symfony\Component\Validator\ConstraintViolation and use that in \Drupal\Core\TypedData\Validation\ExecutionContext::addViolation() on top of the composer changes. Let's see what is still or newly failing.
No diff other than the removal of #3029197: [symfony 5] Class implements "Symfony\Component\DependencyInjection\ResettableContainerInterface" that is deprecated since Symfony 4.2, use "Symfony\Contracts\Service\ResetInterface" instead since it was already committed.
Comment #143
gábor hojtsyThe fails from #2937542: Not setting the strict option of the Choice constraint to true is deprecated since Symfony 3.4 and will throw an exception in 4.0 are back (it was rolled back in the meantime), will roll a compound patch that has that too.
Comment #144
gábor hojtsyRolled with that. Let's see testbot.
Comment #146
gábor hojtsy@alexpott created #3038062: [Symfony 4] Skip ReverseProxyMiddlewareTest::testReverseProxyEnabledLegacy test to properly skip testing \Symfony\Component\HttpFoundation\Request::setTrustedHeaderName() when it does not exist. Running a compound test there to see how it helps.
Comment #147
gábor hojtsyOk now both #2937542: Not setting the strict option of the Choice constraint to true is deprecated since Symfony 3.4 and will throw an exception in 4.0 and #3038062: [Symfony 4] Skip ReverseProxyMiddlewareTest::testReverseProxyEnabledLegacy test landed, so we can test purely with the Symfony 4 update again. Just the update in this patch, no fixes.
Comment #149
gábor hojtsyWhoops, #3029540: [Symfony 4] Sub class \Symfony\Component\Validator\ConstraintViolation and use that in \Drupal\Core\TypedData\Validation\ExecutionContext::addViolation() is still needed to cut down the fails to the ones we don't have or cannot do patches for ATM.
Comment #152
mikelutzComment #153
mikelutzThis updates Symfony 4.2.2 to 4.2.4, which should fix at least one of the 10 remaining failures.
Comment #155
mikelutzLet's try that one more time...
Comment #156
mikelutzAlright then... I thought I screwed up the update, but that wasn't me.. We require symfony/psr-http-message-bridge: ^1.0 which is now 1.2, which deprecates a core service class....
Comment #158
mikelutzLast attempt tonight, putting psr-http-message-bridge back down to 1.1.1 for now. 1.2 requires php 7.1, so we aren't ready for that just yet.
Comment #160
mikelutzWell, all that work, and we traded one fixed test for one new fail, lol.
Comment #161
mikelutzI found an issue for the eventDispatcher issue #2895487: [Symfony 4] ContainerAwareEventDispatcherTest depends on Symfony tests, and tagged it.
Comment #162
mikelutzreroll
Comment #163
mikelutzRerolling here, the plain upgrade. I also added in swapping out the message factory for a psr17 message factory, so that we can use the symfony/psr-http-message-bridge 1.2 which has come out recently.
Comment #164
mikelutzand rolling in the latest #3029540: [Symfony 4] Sub class \Symfony\Component\Validator\ConstraintViolation and use that in \Drupal\Core\TypedData\Validation\ExecutionContext::addViolation()
Comment #166
mikelutzadding a fix from #3042694: [Symfony 4] JSON:API ResourceResponseSubscriber can pass NULL to Symfony\Component\HttpFoundation\Response::setCharset()
Comment #168
mikelutzRolling in more JSON:api fixes from a reroll of #3029540: [Symfony 4] Sub class \Symfony\Component\Validator\ConstraintViolation and use that in \Drupal\Core\TypedData\Validation\ExecutionContext::addViolation() fixing a couple new instances of ->getMessage() introduced by JSON:api
Comment #170
mikelutz2 more picked up from #3029540: [Symfony 4] Sub class \Symfony\Component\Validator\ConstraintViolation and use that in \Drupal\Core\TypedData\Validation\ExecutionContext::addViolation() updates
Comment #172
mikelutzIgnoring the deprecations..
Comment #174
mikelutzThis should fix the last 4 tests. The two new twig failures look to be due to new fun twig changes between 1.38.2, and 1.38.4 and more conflicts with the changes we made in the hotfixes last week. Environment::resolveTemplate return type keeps changing, it seems. using ->load in the test seems to force a TemplateWrapper, and seems to be the right thing to call, but I'd love someone who knows more about twig to verify that is right.
The other two failures were due to stricter typecasting in the validation system again. Symfony is converting TranslateableMarkup to strings, but we didn't inject the TranslationManager into the test container in those tests. I think the conversion is fine here, we just need to add the needed service to the container. I need to open issues for both of those and put in the actual fixes, and come up with a list where if these 4 or 5 issues get committed, then Symfony 4 works. :-)
Comment #175
mikelutzI opened #3042847: [Symfony 4] Inject string_translation service into ContextDefinitionIsSatisfiedTest and EntityContextDefinitionIsSatisfiedTest and #3042848: use ->load() instead of ->resolveTemplate in Twig Resolver tests for the last two pieces, and to test those changes against symfony 3.
Assuming everything comes back green, I think that everything needed for symfony 4 to work now has an issue and patch in needs review, and this issue has a combination of all of them showing green tests.
Comment #176
mikelutztagging #3039584: The "Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory" class is deprecated since symfony/psr-http-message-bridge 1.2, use PsrHttpFactory instead., as that is part of this patch as well.
Comment #177
mikelutzSo, once the individual issues are resolved and committed, we will have to rollback the psr17 message factory I put into this patch for the actual commit to 8.8 that allows for symfony 4 without requiring it, because it requires diactros factory at version 2, which is php7.1, I think we will have to pin symfony/psr-http-message-factory to 1.1.1 or add the deprecations that 1.2 generates to the ignore list. I was going to suggest pinning it to 1.1.1, but I'm starting to lean towards just suppressing the deprecations. Would love FM opinions on #3039584: The "Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory" class is deprecated since symfony/psr-http-message-bridge 1.2, use PsrHttpFactory instead. because that really does need to be resolved, and probably backported to at least 8.7 and probably 8.6 too.
I'm done rolling patches tonight, but once we are ready to roll the actual patch for 8.8 to allow symfony 4 we should have a resolution for that particular dependency one way or another.
Comment #178
mikelutzComment #179
mikelutzHere's a re-roll to keep this up to date. I'm including 3 patches.
I'm postponing this issue on:
#3029540: [Symfony 4] Sub class \Symfony\Component\Validator\ConstraintViolation and use that in \Drupal\Core\TypedData\Validation\ExecutionContext::addViolation()
#3031577: \Drupal\Tests\Listeners\DeprecationListenerTrait::getSkippedDeprecations() does not work in unit tests
#3042694: [Symfony 4] JSON:API ResourceResponseSubscriber can pass NULL to Symfony\Component\HttpFoundation\Response::setCharset()
#3042847: [Symfony 4] Inject string_translation service into ContextDefinitionIsSatisfiedTest and EntityContextDefinitionIsSatisfiedTest
Until those are resolved,I don't believe there is anything further to do here except keep up with rerolls.
Comment #180
mikelutzAlways one tiny thing... :-(
Comment #181
mikelutzRerolling all three patches.
#3029540: [Symfony 4] Sub class \Symfony\Component\Validator\ConstraintViolation and use that in \Drupal\Core\TypedData\Validation\ExecutionContext::addViolation() is the last remaining issue as the other three in #179 have been committed to 8.8.x
Also, I am trying having drupalci just run composer update for testing, rather than committing a large lock file. I'm not sure if it will work.
Also, I've switched the combined patch to use the simpler version of #3029540: [Symfony 4] Sub class \Symfony\Component\Validator\ConstraintViolation and use that in \Drupal\Core\TypedData\Validation\ExecutionContext::addViolation() from comment #2, which should work just fine with Symfony4 (though likely not Symfony5). Whatever route we go in that issue should still make us symfony4 compatible.
Comment #182
catchUn-postponing to start tracking Symfony 4.3
Comment #183
mile23Note that symfony/browserkit 4.2.0+ supports meta refresh tags, thanks to @jhedstrom: https://github.com/symfony/symfony/pull/27118
This means our tests will have to change: https://git.drupalcode.org/project/drupal/blob/8.8.x/core/tests/Drupal/T...
Comment #184
alexpott@Mile23/ re #183 - are you sure that something needs to change because of that? The meta refresh following looks optional and disabled by default so I'm not sure what'll need to change.
Comment #185
catch4.3.0-beta1 is out, so it should be possible to do a new patch here.
We'll still need to combine this with one of the patches from #3029540: [Symfony 4] Sub class \Symfony\Component\Validator\ConstraintViolation and use that in \Drupal\Core\TypedData\Validation\ExecutionContext::addViolation() to remove those test failures.
Comment #186
mikelutzLet's just see where we are at. I have to go back to including the lock file again because we won't pick up the beta with 'prefer-stable: true' and I don't want to set that to false and pick up other dev dependencies
Comment #188
gábor hojtsyJust sampled the first 150 fails of the 2.7k and those are all these:
So it looks like solving those would kill most (if not all) new deprecation errors.
Comment #189
mikelutzLets suppress them for now, and break them out into separate issues, to see if there is any way to fix them for SF5 while keeping support for SF3.
Comment #191
catchMost (all?) the remaining ones are like this:
All validation messages.
Comment #192
mikelutzTacking #3029540-38: [Symfony 4] Sub class \Symfony\Component\Validator\ConstraintViolation and use that in \Drupal\Core\TypedData\Validation\ExecutionContext::addViolation() back on to see if anything is left.
Comment #194
gábor hojtsySummary of those results:
This happens with various event classes, this is just an example:
The "Drupal\Core\Routing\RouteBuildEvent" class extends "Symfony\Component\EventDispatcher\Event" that is deprecated since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead. in RouteSubscriberTest::testOnAlterRoutes from Drupal\Tests\views\Unit\EventSubscriber
Happens once:
The "Goutte\Client" class extends "Symfony\Component\BrowserKit\Client" that is deprecated since Symfony 4.3, use "\Symfony\Component\BrowserKit\AbstractBrowser" instead. in BrowserTestBaseTest::testGetHttpClient from Drupal\Tests\Core\Test
Appears 4 times:
The "Symfony\Component\Routing\CompiledRoute::serialize()" method is considered internal since Symfony 4.3, will be removed in Symfony 5 as the class won't implement Serializable anymore. It may change without further notice. You should not extend it from "Drupal\Core\Routing\CompiledRoute". in RouterTest::testMatchesWithDifferentFitOrder from Drupal\Tests\Core\Routing
Happens once:
The "Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher::dispatch()" method will require a new "string|null $eventName" argument in the next major version of its parent class "Symfony\Contracts\EventDispatcher\EventDispatcherInterface", not defining it is deprecated. in SectionRenderTest::setUp from Drupal\Tests\layout_builder\Unit
Still happens once:
The "Drupal\Core\File\MimeType\MimeTypeGuesser" class implements "Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface" that is deprecated since Symfony 4.3, use {@link MimeTypesInterface} instead. in MimeTypeGuesserTest::testSymfonyGuesserRegistration from Drupal\Tests\Core\File
Comment #195
mikelutzSkipping the remaining deprecations to get back to green, then we can start picking them apart.
Comment #197
mikelutzOf course they moved AbstractEventDispatcherTest into EventDispatcherTest right after we switched over to it.. :-/
Comment #198
mikelutzCreated #3055040: Roll AbstractEventDispatcherTest into ContainerAwareEventDispatcherTest, though we should also consider switching back to Symfony's Event Dispatcher for Drupal 9, #2895487: [Symfony 4] ContainerAwareEventDispatcherTest depends on Symfony tests
Comment #199
mikelutzRolling in #3055040: Roll AbstractEventDispatcherTest into ContainerAwareEventDispatcherTest patch to get a green base to begin trying to pick off the individual deprecations into their own issues.
This leaves #3029540: [Symfony 4] Sub class \Symfony\Component\Validator\ConstraintViolation and use that in \Drupal\Core\TypedData\Validation\ExecutionContext::addViolation() and #3055040: Roll AbstractEventDispatcherTest into ContainerAwareEventDispatcherTest as requirements for Symfony 4 support. The remaining failures from #186 are deprecations in Symfony 4, and are technically tasks required for Symfony 5 support. I've opened #3055180: [META] Symfony 5 compatibility to begin tracking issues related to Symfony 5.
Comment #200
gábor hojtsyBoth sub-issues landed now. How do we ensure Symfony 4 keeps passing? Should we open an RTBC issue to keep retesting?
Comment #201
catchDo we want a change record for this issue? This also unblocks #3020303: Consider using Symfony flex to allow switching between major Symfony versions which definitely would need a change record, maybe we should defer a change record until there?
I think an RTBC testing issue is a good idea so we can close this as fixed once that's opened with an updated patch.
Comment #202
mikelutzI'm happy to re-roll a new patch we can use as an RTBC testing patch.
I'm not sure we can do #3020303: Consider using Symfony flex to allow switching between major Symfony versions. We discussed it in the Symfony 4/5 meeting in Seattle, and realized that it's going to cause problems. We had to do a lot of work to make core compatible with SF4, and it's very likely that there are contrib modules that will not work with SF4 right now, but we have no system to provide a way for contrib to test against SF4.
In composerland reality, if a contrib module is not compatible with SF4 for whatever reason, that should be declared in their composer file, and any site using that module would not be updated to SF4. In actual reality, no contrib module has been able to easily test against SF4 or given any thought to setting version constraints in composer against symfony. If we allowed SF4 in composer.json, contrib would begin getting bug reports that they wouldn't be able to reproduce on testbot.
I feel like we need a way to allow SF4 that is not going to auto install it on a simple
composer updateI'm not super familiar with composer scripting, I know the old drupal-phpunit-upgrade script forced the update to the 'already allowed but not in composer.lock' phpunit 6. Is it possible to have a composer script that also changes the requirements in composer.json to allow SF4 before trying to run the update?Comment #203
gábor hojtsy@mikelutz, @catch I think optional Symfony 4 support if it only needs patching composer files (or for people using https://github.com/drupal-composer/drupal-project not even that I think?) is valuable by itself. That said, we would need to commit the deprecation test silencing parts of the patch for it to be feasible. Otherwise patching too many files IMHO. We cannot claim Symfony 4 compatibility then. What do you two think?
Comment #204
gábor hojtsyOk I was enlightened just now. I was thinking we can augment core with updated composer dependencies just like https://github.com/webflo/drupal-core-strict does, but https://github.com/drupal-composer/drupal-project does not / cannot do away with core's existing composer dependency limitations, so we could only go more strict and not less strict.
So it would only be possible with a composer package independent of drupal/core (eg. drupal/core-sf4) and somewhere that composer package would need to be provided. In that case however, any package that sets an explicit dependency on drupal/core some version will be impossible to use with it. Or @berdir said we may be able to have a new branch 8.8-sf4 and branch alias so it appears like 8.8, see https://getcomposer.org/doc/articles/aliases.md#require-inline-alias -- that sounds like quite a bit of magic, especially given I don't know how d.o would deal with custom Drupal core branch names like that (update status, testbot, issue queue, etc).
Comment #205
gábor hojtsyWhoops, sorry, let's discuss in #3020303: Consider using Symfony flex to allow switching between major Symfony versions where that discussion should be.
So leaving this open for this one from above from @catch:
Let's only do a change record when there is an actual change we can deal with. Since this requires composer changes to be finished, we should do them first before a change record.
Comment #206
mikelutzFresh patch to install symfony 4.3.1, interdiff may not be useful, but I removed the lock file now that we are back to a stable version of SF4.
Comment #207
mikelutzFixing the deprecation messages around route serialization, which changed in 4.3.1 (see https://github.com/symfony/symfony/pull/31866)
Comment #210
mikelutzTweaking some regex.
Comment #211
mikelutzComment #213
mikelutzIt's been a little while since we've done this, symfony 4.3.3 is now out. Let's see where we are.
Comment #215
andypostone more failed test `Drupal\Tests\Core\EventSubscriber\RedirectResponseSubscriberTest`
Comment #216
martin107 commentedOk so two things jump out at me.
1) EventDispatcher changes.
2) Process changes
Just making notes for myself might at well do it in public ... to save others from digging through the test artifacts.
1)
The order of the arguments is reversed so class for named services is optional
https://symfony.com/blog/new-in-symfony-4-3-simpler-event-dispatching
2) command processing
in short put the arguments in an array -- escaping is an issue.
https://symfony.com/doc/current/components/process.html
Comment #217
mikelutzYes, and both of these are just deprecations in symfony 4. We can suppress the messages in Drupal 8 and still be compatible. We do need to address the event dispatcher changes, we should do some deprecations around our own dispatcher to prepare, and there are a couple issues out for that.
Comment #218
mikelutznew patch file to adjust for recent composer changes, no interdiff. Added one deprecation to the skip list to leave the actual errors relating to traversing xpaths in functional tests.
Comment #220
mikelutz#3072752: Invalid markup in ImageItem (causes test failures with symfony/dom-crawler:4.3+) was committed, which should cover the remaining test failures since the last time the test was ran.
Comment #221
mikelutzHere's a re-roll to test against 4.3.3
Comment #223
gábor hojtsyLiterally one word changed in the deprecation message text for dispatch :D This:
'Calling the "Symfony\Component\EventDispatcher\EventDispatcherInterface::dispatch()" method with the event name as {+the+} first argument is deprecated since Symfony 4.3, pass it as the second argument and provide the event object as the first argument instead.',Comment #224
xjmComment #225
mikelutzWell, might as well push the envelope then. Let's try 4.4-dev :-)
Comment #227
mikelutzSuppressing a few new deprecation messages. I opened #3074585: [Symfony 5] Replace app.root and site.path string services with container parameters for the one I think we could fix in D8, the other (Passing arguments to "Symfony\Component\HttpFoundation\Request::isMethodSafe()" has been deprecated since Symfony 4.4; use "Symfony\Component\HttpFoundation\Request::isMethodCacheable()" to check if the method is cacheable instead.) we could fix, but SF3 throws an error if that method is called WITHOUT arguments, so we would have to bypass the method altogether and decide safe methods on our own, which we could do, or just suppress the message until we are on SF4 and fix the call once D9 opens, which is my preference.
Comment #228
mikelutzI opened #3074627: Fix passing invalid second argument to $this->container->get() in Drupal\Tests\node\Kernel\NodeConditionTest::testConditions()
Comment #229
mikelutzOpened #3074632: The second argument to $container->register should be a class name string, not an object in AccessManagerTest
Comment #231
mikelutzAdditional deprecation suppression that can't easily be fixed in SF3:
Comment #232
mikelutzI opened #3074645: Account for changing violation message in symfony 'range' constraint between SF3 and SF4.4
Comment #234
mikelutzFix typo in one of the deprecation suppressions. That leaves the following issues:
#3074627: Fix passing invalid second argument to $this->container->get() in Drupal\Tests\node\Kernel\NodeConditionTest::testConditions()
#3074632: The second argument to $container->register should be a class name string, not an object in AccessManagerTest
#3074645: Account for changing violation message in symfony 'range' constraint between SF3 and SF4.4
and
Which regrettably is passing for me locally at the moment with chromedriver 75.
Comment #235
mikelutzSuppressing a new deprecation, opened #3075011: [Symfony 5] Remove typehint requirement deprecation suppression because Symfony 4 did not require them after all
Comment #236
mikelutzStill unable to duplicate the installer test fail locally.. Trying to get a little bit more information here.
Comment #238
mikelutzComment #239
gábor hojtsyUpdating title and issue summary.
Comment #240
gábor hojtsy#3074645: Account for changing violation message in symfony 'range' constraint between SF3 and SF4.4 actually landed, removing from summary.
Comment #241
gábor hojtsyComment #242
mikelutzStill unable to replicate the failure in #235 in my development environment. I set up DrupalCI locally and got it to fail, but I can't see what's going on as easily.
I isolated the test in drupalci, and downgraded each of the symfony components one by one to narrow it down to the dependency-injection component. I bisected that one back and isolated the problem down to a single commit: https://github.com/symfony/symfony/commit/7c01c4c80c69159b2b39ea8bc53431196d7b29fb
Now I need to follow the code path and see what that commit could possibly have done to break one test, and only on drupalci...
Comment #243
mikelutzMy best guess so far is that previous to this patch calling $container->get('service_container') would return NULL and now it returns $this.I see this being called in the installer during the attempt to set up the file system.
Maybe there is a difference between the way my local dev environment file system is set up when I run tests through PHPstorm vs the way the file system is setup in drupalCI, causing an error on drupalci that my system can handle somehow. Not sure yet, but I'm done for today, figured I would leave this here in case anybody had any idea.
Edit: I misread the commit on Friday, this isn't correct. I'm still hunting.
Comment #244
mikelutzNarrowed it down to a crash inside of an APCU File Cache read, I believe. Here's some relevant tests:
Comment #245
mikelutzRolling in not using the file cache on profile discovery in the installer to test against the full test suite
Comment #246
catchfwiw I'd be fine with disabling
Drupal\FunctionalJavascriptTests\Core\Installer\Form\SelectProfileFormTestand opening a critical issue to re-enable it to unblock the actual Symfony 4 commit. However we should only do that as a last resort in Drupal 9 itself if we're unable to fix it in Drupal 8 before October when 8.9.x is opened (which is the trigger for opening 9.0.x too per #2608062: [META] Requirements for tagging Drupal 9.0.0-alpha1).Comment #247
mikelutzRebasing my local branch.
@catch I'm not sure what the 'correct' fix is. It really feels like a php bug, although the same error consistently appears in 7.1, 7.2, and 7.3, and I can't seem to boil it down to easily reproducible steps either. My tests just show the script dying during an apcu_fetch call, which shouldn't happen. Disabling that cache seems to work, but I just don't yet know what the 'correct' fix should be.
Comment #248
mikelutzComment #249
alexpottRerolled... as this conflicted with #3078058: Update composer.lock with scaffold metadata from drupal/core composer.json - should still fail.
Comment #250
alexpottLet's see what happens if we revert the change to
install_begin_request()and write a proper test settings.php in\Drupal\FunctionalJavascriptTests\Core\Installer\Form\SelectProfileFormTest::setUp(). This test is a bit special in that it is very similar to an InstallerTestBase test but built on WebDriverTestBase and not BrowserTestBase (and so supports JS). The test passes locally.Comment #252
alexpottHere's a way to continue running the test whilst avoiding the error by disabling the use of APCu for this test. I've added a big @todo. One cause for concern is that this is most real test we have of visiting the installer since it is visiting the installer using a real browser. I'm not sure any other test does this.
Comment #253
mikelutzAs part of my investigation, I went to go check the other installer JavaScript tests, to see if they had similar problems, and was surprised to see there weren't any other JavaScript tests of the installer.
Comment #254
gábor hojtsyDirectly parenting this to the branch / alpha1 issue as one of the 2 issues left :)
Comment #256
pasqualleI am a bit confused about D8.9 release.
Is there a plan to release D8.9 with SF4.4? Or D8 will have only "unofficial" compatibility with SF4?
Comment #257
volegerAs I understand, the same optional support as we have with Twig2 now.
Comment #258
catch@Pasqualle the issue for that is #3020303: Consider using Symfony flex to allow switching between major Symfony versions where there is a fair bit of discussion.
Comment #259
mikelutzComment #260
mikelutzTime to dust this one back off and get caught up in preparation for the D9 branch. Straight re-roll to start.
Comment #262
mikelutzI opened #3085608: [Symfony 4] Symfony console command ::execute() methods should return 0 on success and #3085673: [Symfony 4] EntityResourceValidationTraitTest should not get a mock for an internal trait. which should fix the remaining 5 test failures from https://www.drupal.org/pift-ci-job/1423932
Comment #263
wim leersNice work, @mikelutz! 🙏👍
Comment #264
voleger#3085608: [Symfony 4] Symfony console command ::execute() methods should return 0 on success landed
Comment #265
wim leersAnd so did #3085673: [Symfony 4] EntityResourceValidationTraitTest should not get a mock for an internal trait.. I see @catch already triggered a re-test after he committed both. 👍 #260 should come back green! 🤞
Comment #266
catchNice green test run now :)
Comment #267
mikelutzGreen yes, but we still need to decide and implement the final solution to #246/#252.
Comment #268
mikelutzreroll again
Comment #270
mikelutzHere's a test reverting the change in #252 and adding in the patch from #3074585: [Symfony 5] Replace app.root and site.path string services with container parameters to see if removing those deprecations fixes the apcu issue at all.
Comment #272
alexpottUpdating credit to credit review comments.
Comment #273
gábor hojtsyGiven #3088754: Update to Drupal 9 to Symfony 4.4.0 what is left to do here?
Comment #274
mikelutzAs far as I'm concerned, the purpose of this issue was to do everything possible in Drupal 8 to prepare for updating the Drupal 9 brnach to Symfony 4 once it opened. Some of the most recent changes to be compatible with SF4 were not backported to Drupal 8, and they don't need to be. The biggest reason to try to support Drupal 8 on Symfony 4 was for testing purposes, and we now have the D9 branch for that. With the opening of D9, now on Symfony 4.4 stable, I think this issue served its purpose and can be closed.
I'm closing it as fixed to credit all the people that have contributed towards the very successful effort, but feel free to re-open or switch to outdated if you prefer.
Comment #275
mikelutz