-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Renovate using legacy PHP, incompatible with PHP 7.3+ code #5675
Comments
|
I think this could be a bit tricky, given that people can use basically any arbitrary Regarding PHP, I see you are using Ubuntu, I can highly recommend |
I am running into this issue as well for a Symfony 5 app. It eventually reaches a point where a certain package contains PHP 7.4 code and lockfile maintenance starts to fail:
The code that triggers the error (PHP 7.4 typed properties): |
Is it save to upgrade our php from 7.2 to 7.4? or do we need multiple versions? Maybe we need multiple versions? |
It's a little challenging to support both multiple versions of PHP as well as Composer, i.e. then it becomes a "matrix". In Ruby we can get away with it because the Bundler install takes just a second or two, so then we dynamically switch Ruby base image version with "docker run" followed by dynamically installing the correct Bundler version. |
I think for now that installing the latest PHP in our Dockerfiles would be best |
ok, working on it |
@viceice You can easily co-install multiple versions from the repository I mentioned above (it's safe, many people use it in production). |
@Majkl578 I know, we prefer to only have one version on our full docker image and have multiple images for the app, which uses the docker tools. |
I’m interested to know how multiple versions of PHP can work? Can Composer itself auto-switch or do we need to run a command to change default PHP version before running Composer? |
No, one is always default as |
I can imagine one can create a rather simple wrapper based on |
🤔 so we have mustiple composer versions with multiple php versions? Do we really need different php versions for composer install, or is it enough to have a supported version? Or does the php version depends on the current project too? |
How many versions of PHP do we need to support? e.g. are all minor versions considered equivalent, so we can have latest |
I think the main issue is compatibility with newer PHP syntax in order for composer to install packages which run scripts without hitting any errors. PHP 7.4 should be backwards-compatible with v7.2+, which is the current minimum supported version. https://www.php.net/supported-versions.php |
So using 7.4 would be enough. Users have to update to a supported version, which should be compatible with 7.4? |
I do not believe that users need to make any changes. If they are using any major framework or composer package, they are already required to use a minimum of PHP 7.2 anyway. Even if they were not using 7.2, the backwards compatibility in most cases goes back to the PHP 5.x series which stopped receiving updates over a year ago. |
And what about composer? Do we need multiple versions? Or is it enough to use the latest stable version? |
Lets build all versions like we did with others - not much work once it’s automated |
Starting with 1.9.x, and 1.10.x |
Did anything come of this? I believe this would also semi solve #2355 as you could create a docker container with the minimum supported PHP version as a means of bypassing the lack of |
Renovate
No. Composer has a minimum requirement of PHP 5.3+ I think this issue needs clarifying that the builtin There is no legacy PHP code in renovate itself... |
What Renovate type are you using?
self-hosted, GitLab
Describe the bug
I was recently investigating why our Renovate bot stopped working. It turned out it's using legacy PHP version 7.2.24 which makes it crash on parse error (with PHP 7.4 code).
Did you see anything helpful in debug logs?
Additional context
I see Renovate is using
--ignore-platform-reqs
, this is extremely dangerous - if the project using Renovate was not ready for the latest PHP version this can easily introduce fatal errors. While it makes sense to overcome issue with missing PHP extensions it also opens a can of worms with unsupported PHP versions (otherwise specified underrequire.php
)-The text was updated successfully, but these errors were encountered: