Problem/Motivation

This issue is split off from #3091418: Update composer dependencies on 9.0.x following PHP 7.2 requirement to address doctrine/* Composer requirements.

Per @catch in comment #40:

The Doctrine website is showing several of the versions updated to here as unsupported, with newer versions in development (but not released yet) and only older versions still supported (some still more recent than the versions we're on).

Went through a few.

I have no idea why they have essentially 'dead end' versions with releases from two months ago, it could possibly be their website not updated fully yet, but I think we need to investigate a bit more.

  1. +++ b/composer.lock
    @@ -244,30 +244,30 @@
    {
    "name": "doctrine/annotations",
    -            "version": "v1.4.0",
    +            "version": "v1.8.0",
      "source": {

    I don't think we can go to doctrine/annotations 1.8

    1.8 is unsupported, 2.0 is upcoming, 1.7 is supported, according to

    https://www.doctrine-project.org/projects/annotations.html

  2. +++ b/composer.lock
    @@ -308,37 +308,42 @@
    {
    "name": "doctrine/cache",
    -            "version": "v1.6.2",
    +            "version": "1.10.0",

    Similarly doctrine/cache 1.10 is unmaintained, only 1.8 is

    https://www.doctrine-project.org/projects/cache.html

  3. +++ b/composer.lock
    @@ -372,44 +377,53 @@
    {
    "name": "doctrine/collections",
    -            "version": "v1.4.0",
    +            "version": "1.6.4",

    This is OK.

    https://www.doctrine-project.org/projects/collections.html

  4. +++ b/composer.lock
    @@ -438,44 +452,53 @@
    "name": "doctrine/common",
    -            "version": "v2.7.3",
    +            "version": "v2.11.0",
    "source": {

    This is also OK.

    https://www.doctrine-project.org/projects/common.html

  5. +++ b/composer.lock
    @@ -507,35 +604,39 @@
    {
    "name": "doctrine/inflector",
    -            "version": "v1.2.0",
    +            "version": "1.3.1",

    And this is OK too.

    https://www.doctrine-project.org/projects/inflector.html

  6. +++ b/composer.lock
    @@ -585,32 +686,34 @@
    {
    "name": "doctrine/lexer",
    -            "version": "1.0.2",
    +            "version": "1.2.0",
    "source": {

    Can't update this one for the same reason

    https://www.doctrine-project.org/projects/lexer.html

  7. +++ b/composer.lock
    @@ -645,7 +748,165 @@
    -            "time": "2019-06-08T11:03:04+00:00"
    +            "time": "2019-10-30T14:39:59+00:00"
    +        },
    +        {
    +            "name": "doctrine/persistence",
    +            "version": "1.3.3",
    +            "source": {
    +                "type": "git",
    +                "url": "https://github.com/doctrine/persistence.git",
    +                "reference": "99b196bbd4715a94fa100fac664a351ffa46d6a5"
    +            },
    +            "dist": {

    This one is OK. https://www.doctrine-project.org/projects/persistence.html

And again in comment #40:

OK I might have found part of the problem here, see this announcement:

https://www.doctrine-project.org/2018/07/12/common-2-9-and-dbal-2-8-and-...

Proposed resolution

1. Update the Doctrine components that have a clear supported version.

2. Clarify support status for the ones that don't and handle those in a follow-up.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

doctrine/annotations has been updated from v1.4.0 to v1.8.0.
doctrine/instantiator has been updated from 1.0.5 to 1.3.0.
doctrine/lexer has been updated from 1.0.2 to 1.2.0.
doctrine/reflection v1.1.0 has been added.
doctrine/common and its dependencies doctrine/cache, doctrine/collections and doctrine/inflector have been removed as they are no longer used by Drupal core.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

TravisCarden created an issue. See original summary.

xjm’s picture

xjm’s picture

Issue summary: View changes

Adding a couple blockquote tags to the IS for clarity.

xjm’s picture

Issue tags: +Drupal 9, +9.0.0 release notes
xjm’s picture

Issue tags: +Needs release note

Once we figure this out it'll also need a release note.

xjm credited catch.

xjm’s picture

Title: Update Composer dependencies on doctrine components in 9.0.x » Update Composer dependencies on Doctrine components in 9.0.x

Also ensuring catch is credited too.

catch’s picture

Some of the Doctrine components we didn't update in the other issue have clear upgrade paths, for example doctrine/collections.

I think we could spin off a further issue to update those ones together, then maybe one issue each for the components that have 'dead end' releases?

catch’s picture

Started to look at this, but we can't drop doctrine/lexer until we remove egulias/EmailValidator which depends on it, so I've opened #3105181: Remove egulias/EmailValidator to do that since we don't use that library at all - it was just left in in case someone else does.

That issue doesn't necessarily block this one but might as well do the easy bits first.

catch’s picture

Status: Active » Needs review
FileSize
9.56 KB

egulias/EmailValidator was a dead end - we use that in our own validation component still.

I started doing a patch to update Doctrine components that have an obvious latest supported version, but this runs into problems with dependencies.

doctrine/collections (v1.4.0 => 1.6.4)

doctrine/inflector (v1.2.0 => 1.3.1)

doctrine/instantiator (1.0.5 => 1.3.0)

These are OK.

doctrine/common (v2.7.3 => v2.11.0)

These should be doable, but doctrine/common depends on doctrine/event-manager (new package for us), which has the same confusing support documentation: https://www.doctrine-project.org/projects/event-manager.html

We could force doctrine/event-manager back to 1.0 with a conflicts entry in composer.json, but that will of course prevent us from updating it until we explicitly remove it.

@mglaman opened this issue against doctrine/lexer for clarification on the support status. https://github.com/doctrine/lexer/issues/39

So here's a patch that only does doctrine/inflector, doctrine/instantiator, doctrine/collections

catch’s picture

This time with the patch.

catch’s picture

catch’s picture

Issue summary: View changes
Issue tags: -Needs release note
catch’s picture

Status: Needs review » Needs work

Per #3105650-3: Clarify and/or work around Doctrine latest stable branches being unsupported Doctrine has confirmed that it's their website that is outdated, rather than an actual lack of support for these versions.

So we should be able to go back to a full patch here - updating all doctrine components to their latest stable releases.

longwave’s picture

Status: Needs work » Needs review
FileSize
27.67 KB
$ composer-lock-diff --no-links
+------------------------+--------+--------+
| Production Changes     | From   | To     |
+------------------------+--------+--------+
| doctrine/annotations   | v1.4.0 | v1.8.0 |
| doctrine/cache         | v1.6.2 | 1.10.0 |
| doctrine/collections   | v1.4.0 | 1.6.4  |
| doctrine/common        | v2.7.3 | 2.12.0 |
| doctrine/inflector     | v1.2.0 | 1.3.1  |
| doctrine/lexer         | 1.0.2  | 1.2.0  |
| doctrine/event-manager | NEW    | 1.1.0  |
| doctrine/persistence   | NEW    | 1.3.4  |
| doctrine/reflection    | NEW    | v1.1.0 |
+------------------------+--------+--------+
longwave’s picture

Whoops, missed the dev dependencies.

$ composer-lock-diff --no-links
+------------------------+--------+--------+
| Production Changes     | From   | To     |
+------------------------+--------+--------+
| doctrine/annotations   | v1.4.0 | v1.8.0 |
| doctrine/cache         | v1.6.2 | 1.10.0 |
| doctrine/collections   | v1.4.0 | 1.6.4  |
| doctrine/common        | v2.7.3 | 2.12.0 |
| doctrine/inflector     | v1.2.0 | 1.3.1  |
| doctrine/lexer         | 1.0.2  | 1.2.0  |
| doctrine/event-manager | NEW    | 1.1.0  |
| doctrine/persistence   | NEW    | 1.3.4  |
| doctrine/reflection    | NEW    | v1.1.0 |
+------------------------+--------+--------+

+-----------------------+-------+-------+
| Dev Changes           | From  | To    |
+-----------------------+-------+-------+
| doctrine/instantiator | 1.0.5 | 1.3.0 |
+-----------------------+-------+-------+
longwave’s picture

Issue summary: View changes

Updated release notes snippet

catch’s picture

Status: Needs review » Reviewed & tested by the community

These are all minor updates (or new indirect dependencies on other Doctrine components) and the patch looks fine. I don't think there's anything else to do here.

longwave’s picture

Have we considered dropping doctrine/common? It seems like this has mostly been split up into individual packages now, and we could just depend on the ones we actually need in D9?

longwave’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
21.53 KB

Rather than bring in three new dependencies, we can bring in one and get rid of four others that we don't actually use?

$ composer-lock-diff --no-links
+----------------------+--------+---------+
| Production Changes   | From   | To      |
+----------------------+--------+---------+
| doctrine/annotations | v1.4.0 | v1.8.0  |
| doctrine/cache       | v1.6.2 | REMOVED |
| doctrine/collections | v1.4.0 | REMOVED |
| doctrine/common      | v2.7.3 | REMOVED |
| doctrine/inflector   | v1.2.0 | REMOVED |
| doctrine/lexer       | 1.0.2  | 1.2.0   |
| doctrine/reflection  | NEW    | v1.1.0  |
+----------------------+--------+---------+

+-----------------------+-------+-------+
| Dev Changes           | From  | To    |
+-----------------------+-------+-------+
| doctrine/instantiator | 1.0.5 | 1.3.0 |
+-----------------------+-------+-------+
Gábor Hojtsy’s picture

Status: Needs review » Reviewed & tested by the community

Great stuff. Normally we would need to issue deprecation notices for removing APIs, but there is no Drupal API involved here, so not sure how we would have done it.

catch’s picture

Status: Reviewed & tested by the community » Needs work

So that's great if we can do that, but if so we need to remove references to Doctrine/Common elsewhere in the codebase and replace them with the actual dependencies.

core/lib/Drupal/Component/ClassFinder/composer.json
core/lib/Drupal/Component/Annotation/composer.json
composer/Plugin/VendorHardening/Config.php

longwave’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
23.11 KB
1.58 KB

Addressed #22, also updated release notes snippet to reflect this new approach.

Note that we do not appear to need to add any new dependencies to the vendor hardening config, as "tests" are automatically excluded from Doctrine release builds through .gitattributes.

xjm’s picture

Nice!

mondrake’s picture

Status: Needs review » Reviewed & tested by the community

Let's get this in, then?

  • catch committed 8b072d6 on 9.0.x
    Issue #3104265 by longwave, catch, xjm, TravisCarden: Update Composer...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Yes this looks great now to me as well with the changes in #23, really nice to drop Doctrine\Common as part of the upgrade.

Wim Leers’s picture

Woah, nice, fewer dependencies!

Status: Fixed » Closed (fixed)

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

longwave’s picture

Added a CR for this following comments from @mglaman and @xjm in Slack: https://www.drupal.org/node/3117956