platformsh-templates / drupal10

Drupal 10 (Composer) template for Platform.sh
16 stars 13 forks source link

Invalid composer version constraint ^2.1 #179

Open rfay opened 4 hours ago

rfay commented 4 hours ago

Describe the bug

The current constraint here is invalid, composer has never supported a 2.1 branch (there is a 2.2). I'm not sure how this can work, but it seems that platform may try and fail to use 2.1, so just uses 2.8.x currently instead.

Include some logs

None needed

Reproducing

Look at it. Do a composer self-update -h

Expected behavior

Use a valid version

Your environment

Platform

Screenshots

No response

Additional context

No response

gilzow commented 4 hours ago

Per the composer docs, the ^ constraint evaluates to >=2.1 <3.0.0 which is valid.

rfay commented 4 hours ago

Platform docs say ^2 as a default, https://docs.platform.sh/languages/php.html#dependencies

gilzow commented 3 hours ago

Composer has definitely had a 2.1 version: https://github.com/composer/composer/releases/tag/2.1.0

The docs are just a reference and not a specific as a project may need a specific version (or specific range).

Additionally, projects do not need to define composer as a global dependency for the project and can instead require a specific version defined in their composer.json(.lock).

That said, Composer 2.1 is EoL so we should go ahead and update to the LTS 2.2 (ie ^2.2) at a minimum in the template. Or, since Drupal requires Composer to be at or greater than v2.3.6, update the template to use ^2.3.6.