Composer dependencies with dependencies on root cannot be resolved

Created on 1 October 2023, over 1 year ago

Problem/Motivation

In MR's, when a project (the root) has a dependency on another, which in turn has a dependency back to the root project, Composer is unable to resolve the version of the root project properly. This results in errors like:

- drupal/symfony_messenger_doctrine[dev-1.x, 1.x-dev] require drupal/symfony_messenger ^1 -> satisfiable by drupal/symfony_messenger[dev-1.0.x, 1.0.0-alpha1, 1.0.0-alpha2, 1.0.x-dev (alias of dev-1.0.x)] from composer repo (https://packages.drupal.org/8) but drupal/symfony_messenger is the root package and cannot be modified. See https://getcomposer.org/dep-on-root for details and assistance.

Steps to reproduce

Where a MR in drupal/symfony_messenger is being tested. Its require-dev in composer.json relies on drupal/symfony_messenger_doctrine. In turn, drupal/symfony_messenger_doctrine has a dependency on drupal/symfony_messenger.

Proposed resolution

Add a COMPOSER_ROOT_VERSION env var in the same manner as drupal/drupal seems to have done.

See also https://getcomposer.org/doc/articles/troubleshooting.md#dependencies-on-...

Remaining tasks

Verify, implement.

🐛 Bug report
Status

Active

Component

gitlab-ci

Created by

🇦🇺Australia dpi Perth, Australia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024