Postponed (maintainer needs more info)
Project:
Drupal core
Version:
main
Component:
base system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
13 Dec 2018 at 13:24 UTC
Updated:
12 Aug 2025 at 15:37 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
catchTook a look at the other issues in some more depth and this is the absolute theoretical minimum of what we might need afaict:
Did the following:
1. Kept symfony class-loader pinned to 3.4 - while it's removed in Symfony 4, it's also compatible with Symfony 4, so we can kick that down the road a bit.
2. Set Symfony constraints to be like "~3.4.0||~4.2.0" - this lets composer update symfony/* bring them up to the latest stable versions.
3. Including a version with the one-line patch from #3020301: Remove composer integration PHP version test (rely on DrupalCI PHP version runs instead).
This might not be enough, but see what DrupalCI comes back with.
Comment #3
catchToo minimal - needs to update symfony/cmf too.
Still some things stuck on 3.4 - probably other stuff with Symfony dependencies, but seeing if this one's green.
Comment #5
catchOK we need to do 4.0~ to get everything to update to 4 something or higher it looks like - can refine to more specific constraints from there.
Comment #10
catchMost of the test failures are due to a newly introduced deprecation in 4.2, opened #3020385: Symfony 3 and Symfony ^4.2 JsonEncode constructors are incompatible.
Comment #11
catchIncluding the patch from #3020385: Symfony 3 and Symfony ^4.2 JsonEncode constructors are incompatible to see how we're doing.
Comment #12
catchComment #15
catchNow only postponed on #3020301: Remove composer integration PHP version test (rely on DrupalCI PHP version runs instead).
Comment #16
catch...
Comment #17
catchRe-rolled. Still postponed on #3020301: Remove composer integration PHP version test (rely on DrupalCI PHP version runs instead) but that's RTBC.
If we commit this, we'd need to be extra careful updating dependencies in composer.lock above and beyond PHP version support (i.e. once we require PHP 7.1 we'll still want to not move to Symfony 4).
Comment #18
catchRestoring the typo3 library..
Comment #19
effulgentsia commentedI committed #3020301: Remove composer integration PHP version test (rely on DrupalCI PHP version runs instead), so this is no longer postponed.
I don't suppose Composer has any support for indicating preferred version, does it? E.g., "prefer lowest major, but highest minor"? Or "prefer the first version range in a list that is separated by |"?
Comment #20
effulgentsia commentedHow about this as a way of addressing #19?
Comment #21
catchYou can do composer require vendor/package:version to update to a specific version instead of using composer update. There's also --prefer-lowest which is fine for our Symfony range because 3.4 is the lowest minor we specify, although we'd need to start specifying patch updates then for things we rely on.
The PHP version trick will force us to stay on Symfony 3 for now, but it seems a bit fragile if another dependency raises its PHP dependency to 7.1.3 and we want to update to that in a minor (once we require PHP 7.1 of course). Also while our PHP requirements are lower, composer will fail to install on all the < 7.1.3 environments anyway if we update to something requiring that.
Comment #22
effulgentsia commentedIf we don't know yet if we want to commit this once it's ready, why is this issue prioritized as Critical?
Comment #23
gábor hojtsyI think we want to commit this and release with 8.7 if at all possible so people can turn up more problems that we can fix in 8.8 and then release 8.8 with optional support for Symfony 5 so people can turn up more problems that we can fix in 8.9 and release Drupal 9 at the same time with 8.9 requiring Symfony 4 or 5 based on how far we get.
Comment #24
berdirI'm a bit worried about the impact this will have on all the drupal-project sites out there if we commit it. Even if we add it, the php version thing won't do anything for them, because they don't use the root-level composer.json. And I'm actually kinda surprised that passed, because shouldn't that prevent the new php7-only phpunit version from being installed on testbot?
Unfortunately it is quite hard to test what would happen because you can't change composer dependencies with patches. If we do decide to commit it then I'll try the dev branch on our install profile, to check how well it is going to work.
Comment #25
catch@effulgentsia we want to commit this so that we can eventually test contributed projects (and core patches) with minimum and maximum versions of dependencies, and also to make Symfony 4.3, 4.4, 5.0 and 5.1 compatibility easier to track. This is the only way to allow contributed branches to test for Symfony 4 compatibility issues prior to the 9.x branch opening.
Whether we can commit this exact patch in its current form or not is a different question.
Comment #26
effulgentsia commentedI think we should keep Drupal 8 on PHP 7.0 for the rest of its life. Ubuntu 16.04 has PHP 7.0 and is supported until April 2021. Debian 9 has PHP 7.0 and has LTS until June 2022. Drupal 9.0, of course, can require a higher PHP version.
The patch adds
--ignore-platform-reqsto thedrupal-phpunit-upgradecommand.Aren't those exactly the projects that we want updating to Symfony 4 and reporting issues to us? If the project uses modules/packages that are not compatible with Symfony 4, then isn't it the responsibility of those incompatible modules/packages to specify their requirements in their composer.json file? And per #21, a drupal-project site can add those requirements to their root composer.json too. But you're right that it's a potential BC break for sites that are incompatible with Symfony 4 but don't have that reflected in any composer.json file.
Comment #27
effulgentsia commentedWould that require us to update the minimum patch number every time any vendor library has a security update? Maybe that's fine, since if we're updating our composer.lock file anyway, then why not update composer.json at the same time?
Comment #28
derrabus commentedProjects that depend on a Symfony-4-compatible
drupal/corepackage could add"symfony/lts": "^3"to their dependencies if they don't want to upgrade to Symfony 4 just yet. That package simply adds a conflict for version 4 of each Symfony package. It is marked as abandoned at Packagist though. However, since the list of Symfony 3 packages won't change anymore, it should be save to use it for this purpose.Comment #29
catchThis might be OK with a pre-announcement and prominent mention in the release notes.
Comment #30
bojanz commentedEchoing berdir's #24. This feels extremely unwise.
The documented starting point for every Drupal Commerce site is "composer create-project".
This will silently switch a large portion of our users to Symfony 4. That makes it the equivalent of Drupal core switching the tarball to Symfony 4.
It is worse to have some people on Symfony 4 (and experiencing contrib incompatibilities) and some on Symfony 3, than to just move everyone to Symfony 4.
Comment #31
alexpottI agree with @Berdir and @bojanz - this feels very risky.
Also,
This is tricky. We've tried similar stuff like this before. But this risks breaking tar installed / git installed sites that are on PHP 7 and have other non-drupal dependencies that are PHP 7 only.
Comment #32
gábor hojtsyLet's return to what @catch said in #25:
(Emphasis mine). Can we make a different change that would not have the same side effects of forcing anyone to Symfony 4, yet would still allow us to gather feedback on Symfony 4 support as well as let contribs adopt optional Symfony 4 support?
Comment #33
catchI think a small change like expecting composer built projects that aren't already using drupal-core-strict to add
"symfony/lts": "^3"from @derrabus in #28 is acceptable in a minor release.We can also have a hook_requirements() that warns you you're running Symfony 4 (with maybe a settings.php killswitch).
Comment #34
xjmToday we discussed when and whether to commit this change so that people can test it. Options discussed:
The committer team discussed this and we mostly think option #1 is too risky. Option #4 is what we agreed on. So we can commit this to 8.8.x when we branch it, which will be in a month or so, and then do a communication push around testing it and giving feedback.
Edit: The above isn't signoff on the current implementation, just what we would do if we were to commit the current implementation or something like it.
Comment #35
effulgentsia commentedRe #28 / #33, https://github.com/symfony/lts says that it's abandoned and recommends using symfony/flex instead. Here's a patch that does that. It therefore removes the #31 hunk as well.
Symfony/flex has a composer.json dependency on PHP 7.0, but if we're not planning to commit this until the Drupal 8.8.x branch per #34, then that's not a problem per the proposed resolution of #2842431: [policy] Remove PHP 5.5, 5.6 support in Drupal 8.7:
This patch adds the
"symfony": { "require": "^3" }configuration (used by symfony/flex) to the root composer.json (not core/composer.json). This would set the default for sites that use Drupal's root composer.json. Sites that use their own root composer.json could change that requirement to allow for Symfony 4 if they want to help us test it. How does that sound?Comment #36
effulgentsia commentedSorry, the interdiff in #35 is incorrect. The patch is correct (but badly named, because it's in no way the same as the one in #20).
Here is the correct interdiff between the patch in #20 and the patch in #35.
Comment #38
gábor hojtsy#2976394: Allow Symfony 4.4 to be installed in Drupal 8 reached a point where 8.8-dev is now Symfony 4 compatible (other than test fails for deprecations for Symfony 5). So we are back here to figure out how to support this.
Comment #39
pasqualleCan you be more specific what needs to be figured out?
Reading through the comments it seems the decision was made already.
If it will have to be reverted, then it should be before 8.8 alpha, so 4 months left for testing SF4 on D8.
Or do you think
is a much more logical/cleaner way forward now?
Comment #40
catch#35 needs a re-roll but seems like a good approach to me, it could use some manual testing with different composer approaches.
Comment #41
alexpottSo that means any site that has been built using the recommended way to build Drupal sites will use Symfony 4 the next time they run
composer update- the official user guide docs are here https://www.drupal.org/docs/user_guide/en/install-composer.html and drupal-composer/drupal-project uses drupal/core not drupal/drupal.Comment #42
effulgentsia commentedIn general, how do composer project templates release bug fixes or other improvements to their existing users? For example, if we also added something like #35 to
drupal-composer/drupal-project, is there anything within existing conventions of how people use composer after creating a project from a template that would notify them that an update to the template exists?Comment #43
alexpottI think the project template is exactly that - a template that is used once to template your project - there's no link back to the template as far as I know.
Comment #44
aspilicious commentedYeah if you want new things from the template you need to copy them.
Doesn't happen automagically.
But that's fine.
Comment #45
alexpott@aspilicious in this case I'm not sure it is. If I have a drupal project created site and I suddenly get Symfony 4 because drupal/core has relaxed it's version requirements I'm going to be mightly surprised because uptil this point the version of Symfony I'm on has been controlled by drupal/core - I've not had to make this consideration myself. This especially problematic for contrib and custom modules because at the moment they make assumptions about inherited dependencies. And to compound this we don't do deprecation testing by default for contrib so if they are using deprecated code in Symfony 3 they have to do work to find this out.
Comment #46
heddnI, for one, am OK with this potential issue with
drupal-composer/drupal-project. Post a CR about symfony 4. Add it to release notes. Then let folks test their sites and possibly add a pin on symfony 3 in their composer.json. All another day in the moving target of being a drupal developer. If it breaks, usually things break spectacularly. Which is easy to catch in even rudimentary testing.Comment #47
catchHere's an idea that might be lower risk but get us most of what we want:
1. Do #35, except put the configuration in core/composer.json so every install stays on Symfony 3, but we still relax our actual requirements.
2. Add a composer script which rewrites that configuration in core/composer.json to be Symfony 4 instead - (prior to install? or like the phpunit updater). Because it's just one line in core/composer.json that hopefully won't be too bad?
3. Contrib projects can then add that composer script to drupalci.yml to test against Symfony 4.
Comment #48
moshe weitzman commentedI'm OK with this too. All my projects have pinned to Symfony ^3 for some reason or another. Folks who dont do that will see a failure from Contrib/Custom and can take appropriate action. Minor core upgrades always require some work.
Comment #49
catchComment #50
aiphesSo can I do the Symfony update to 4 if I don't use this components because I converted my websites this way ?
Comment #52
gábor hojtsyThis is not going to happen due to various concerns raised here. Also we could only do this now in Drupal 8.9 and that is supposed to release alongside Drupal 9, so no point anymore. See you in #3088369: Update Drupal 9 to Symfony 4.4-dev though!
Comment #53
catchRe-opening this for 9.0.x - we could still do the composer.json refactoring prior to the release of Drupal 9, to allow sites to upgrade to Symfony 5 via composer.
Comment #54
alexpottWe still have the same problem the fact we ship a lock file and don't test against our minimum and maximum dependencies. It feels' like all that has to be fixed before we do this. Also we know we're not compatible with SF5 because we're currently skipping some SF4 deprecations.
Comment #55
catchBased on previous discussion here, people were not keen to do this in a minor release, so it is probably beta/rc deadline for either 9.0.x or 10.0.x
Comment #56
xjmThe beta clock has just about run out (and honestly I think it was beta deadline anyway).
We might want to revisit this during D10 development, since there's a chance we'll be trying to bridge our way from SF4 to SF6.
Comment #57
catchHere's a possible approach for Drupal 10.
1. Have all Drupal 10 components declare compatibility with Symfony >= 5.4
2. Use symfony flex and configure it to use Symfony 6.
That way all installs get Symfony 6 by default. If you're having trouble bridging Symfony 4 to 6, you can specify Symfony 5.4 yourself while you sort those issues out, then specify Symfony 6 after that.
For the actual stable Drupal 10 release we might want to remove the ability to install on Symfony 5.4 and raise requirements to Symfony > 6.0 for everything, but flex would then be in place for Symfony 7 and onwards too.
Comment #58
catchThought about this some more, and I think we could probably add the symfony/flex dependency in Drupal 9, without loosening the constraints. We could then in Drupal 10 loosen the constraints and configure symfony/flex differently. Bit of a re-roll.
Comment #59
catchcspell is failing on the config directory.
We could cspell-ignore those files, but really they're completely irrelevant to us because they're for using the framework rather than components. Either need to add them to clean-up or stop symfony-flex creating them in the first place. For now removing to get a test run.
Comment #62
longwave@catch linked to this issue in Slack and asked for reviews, so here are some thoughts:
As I understand it this will effectively require downstream users (both contrib and end user sites) to declare which version(s) of Symfony they support, instead of relying on Drupal core's major version to infer this. To me this brings us back to the old question of is Drupal a product, or a framework? If it's a product, then I think we should lock to a Symfony version and be done with it; but if it's a framework then I see the advantages of allowing flexible Symfony versions. But in many ways Drupal is both, and I believe some (product) users will not like the additional load here of having to select a Symfony version to use.
Also, does this risk further fragmentation in contrib? We already have the issue that when we release a new major, contrib has to catch up. But now if we're also asking contrib to support multiple Symfony versions, we risk further incompatibility issues - Drupal core might support two versions of Symfony, but if module A only supports SF5 and module B only supports SF6, that means they can no longer be used together.
Finally I think this was already alluded to above, but we surely need test infrastructure improvements to be able to do this. Once we declare that we support more than one Symfony version, all patches will have to be tested on both versions prior to commit - at least the latest version of each major, if not full min/max testing across all supported majors - to ensure that we haven't broken anything.
Comment #63
longwaveAlso, do we even need Symfony Flex? Can we ship Drupal 10 with
^5.4|^6.0dependencies on Symfony, with the lockfile set to Symfony 6? This means people get SF6 by default but can downgrade if they want to.We've shown in #3161889: [META] Symfony 6 compatibility that we can already support
^4.4|^5.4in 9.3.x - albeit with some deprecations for Symfony 6.x, but nothing actually broken. Could we support^5.4|^6.4to Drupal 10 EOL, and then go to^7.0in Drupal 11.0?Comment #64
andypost@longwave versions still makes sense as core provides independent components (each provides own constraints)
Comment #65
andypostFlex got changes https://symfony.com/blog/symfony-flex-is-going-serverless
Comment #66
andypostAs Symfony 5.3 there's https://symfony.com/doc/current/components/runtime.html which is now moving to separate project
It could help to manage core's variations (IIRC there's 3 Kernels already)
Comment #71
catchNow that we've done #3361260: [policy, no patch] Adopt a regular two year release cadence for major releases this is no longer necessary I think. Moving to 'needs more info' in case there's a use-case I've missed. I guess potentially it would still be possible to update the 10.x branch to newer Symfony versions using this, but any sites wanting to do that would be better off updating to 11.x anyway.
Comment #72
smustgrave commentedWanted to bump 1 more time as there are a lot of people on this one.