composer update
pulls in packages ignoring require.php
constraints
#11164
-
I have Concrete problem case {
"name": "herndlm/composer-update-constraints",
"type": "library",
"require": {
"php": "^7.4 || ^8.0",
"league/commonmark": "^2.3"
},
"autoload": {
"psr-4": {
"Herndlm\\ComposerUpdateConstraints\\": "src/"
}
}
} installs the indirect dependency I created a reproducer at https://github.com/herndlm/composer-update-constraints and let Renovate update the lockfile in https://github.com/herndlm/composer-update-constraints/
8000
pull/3/files#r1009228391. It does that using the latest composer (2.4.4) and latest PHP (8.1.12) that are in reach for me using the following command: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
from my experience composer always installs the highest version of packages that are compatible with the system's version of the docs allude to this behaviour, implying that the
i currently have to support packages for
it's worth noting that the |
Beta Was this translation helpful? Give feedback.
from my experience composer always installs the highest version of packages that are compatible with the system's version of
php
and the^7.4 || ^8.0
in the root package is used to print warnings if trying to runcomposer update
on a machine without a satisfactory version:the docs allude to this behaviour, implying that the
php
constraint is for the user:i currently have to support packages for
7.4
and8.1
, and to work with this i install both versions of php locally and use the following commands:php7.4 $(which composer) update
php8.1 $(which composer) update
it's worth noting that the
php
constraint is considered when requiring packages in…