-
-
Notifications
You must be signed in to change notification settings - Fork 249
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
Upgrade PHP engine from 8.3 to 8.4 #4351
Comments
We have still to wait ... :( Available only on |
I just saw that alpine 3.21 was released today https://www.phoronix.com/news/Alpine-Linux-3.21 |
@llaville you are the PHP master here, we wait for your PR :) |
@echoix Thanks for this notification ! |
@nvuillam As we are PHP 8.4 available on Alpine Linux v3.21 (https://pkgs.alpinelinux.org/packages?name=php84&branch=v3.21&repo=&arch=x86_64&origin=&flagged=&maintainer=) I'll prepare a PR today ! Afraid that we are to wait again, because Python 3 is not yet available on v3.21 oh yes https://pkgs.alpinelinux.org/packages?name=python3&branch=v3.21&repo=&arch=&origin=&flagged=&maintainer= but not on previous x86, x86_64 architecture
|
Trying directly with Docker image : https://hub.docker.com/_/php/tags?name=8.4.1-cli-alpine3.20 |
I've been able to build a MegaLinter docker image with previous PHP 8.4.1 Alpine 3.20. I'll keep you aware when all my regression tests will be over. And if OK a PR will follows |
Tip For PHPStan user audience As MegaLinter v8.2+ support now only PHPStan 2.0, if you have a project than raise no errors with PHPStan 1.12, I recommend to disable PHPStan error to avoid your CI to fails. To do so: add this entry in your MegaLinter config file PHP_PHPSTAN_DISABLE_ERRORS: true |
Tip For Psalm user audience As MegaLinter v8.2+ support only Psalm 5.26.x, (that is not yet PHP 8.4 compatible), I recommend to disable Psalm linter to avoid your CI to fails. To do so: add this entry in your MegaLinter config file DISABLE_LINTERS:
- PHP_PSALM |
@llaville plz can u add the tips in related linter descriptir linter_text property ? :) (it handles markdown ^^) |
For the PR, maybe just watch and wait until a Python docker image with the same Python version is published. Renovate probably won't help, as it is like two kinds of versions in the same tag, and I didn't configure it precisely enough for that. I think there's some failures with Python 3.13 still |
@echoix You've probably right : we have to wait that all elements are available, because But no Docker image |
Related to my previous tip #4351 (comment) about Psalm, I don't think so that the project team will support PHP 8.4 in a reasonable timeframe. Especialliy also because Psalm v6.0 is more a dream than a beginning of reality (and no PHP 8.4 is provided too) My question to MegaLinter Core team:
|
What is your preferred option ? (you are the PHP MegaLinter Core Team :D ) My main concern is to remain compliant with the more users possible, and to avoid breaking changes when we create new MegaLinter versions ^^ |
@nvuillam I've tried to install Psalm 5.26 on a PHP 8.4 platform, but cannot removed DEPRECATIONS raised by new PHP 8.4 engine. All PHP users should know how to disable it Tip With php -d error_reporting=24575 vendor/bin/psalm But in case of Psalm, it won't work because they disalowed this behaviour at https://github.com/vimeo/psalm/blob/5.26.1/src/Psalm/Internal/ErrorHandler.php#L62 So, even if we can install Psalm 5.26 on PHP 8.4 (with Other alternative is to embed both PHP 8.3 and 8.4 engine. If we won't let Psalm Users behind, we have no choice than to tell us to use MegaLinter until a version (8.3.0 is the latest at day of today) that suuport PHP 8.3 WDYT ? |
I'm afraid that making MegaLinter even heavier just for a linter is maybe not such a good idea :/ How is PHP 8.4 adoption ? Can't we wait that psalm becomes compliant with it before upgrading PHP in MegaLinter ? |
👍
PHP 8.4 is planned since a long time, and even if projects like mine migrated to them lately, there are no really BC breaks that should stop adoption. When I have a look on projects that have already adopted PHP 8.4, there are no so much changes or difficulty to do so ! Of course we can wait Psalm adopt it, but are there are no clearly roadmap, we don't know how much time ! |
I will suspend my works on it ... until next year, and I hope it will come with good news ;-) |
This issue has been automatically marked as stale because it has not had recent activity. If you think this issue should stay open, please remove the |
I suspect we will wait a long ... long time before Psalm support PHP 8.4 |
I think you're right that we can't be waiting forever for some packages that might never be updated |
To all MegaLinter team: I've a good and bad news. First, begins with the GOOD one:
Now the BAD news :
While in same time, with
Because the solution (purely Composer based) to run Psalm with PHP 8.4 runtime is really pretty cool, and we don't have to wait a Psalm compatible version (v5.26.1 works fine), I hope that the PR I'll propose soon will be run successflully and CI will be able to build MegaLinter Dockerfiles. More info, and PR will come very soon ... |
@llaville thanks again for being the PHP soul of MegaLinter 🥇 |
Even if more and more PHP projects begun to drop Psalm in favor of PHPStan : Recent ones:
We still give it a possibility to run Psalm 5.26 on PHP 8.4 runtime with commit e1eea9b (thanks to Composer platform setting to allow it). PHP 8.4 runtime was upgraded by commit c29b7f9 |
Strange because PR ML bot #4517 (comment) raise a warning ;-) |
@nvuillam You're right. |
Ok found origin of issue with PHP-CS-Fixer. Natively, latest version 3.68.1 accept PHP 8.4 as constraint https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/v3.68.1/composer.json#L23 and so can be installed on a PHP 8.4 platform. But, PHP 8.4 is not officially yet supported by project (see PHP-CS-Fixer/PHP-CS-Fixer#8298) And when we run MegaLinter tests we can see it (the answer into logs). Following Contribution Guide, here are the procedure to test it (with the quick fix to make tests PASSED) docker buildx build -f linters/php_phpcsfixer/Dockerfile . --tag php_phpcsfixer --secret id=GITHUB_TOKEN,env=GITHUB_TOKEN
TEST_KEYWORDS_TO_USE="php_phpcsfixer"
docker run -e PHP_CS_FIXER_IGNORE_ENV=true -e TEST_CASE_RUN=true -e OUTPUT_DETAIL=detailed -e TEST_KEYWORDS="${TEST_KEYWORDS_TO_USE}" -e MEGALINTER_VOLUME_ROOT="." -v "/var/run/docker.sock:/var/run/docker.sock:rw" -v $(pwd):/tmp/lint php_phpcsfixer And we could see expected results :
Where is the best place to set environment variable |
@llaville in the descriptor, in the install -> dockerfile property :) Example:
|
CI failed but I don't understand why it blocked ! With branch main...toPhp84 and 6 commits I've rebuild and test Docker container and got no error |
When building and a commit is made by a bot using the GITHUB_TOKEN, the workflows don't run. It prevents infinite loops. It's a GitHub limitation. Close and reopen the PR, add a commit made by a human, or anything that triggers a synchronize event. I closed and reopened one of your PRs since CI didn't start. But maybe you continued after. |
I think there is a problem with automation when retreiving some package, especially PHP-CS-Fixer On branch
But version 7.4.0 does not exists. Latest version available is only 3.68.1 |
I'll try with a new branch and applying only 5 essential commits ! |
No new PR, but building is in progress : https://github.com/oxsecurity/megalinter/actions?query=branch%3AtoPhp84_v2 |
Essential content are only 4 commits : main...toPhp84_v2 |
All is ok now with new branch |
Usually when
Usually I just update the comment of MegaLinter auto-fix commit, then force push to launch again the job :) |
As it seems I'm not able to re-open PR #4518 I've closed myself, I'll open a new one |
@nvuillam / @echoix As you've perharps noticed (like me) MegaLinter 8.4.0 embedded Psalm v6.0 (just been released) that support natively PHP 8.4 runtime. So my fix at https://github.com/oxsecurity/megalinter/blob/v8.4.0/megalinter/descriptors/php.megalinter-descriptor.yml#L137 Even if it will continue to work like this, it may be clarify php descriptor file. Oh and also BTW, I've noticed that on https://github.com/oxsecurity/megalinter/releases/tag/v8.4.0 we still see invalid version fro PHP-CS-Fixer already mentioned at #4519 (review) |
@llaville thanks for noticing the issues, we'll be glad to merge your PRs :) |
Is your feature request related to a problem? Please describe.
Upgrade default PHP engine from 8.3 to 8.4
As it now available on Alpine Linux Packages : see https://pkgs.alpinelinux.org/packages?name=php84&branch=edge&repo=&arch=x86_64&origin=&flagged=&maintainer=
Describe the solution you'd like
Upgrade https://github.com/oxsecurity/megalinter/blob/main/megalinter/descriptors/php.megalinter-descriptor.yml
I can suggest a PR
Describe alternatives you've considered
No alternative exists, except if we keep on PHP 8.3
The text was updated successfully, but these errors were encountered: