laminas / laminas-continuous-integration-action

GitHub Action for running a QA check
BSD 3-Clause "New" or "Revised" License
19 stars 19 forks source link

Use `--ignore-platform-req=php+` for ignoring PHP deps #179

Open boesing opened 1 year ago

boesing commented 1 year ago

Feature Request

Q A
New Feature yes
RFC no
BC Break no

Summary

Composer with v2.2 released support for ignoring upper bounds of platform requirements. To do so, adding the + suffix to the platform requirement will suffice.

This is quite useful, since --ignore-platform-req=php will mostly ignore any dependency and thus, depending on the constraint ranges, will also allow older PHP versions which weren't supported previously. This must not be related to laminas components but since laminas does sometimes use transitive dependencies, these dependencies could have a more wider range of supported PHP versions which then might install dependencies in case of --prefer-lowest which do definitely not support the latest PHP version we are actually trying to test.


From composer documentation:

--ignore-platform-req: ignore a specific platform requirement(php, hhvm, lib- and ext-) and force the installation even if the local machine does not fulfill it. Multiple requirements can be ignored via wildcard. Appending a + makes it only ignore the upper-bound of the requirements. For example, if a package requires php: ^7, then the option --ignore-platform-req=php+ would allow installing on PHP 8, but installation on PHP 5.6 would still fail.

Xerkus commented 3 months ago

This is of limited utility since with this feature any version of dependency can be installed anyway on the new php version where we do need platform ignore and we got no reason to do platform ignore on like php 8.1 which then would prevent packages for >8.2 installed on 8.1