Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid composer version constraint ^2.1 #179

Open
rfay opened this issue Oct 24, 2024 · 4 comments
Open

Invalid composer version constraint ^2.1 #179

rfay opened this issue Oct 24, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@rfay
Copy link
Contributor

rfay commented Oct 24, 2024

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

@rfay rfay added the bug Something isn't working label Oct 24, 2024
@gilzow
Copy link
Contributor

gilzow commented Oct 24, 2024

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

@rfay
Copy link
Contributor Author

rfay commented Oct 24, 2024

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

@gilzow
Copy link
Contributor

gilzow commented Oct 24, 2024

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.

@rfay
Copy link
Contributor Author

rfay commented Oct 28, 2024

I concede all of your points. This is a valid spec. Apparently Platform installs composer using a composer require rather than the perhaps more common techniques. It means that this spec in the platform or upsun config is a little odd, but fine.

However, there's no reason for this ^2.1 spec, it's meaningless in the last couple of years. ^2 is obvious and raises no eyebrows, and does no harm, and matches the platform and upsun docs. ^2 does fine for all Drupal versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants