netz98 / n98-magerun

The swiss army knife for Magento developers, sysadmins and devops. The tool provides a huge set of well tested command line commands which save hours of work time. All commands are extendable by a module API.
http://magerun.net/
Other
1.44k stars 401 forks source link

OpenMage 20.4.0 / PHP 8.2.19 compatibility #1424

Open aminemekkidph2m opened 2 months ago

aminemekkidph2m commented 2 months ago

Describe the bug

It looks like current version is not compatible with PHP 8.2 version.

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///usr/local/bin/magerun/vendor/symfony/yaml/Inline.php on line 49

Expected behaviour

Output not returning errors.

Steps to reproduce the issue

Running any command using PHP>8.2 version. I'm currently using OpenMage version of Magento.

Technical details

cmuench commented 2 months ago

@aminemekkidph2m The actual stable version of n98-magerun does not support PHP 8.2. It's not compatible. Compatibility is still in progress. The next planned version is v3.0.0. The currently development version is related to the PR #1326 A version tested with PHP 8.1 is in the develop branch. You can try it by updating with n98-magerun.phar self-update --unstable. I cannot guarantee that this will work for you. I personally do not work actively on the n98-magerun1 version. Sadly there is not much progress here.

sreichel commented 2 months ago

@aminemekkidph2m please test unreleased v3.0 and let us know if the error is still there. I'll fix it in time.

(The linked PR is the "next step" that removes some outdated code.)

sreichel commented 2 months ago

@cmuench can you please check why the build failed for v3?

cmuench commented 2 months ago

@cmuench can you please check why the build failed for v3?

@sreichel Looks like the self-update test job is failing. I found the same error in the issues of the Guzzle project. Maybe we need to upgrade the http client library.

sreichel commented 2 months ago

Tested some commands with v3 and php8.2 ... no errors.

cmuench commented 2 months ago

@sreichel i was able to reproduce the issue in my ddev environment. I will try to fix it.

cmuench commented 2 months ago

@sreichel A rebuild of the phar file fixed the download test job.

cmuench commented 2 months ago

@sreichel I added OpenMage 20.1.0 and 20.9.0 to the Github Actions. Currently the installation with the install command fails due to a missing Zend_Cache class. Is there something special in the installation process in OpenMage >20.0?

sreichel commented 2 months ago

@cmuench i will test it later. Sounds similar to https://github.com/OpenMage/magento-lts/issues/2961

Edit: in 20.1.0 lib/Zend was replaced with composer dependency.

cmuench commented 2 months ago

@sreichel it's strange. We install via composer. It seems that the dependency is loaded correctly.

sreichel commented 2 months ago

@cmuench yeah, actions log seems okay. Local ddev works too.

Is it possible that vendor is outside of installDir "magento"?

Possible related: https://github.com/OpenMage/magento-lts/pull/3226

I have no other idea so far and try to debug with https://nektosact.com

cmuench commented 2 months ago

@sreichel I just allowed the Github Actions jobs running phpunit and bats to fail by setting continue-on-error: true. In the CI/CD result it's now always OK but we can check the result log then. And at least the installation can be tested for this versions until the issues is fixed in OpenMage.

sreichel commented 2 months ago

@cmuench provided a first fix over there.

Note: maybe we have to add some lines to clean EAV-cache. But lets wait with this.

sreichel commented 1 month ago

@aminemekkidph2m can we close it?