-
Notifications
You must be signed in to change notification settings - Fork 440
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
PHP 8.1 compatibility #957
Comments
Hi, |
@veewee please also add psr/container there are packages that can't be upgrade because grumphp is still using v1 |
Idd surely accept a PR for that.. care to give it a try? |
Please check #968 |
Are you guys willing to switch to the https://github.com/laravel/serializable-closure fork? Since I agree with the remarks on opis/closure that depending on FFI is not a very good idea. |
I am willing to switch to whatever works best. https://github.com/amphp/parallel-functions/blob/master/composer.json#L29 Lets keep an eye on this issue as well: |
@veewee there are some remarks in the See: opis/closure#102 (comment) Using laravel/serializable-closure would at least fix the deprecation notices right now and you can look into going to opis/closure in the future. |
@tm1000 it's not that simple ... laravel/closure is not marked as a replacement for opis/closure. See composer.json So I am waiting to see what AMP is going to do at this moment. |
amphp/parallel-functions released a version 1.1.0 with laravel/closure. This now breaks grumphp on PHP 8.1 with:
Uncaught Amp\Serialization\SerializationException in worker with message "The given data could not be serialized: Laravel\SerializableClosure\Support\ReflectionClosure::__construct(): Argument #1 ($closure) must be of type Closure, Opis\Closure\SerializableClosure given, called in .../vendor/laravel/serializable-closure/src/Serializers/Native.php on line 300" and code "0"; use Amp\Parallel\Worker\TaskFailureException::getOriginalTrace() for the stack trace in the worker
|
Nice! Thanks for mentoning @leonexcc. Someone interested in implementing the Laravel serializable closures in here? |
Also broken on PHP 8.0. Pinning amphp/parallel-functions to v1.0.0 fixes it for now. |
Also broken on php7.4 since parallel function 1.1.0, pinning does fix it there too |
Locked it to 1.0 for 1.7.1. |
There are next changes: - Minimum PHP version supported upgraded to 7.4 (#29) - PHPUnit version upgraded to 9 (#29) - Add run unit tests Github action (#30, #31) - Remove travis (#30) - Fix code style issues (#32) - Fix by workaround grumphp issue with TypeError, see phpro/grumphp#957 (#32) - Update friendsofphp/php-cs-fixer to 3 (#33) - Add psalm (#34, #35) - Add check cs github action (#36)
There are next changes: - Minimum PHP version supported upgraded to 7.4 (#29) - PHPUnit version upgraded to 9 (#29) - Add run unit tests Github action (#30, #31) - Remove travis (#30) - Fix code style issues (#32) - Fix by workaround grumphp issue with TypeError, see phpro/grumphp#957 (#32) - Update friendsofphp/php-cs-fixer to 3 (#33) - Add psalm (#34, #35) - Add check cs github action (#36)
@mougrim : I also patched this locked version to v1.5.1 |
FYI : found a solution for using PHP 81 compatible laravel closures. Will release it soon. First trying to get box to work as well for grumphp-shim, since it now is PHP 81 compatible. |
Released the fixes for the serializable closure |
I'm still seeing this using v1.5.1 on PHP 7.4:
I presume this is fixed in v1.8.1, but can we get this backported to a version compatible with PHP 7.4 as well? |
@danepowell I'm a bit confused here. That interface is deprecated in php 8.1. Since you are on 7.4, you shouldnt be getting that deprecation warning? |
No problem, I should have explained. We use grumphp in a packaged application that must run on any supported PHP version (7.4-8.1). Thus we need to use grumphp v1.5.1, as it's the latest to support PHP 7.4. But if a user on PHP 8.1 runs our app, they get the deprecation errors. Specifically, we use Composer's platform config to mandate support of PHP 7.4 in our composer.json. |
@danepowell If your interested, I can setup a 1.5.x branch to point your commits to. |
Is there any reason that PHP 7.4 compatibility was explicitly dropped in #956? As far as I can tell, the code in master should be cross-compatible with PHP 7.4 and PHP 8 except for the explicit Composer php dependency. Restoring PHP 7.4 compatibility in HEAD seems much more maintainable than backporting PHP 8 to v1.5.1, which essentially becomes a forked and non-LTS branch. Opened #994 to bring back PHP 7.4 in HEAD. |
We usually support latest 2 versions. That makes the dependency tree easier to maintain. (And less time consuming) For older php versions you can then use older grumphp versions without any issue. But indeed , if you have to support all active php versions in projects and want to use grumphp, that's an issue. |
vendor/bin/grumphp -V
We added PHP 8.1 compatibility in #956.
However, not all downstream packages are fully compatible yet.
Therefore, you might still see some deprecation warnings.
The tool itself should be working though!
Awaiting deps:
laravel/serializable-closure
package amphp/parallel-functions#29Awaiting dev deps
Awaiting shim deps (patched locally)
Broken Tests
Fix skipped E2E tests- currently won't do. They seem buggy edge cases anyways. If there is any need for them to still work, time can be investedThe text was updated successfully, but these errors were encountered: