Problem/Motivation
symfony/mime and symfony/var-dumper will be on v5 after committing #3088754: Update to Drupal 9 to Symfony 4.4.0. This issue will decide whether we want to constrain them in some way to keep them on a Symfony LTS version.
@mikelutz proposed some options in the original issue:
- Allow symfony/var-dumper and symfony/mime at 5.0, but know we will have to do a minor version bump before release and again in November 2020 in order to receive security updates through June 2021
- Explicitly require it at ^4 so that we can get security updates without requiring a minor version bump through the life of Drupal 9
- Conflict with =>5 so that we can get security updates without requiring a minor version bump through the life of Drupal 9
- Conflict with all of 5.0, 5.1, 5.2, 5.3? So that we get 4.4 or 5.4 but nothing in between.
The problem with an explicit require is that Drupal does not require them - our dependencies do. And the problem with a conflict is that we do not conflict with them.
Proposed resolution
-
We have an agreement with Symfony wherein we have two Security Team members with access to their private queue, in order to provide security releases that affect Drupal after their non-LTS minors' security support has ended. Originally that plan was not going to kick in until we tried to adopt 6.0, but currently we have a scenario for it here. So we need to keep an eye out for security issues affecting those components.
-
We also have development dependencies that will be similarly affected:
symfony/phpunit-bridge v5.1.7 -
We could also try to run closer to Symfony's supported schedule by testing their beta releases during our beta releases each minor, since their minor will be out before Drupal's.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Updated symfony/mime, symfony/var-dumper and symfony/phpunit-bridge to 5.2. New dependency on ymfony/deprecation-contracts added.
| Comment | File | Size | Author |
|---|---|---|---|
| #38 | 3096781-38.patch | 10.38 KB | longwave |
| #35 | 3096781-35-no-constraint-bump.patch | 6.21 KB | xjm |
| #35 | 3096781-35-with-constraint-bump.patch | 6.23 KB | xjm |
| #32 | 3096781-32.patch | 7.34 KB | xjm |
| #29 | 3096781-29.patch | 12.88 KB | longwave |
Comments
Comment #2
alexpottHere's a thought. We could leave core/composer.json alone since we want real dependencies there but we could somehow add the constraints to composer/Metapackage/CoreRecommended/composer.json so that anyone who builds that gets the LTS... oh that's a terrible idea - that means we'd never test on them.
One other thought about adding them as real dependencies is that we could look for parts of core they could replace. For example, var_dumper is a lot like \Drupal\Component\Utility\Variable::export() and I'm sure we have some duplicate functionality with the mime component.
Comment #3
catchComment #6
catchAdded @Eric_A's solution from the other issue too.
Comment #7
xjmI confirmed that this issue is still outstanding. We're on 5.0.7 and the latest release is 5.0.8. We went into beta with this so I'm hesitant to downgrade it at this point.
We have an agreement with Symfony wherein we have two Security Team members with access to their private queue, in order to provide security releases that affect Drupal after their non-LTS minors' security support has ended. Originally that plan was not going to kick in until we tried to adopt 6.0, but it looks like we have a scenario for it here. So I guess we need to keep an eye out for security issues affecting those two components.
Meanwhile, we'll want to make sure these get updated to 5.1. It's potentially worth doing during RC -- normally this would be a beta-deadlined change, but the easy security coverage probably outweighs any disruption.
Comment #8
pasqualleComment #9
xjmCleaning up pre-9.0.0 beta target issues.
Comment #10
xjmWe should also actually discuss this issue again now. I'll ping the other committers about it.
Comment #11
xjmComment #12
alexpottWe're at 5.1.7 - atm. I guess that's the other possibility keep these up-to-date with each minor release.
Comment #13
catchAfter #3055193: [Symfony 5] The "Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser" class is deprecated since Symfony 4.3, use "Symfony\Component\Mime\MimeTypes" instead. we explicitly reference
symfony/mimein core and that will become a proper hard dependency in Drupal 10. So there is no real issue adding it to composer.json now if we wanted to.It would be great if that was the only issue, but Symfony 5.1 is only supported until January 2021, whereas 9.1 will be supported until November 2021 - so we have a nine month gap in security coverage (with the fallback that Drupal security team members are now allowed to help backport security fixes to unsupported versions of Symfony components we use).
If we can get onto Symfony 5.2 during November - i.e. during beta or rc, then it's slightly better, but still only gets us security coverage to July 2021 - if we're going to stick to the minor releases we should definitely do that, three months is very different to nine months.
This is going to be a general problem if we're able to jump to Symfony 6 in Drupal 10, so it's a question of whether we want a taste of it now or stick to Symfony 4 until we get there.
It is quite tempting to try to stay on Symfony 5 as a kind of tracking-Symfony-6 taster with these two components to see how it goes. And will give us a smaller jump to Symfony 6 when we get there.
Assuming we get onto Symfony 5.2, we only have to deal with Symfony 5.3 and 5.4 then we're on an LTS again anyway. But of course if we go that direction it could bite us later.
Comment #14
xjmPresumably, if they're being kept up with the Symfony release schedule, the 5.2 versions will be released in November. It'll be after our beta, but around the time of our RC. Would we be comfortable adding a release note to the beta that these might receive a further update prior to RC, and then tagging our RC with the 5* Symfony things bumped to 5.2?
Comment #15
xjmMeant this one.
Comment #16
xjmThere are also beta tags that we could add in the alpha for testing, if we decide to go that route: https://github.com/symfony/symfony/releases/tag/v5.2.0-BETA2
Comment #17
xjmComment #18
xjmComment #19
xjmThe Symfony PHPUnit bridge is also affected. Yes, it's only a dev dependency, but we ship those in dev tarballs so it's something to pay attention to.
Comment #20
catchI would be yeah.
Comment #21
longwaveSo, Symfony 5.2 is going to make things a bit complicated.
symfony/var-dumperandsymfony/phpunit-bridgeare fine, they just bump straight up. Howeversymfony/mimeadds a number of new dependencies, includingsymfony/serializer:^5.2- but we currently ship with 4.4.15.The good news is that the existing MIME tests seem to pass locally, so let's see how this fares on testbot.
The full set of dependency changes are:
Comment #22
longwaveFixed RequestHandlerTest. DecoderInterface::decode() no longer accepts NULL as $format, but for the purposes of the test double this used to be OK. Instead we tell it that we are actually sending JSON and it works again.
I think the ComposerProjectTemplatesTest fails are false positives in some way.
Comment #23
xjmComment #24
xjmThe test error messages are:
Do we need to add
@betato the end of the beta version requirements to reinforce that we're overriding the minimum stability for these beta packages? Also, should the PHPUnit bridge also be specifying the beta?Comment #25
longwaveSymfony 5.2.0-beta3 is out. Let's try
^5.2@betaas the version constraint and see if that makes the test any happier. Unsure why we aren't getting e.g. symfony/property-access 5.2.0-beta3, maybe prefer-stable is preventing that.Comment #26
longwaveForgot symfony/var-dumper.
Comment #28
eric_a commentedCuriously requested a retest because the first 9.1.0 beta is available now. But the patch doesn't apply anymore.
Comment #29
longwaveSymfony has removed the new dependencies from symfony/mime, which really helps us out here.
https://github.com/symfony/symfony/pull/38888
The new lock diff is
Comment #31
xjmRC2 is now available; unfortunately, it looks like they might not release 5.2.0 until right before 9.1.0 ships.
The test fails are still:
Which, 🤔
Comment #32
xjmLet's try this? We have
symfony/serializeras^4.4.16in one place butsymfony/mimehas 5.2 as a dev dependency according to Packagist. I'm not seeing the result @longwave mentioned of it not being there anymore.Comment #33
xjmFor some reason it rolled back the
symfony/mimechange...Comment #34
xjmOh.
symfony/mimeis ONLY mentioned incomposer/Metapackage/CoreRecommended/composer.json, but not in eithercomposer.jsonfile. Edit: Never mind, I guess this is how it's supposed to be, because it automatically comes back if I remove it.Comment #35
xjmLeaving
symfony/mimeandsymfony/serializerout of it on purpose for the moment because I'm confused about whether or not indirect dependencies are supposed to be pinned inCoreRecommendedand the serializer constraint thing is dicey with letting a production dependency allow a forward major.Comment #38
longwaveSymfony 5.2.0 is out. However I assume this is too late to get into 9.1, but let's see what happens anyway, we will need this for 9.2.
Comment #39
catchI think it's probably too late for 9.1 too, it's a shame we are only a week or two out. However staying on 5.1 we do have an agreement with Symfony that we can help them backport security releases to versions we're using once they're out of official support, so we might get lucky, or if we're unlucky there is a way to deal with it. I would not actually be opposed to jumping up during the release candidate either considering the updates require zero core changes, but between the possibility of a security release in 3+ months or breaking contrib with 9.1.0 who knows...
Note this adds
symfony/deprecation-contractsbut I don't think we need an independent dependency evaluation for that since it'll be covered by Symfony in general. It contains just one conditionally declared global function, trigger_deprecation().Given everything is green I don't see a reason to not RTBC this - although leaving the release manager review tag on so that xjm is able to chime in on the above. It definitely makes sense to get this into 9.2.x asap.
Comment #40
alexpottCommitted 0c30083 and pushed to 9.2.x. Thanks!
Now we can have the 9.1.x discussion
Comment #42
xjmSo for me the goal of this issue didn't really have to do with 5.2 itself, but with the problem of having 10 months in perpetuity where the minor we're using doesn't have security coverage. We have this issue with a few components for D9, and potentially with all of them for D10.
One step we've taken to make this better with 5.3 is to move the 9.2.0 release date back two weeks into mid-June, so that we can definitely update to the stable minor of Symfony before tagging 9.2.0-rc1.
However, that still doesn't solve the problem of the test failures in #35. If we're not going to solve that here, we need a followup to solve it before 5.3 goes into beta. Something like "Allow betas and release candidates of core to use betas and release candidates of Symfony" or something.
Given that we're releasing 9.1 in probably 24h or so, I don't think we should try to backport this to 9.1.x at this point. We'll have to take the hit and provide security coverage for these various components until Dec. 2021 (which the framework managers coordinate with upstream).
Comment #43
xjmPosted #3186364: Allow pre-release dependencies in Drupal pre-release milestones.
Comment #45
effulgentsia commentedSince this wasn't committed to 9.1, let's make sure to include this in the 9.2 release notes, unless it's been superseded with additional updates since then.