-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
lockfile maintenance with composer is broken when config.platform.php is set #4396
Comments
We run I'm guessing this means we need to check if config.platform.php is met and run Composer within the "correct" version of PHP, so that it doesn't propose incorrect versions of dependencies? |
i've played a little bit around with the commands that are run and it looks like the problem here is that composer is called with '--ignore-platform-reqs' which ignores the php requirement (and also lib-* and ext-). ignoring lib- and ext-* is ok assuming renovate is running on a machine that does not have all possible extensions installed but for the php requirement it's hard to say, especially in the case when you want to lower the used php version than the installed on. |
If the lock file maintenance were run with the exact right version of php, would it generate the correct lock file, even if |
no it will not, see my test, i have installed php in version 7.3.8 and removed the config entry from composer.json
|
So It sounds like:
But will that cause other problems, e.g. with extensions? |
it can cause problems if an extension is not installed but required for an project, so the machine where composer runs during renovate execution must have all extensions installed or composer will fail |
Is there a way to ignore missing extensions but still honouring the php version required? If not then there may be no way for us to reliably do lock file maintenance. If we honour extensions then we'll fail because of that. If we ignore them then we might propose invalid upgrades. And I assume it's not possible to somehow have every single possible extension installed on the PHP container we will call to upgrade and install. |
as far as i know there is no such option, that's, we i propose to add an option to enable/disable this composer flag, so if someone doesn't want to use it he/she must be aware of these fact that all necessarry php extension have to be installed on the machine where renovate is running. it's not the solution for your docker images that you are providing but maybe for all the guys who are running it by there own |
This duplicates #2355
I agree with these points.
You should be using the "config": {
"platform": {
"php": "7.2.14",
"ext-fileinfo": "1.0.5",
"ext-pdo": "7.2.14",
"ext-session": "7.2.14",
"ext-iconv": "7.2.14",
"ext-zip": "1.15.4"
}
}, People should really be using |
Removing Going forward, there will be three approaches to using third party binaries with Renovate:
|
Will you accept a PR which adds a config option to disable |
Can I suggest this is closed as a duplicate of #2355 to avoid confusion? |
Looks like #13657 resolved this 👍 |
What Renovate type are you using?
renovate-cli
Describe the bug
i enabled the lockfile maintenance for my php composer project but now it fails every time because the lockfile maintenance ignores the config.platform.php configuration in composer.json.
My project currently is built for php 7.2 and includes a transitive dependency on
ocramius/package-versions
, when now the maintenance is done it upgrades this version which only can be used with php 7.3 even if in composer.json php 7.2 is specified. so the first step is fine (upgarding dependencies), means no error, but when the project is then be built it fails during composer install withProblem 1 - Installation request for ocramius/package-versions 1.5.1 -> satisfiable by ocramius/package-versions[1.5.1]. - ocramius/package-versions 1.5.1 requires php ^7.3.0 -> your PHP version (7.2.19) overridden by "config.platform.php" version (7.2.19) does not satisfy that requirement.
Did you see anything helpful in debug logs?
nothing found
To Reproduce
Steps to reproduce the behavior:
doctrine/migrations
Expected behavior
probably lockfile maintenance should not ignore the platform php version specified in composer.json or provide a way to opt-in or opt-out to use the defined version
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: