Problem/Motivation
Backporting #3126566: Allow Drupal to work with Composer 2 to the 8.9.x branch exposed a Composer bug that caused composer update
commands that should have upgraded to version 8.8.5 to instead upgrade to the unstable dev release 8.9.x-dev. The full details of this bug are described in composer/composer #8882.
Briefly, Composer confuses 8.9.x-dev as a stable release when updating drupal/core-recommended and composer/installers in the same composer update
command. Composer becomes confused because Drupal 8.9.x-dev requires composer/installers 1.9.0, whereas Drupal 8.8.5 (and similar) requires composer/installers 1.7.0. Updating to 8.9.x-dev should be prevented by the prefer-stable flag, but somehow the fact that composer/installers 1.9.0 is stable, and upgrading to that version requires Drupal 8.9.x-dev, Composer apparently
forgives the non-stable status of Drupal 8.9.x and allows that upgrade in order to also allow composer/installers to upgrade to 1.9.0.
This bug can be avoided by setting "minimum stability" to "alpha" or better, or by pinning composer/installers to version 1.7.0 in the top-level composer.json file.
Proposed resolution
We presume that this Composer bug could be avoided if we remove composer/installers
from drupal/core-recommended
. composer/installers
is not in the page-serving path, so it should be safe to allow it to float in Drupal projects that use drupal/core-recommended
.
Additionally, we will make a new stable 8.8.6 release that does not have composer/installers
pinned in drupal/core-recommended
. This will make it more likely that Composer will find a stable 8.8.x release and not try to upgrade to 8.9.x-dev.
Remaining tasks
Removecomposer/installers
fromdrupal/core-recommended
Add a unit test- Release 8.8.6
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
The project composer/installers
is no longer pinned in drupal/core-recommended
. It may now be upgraded whenever a new version is available, and a Composer-managed site runs composer update
.