Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem/Motivation
The current composer.json
for the DevDependencies metapackage and the production dependency on composer/semver
are not compatible with Composer 2.
Proposed resolution
- Loosen the constraints to allow installation with Composer 2.
- Keep locked dependencies the same.
Remaining tasks
Discuss. Do it.
User interface changes
N/A
API changes
Drupal 9.1 is installable with the Composer 2 alpha.
Data model changes
N/A
Release notes snippet
Drupal 9.0.0 was intended to be compatible with Composer 2; however, certain composer.json
constraints in core were not compatible with Composer 2. Drupal 9.1 adjusts the production constraints for composer/semver
and the dev dependency constraint for composer/composer
to allow Composer 2 testing.
Comment | File | Size | Author |
---|---|---|---|
#6 | composer-interdiff-6.txt | 1.27 KB | xjm |
#6 | composer-3159967-6.patch | 3.29 KB | xjm |
Comments
Comment #2
xjmSomething like this.
Comment #4
xjmForgot to update the lockfile, for the first fail.
And maybe the scaffold needs to be changed too for the second?
Comment #6
xjmOne more spot.
Comment #7
xjmSo the metapackage is not supposed to actually have two versions in it -- this is supposed to pin a single version. The rest of the patch could use review still.
Comment #8
andypostThis patch also unblocks compability with PHP 8.0
Comment #9
andypostUpgrade of
composer/semver
could use separate issue as composer upgrade may affect plugins apiComment #10
Gábor Hojtsy#3135247: Composer's "prefer-stable" setting cannot be relied on to produce a stable release landed, so this should be possible now. Note that Composer 2 stable is this months (within two weeks), so it would be useful to be compatible.
Comment #11
greg.1.anderson CreditAttribution: greg.1.anderson at Pantheon commentedI think that this issue is a duplicate of #3128631: Update dependencies composer/composer ^2 and composer/semver to ^3. Please see comments there for issues.
The dev-dependencies metapackage is designed to allow versions to "float"; it will contain the same version constraints as the require-dev section of the top-level composer.json file. If we desire to only allow Composer 2 dev dependencies, then we could remove the
^1.9.1 ||
from /composer.json.This won't work unless we float both versions. Composer 1 requires composer/semver 1.x, and Composer 2 requires composer/semver 3.x. I would recommend doing both at the same, time, and only pick one version to support. Other decisions are possible, again, see #3128631.
Comment #12
catchMarking duplicate of #3128631: Update dependencies composer/composer ^2 and composer/semver to ^3.