Problem/Motivation

I encountered an issue of not be able to update to Drupal 9.4.4 (from 9.4.3) and I believe this is caused by Drupal components requiring Drupal 8 components.

In core/lib/Drupal/Component there are several components with a composer.json file. Some of them require "^8.8". These are:

  • drupal/core-annotation
  • drupal/core-datetime
  • drupal/core-discovery
  • drupal/core-front-matter
  • drupal/core-php-storage
  • drupal/core-render

I have a custom made library that has the following requirement:

  "drupal/core-annotation": ">=8.5"

Note: I use this library in non-Drupal projects as well, but I liked Drupal's plugin system and wanted to reuse that in a custom project.

When executing composer update, Drupal core did not get updated to 9.4.4. So instead I tried composer require drupal/core-recommended:^9.4.4 and there I saw the following line:

  kerckebosch/kkbafas dev-master requires drupal/core-annotation >=8.5 -> satisfiable by drupal/core[8.5.0-alpha1, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.4.3, 10.0.0-alpha1, ..., 10.0.x-dev], drupal/core-annotation[8.5.0-alpha1, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.5.x-dev, 10.0.0-alpha1, ..., 10.1.x-dev]

The issue is also present in Drupal 10.

Steps to reproduce

A simple way to reproduce: create a composer.json file with the following:

{
    "require": {
        "drupal/core-annotation": ">=8.5",
        "drupal/core-recommended": "^9.4"
    }
}

Composer will install Drupal 9.4.3 instead of Drupal 9.4.4. If omitting the line "drupal/core-annotation": ">=8.5", it will install Drupal 9.4.4. Drupal 9.4.3 instead of 9.4.4 is installed as well when requiring "drupal/core-annotation": "^9.0"

Proposed resolution

Update the composer.json files of the components and list them as compatible with Drupal 9.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3301254

Command icon Show commands

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

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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

MegaChriz created an issue. See original summary.

MegaChriz’s picture

Assigned: MegaChriz » Unassigned
Status: Active » Needs review

I have changed the requirements of Drupal core components from "^8.8" to "^8.8 || ^9.0" now, but perhaps you want to remove the compatibility with "^8.8" completely.

MegaChriz’s picture

Hm, I see this is probably be a duplicate of #3272110: Drupal 9 and 10's Drupal\Component composer.json files are totally out of date. I originally searched the issue queue for "drupal/core-annotation" and didn't find anything, so I assumed that the issue did not exist yet. But when I search for the same again, this issue isn't found either. And that's when I tried other search terms.

MegaChriz’s picture

Adding as a related issue for now, because the other is for 9.5 and that won't fix my direct issue for updating to 9.4.4.

MegaChriz’s picture

@larowlan
Thanks for the reply. If I add the following to my project's composer.json, I can indeed update to Drupal 9.4.4:

"replace": {
    "drupal/core-annotation": "^9.4.4"
}

So there is a workaround for this issue. Thanks for pointing me to that other issue. Should this one be closed because there's a workaround for Drupal < 9.5?

Mile23’s picture

Related issues:

This will get fixed in a semi-automated way on release, after #3272110: Drupal 9 and 10's Drupal\Component composer.json files are totally out of date

Mile23’s picture

Related issues:
smustgrave’s picture

Based on #4 should this be closed as a duplicate of https://www.drupal.org/project/drupal/issues/3272110

MegaChriz’s picture

Status: Needs review » Closed (duplicate)

I can now update to Drupal 9.4.5 without the workaround from #7, so the real cause of failing to update to 9.4.4 was fixed in #3116405: Warnings generated when using an optimized autoload file with Composer 1.10 / Composer 2.

The issue that some components require D8 versions of other components remains, but that can be handled completely in #3272110: Drupal 9 and 10's Drupal\Component composer.json files are totally out of date because it doesn't block updating to newer Drupal 9.4.x versions.