What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hi everyone, here I am again. Yesterday with pleasure I receive the Spryker newsletter where it's a

giovanni.piemontese
giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

Hi everyone, here I am again.

Yesterday with pleasure I receive the Spryker newsletter where it's announced the full compatibility with the php 8.0.X version.

Well I said to myself, I was waiting for this moment to switch slowly all the applications to the new version. I start of course from the php docker image and naturally at composer level I'm going to overwrite the platform.php configuration in order to make the last due changes to some versions (such as the elimination of roave/better-reflection etc ...).

Well, after a couple of changes etc... I get stuck and I discover that the library spryker/architecture-sniffer (with current version 0.5.2) requires ondrejmirtes/better-reflection which in spite of itself stops at php version 7.4 and even declares php <7.5 ( :) ).

I'm amazed by this thing as spryker go to communicate to all customers that php8.0 is fully compatible (just because it passes the CI?) and then at the development level is not possible and I wonder if spryker is not still developing with base 7.3 or 7.4 otherwise they would have a corrupted json composer.

Is there anyone who is already working with php8.0.x and uses also at dev level spryker/architecture-sniffer ?
Of course also with the php version correctly installed and configured in composer, otherwise with php8.0 and overriding in composer to 7.4 I can do it too :D

Thanks in advance!

«1

Comments

  • If in question please always refer to master suite ( https://github.com/spryker-shop/suite ) to check for specific versions
    Here you can see that it all runs well in PHP 8 setup in CI

    also https://github.com/ondrejmirtes/BetterReflection/blob/master/composer.json shows that they resolved their issues, which includes the latest tags on that lib, e.g. https://github.com/ondrejmirtes/BetterReflection/blob/4.3.80/composer.json

    You must have outdated dependendies, which causes this.

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    yes i see... 4.3.80 just declare php >=7.1 but newer version tag has php <7.5

    but why in composer (suite master) there is the overriding to php 7.4.15? This allow naturally the installation of course.. I tried to override to 8.0.11 to ensure that everything is compatible...

    Thanks Mark for your quickly support.

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    In composer lock suite master is but installed 4.10.0 that has php < 7.5

  • Well, master suite itself contains PHP7.4 compatible releases, that is true.
    Let me check why it wouldnt go to latest, though.

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    ok, thanks a lot!

  • might be very likely related to their strange stub requirement: "jetbrains/phpstorm-stubs": "dev-master#fdcc30312221ce08f3a4413588e2df4b77f843fc"
    You could try to alias this on project level, some overwrite

    Yeah,

    composer why-not ondrejmirtes/better-reflection 4.3.80

    gives you

    ondrejmirtes/better-reflection  4.3.80      requires          jetbrains/phpstorm-stubs (dev-master#fdcc30312221ce08f3a4413588e2df4b77f843fc)  
    spryker-shop/suite              dev-master  does not require  jetbrains/phpstorm-stubs (but v2019.3 is installed)       
    

    If you manage to install the same dependendy locallly, it should solve itself.

  • composer why jetbrains/phpstorm-stubs

    shows you that this is the only dependency, so nothing else preventing it

    ondrejmirtes/better-reflection  4.10.0  requires  jetbrains/phpstorm-stubs (2019.3) 
    
  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    Ok thanks. I will take a look after my meetings. I will give u a feedback

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    I found still something else in suite master
    "roave/signature": "~1.2.0", --> only php7.3 & php7.4
    "fzaninotto/faker": "^1.6.0", --> is deprecated (only 7.X)
    The spryker/testify 3.4.+ required correctly fakerphp/faker

  • You are right, those should be able to get removed. We dont use them anymore.
    https://github.com/spryker-shop/suite/commit/4574b6c1cd5c7851c0d3db186f63bc561bab5012 should fix that
    It sure now included

    • Removing roave/signature (1.2.0)
    • Removing fzaninotto/faker (v1.9.2)
    • Installing fakerphp/faker (v1.16.0): Extracting archive
  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    Now seems to be ok.... composer config.platform php 8.0.11 and removing they, require jetbrains/phpstorm-stubs:dev-master and automatically downgrade ondrejmirtes/better-reflection (4.10.0 => 4.3.80)

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet
    edited November 2021

    @UQK3ZPJEN

    we found today an error related to php8.0 (with php < 8.0 it works).

    By CMS Block create with PHP8.0 we got this error

    Zed.CRITICAL: TypeError - array_key_exists(): Argument #2 ($array) must be of type array, Generated\Shared\Transfer\CmsBlockTransfer given in
    "/var/www/html/vendor/spryker/cms-block-gui/src/Spryker/Zed/CmsBlockGui/Communication/Form/Block/CmsBlockForm.php::59" {"exception":"[object] (TypeError(code: 0): array_key_ex
    ists(): Argument #2 ($array) must be of type array, Generated\\Shared\\Transfer\\CmsBlockTransfer given at /var/www/html/vendor/spryker/cms-block-gui/src/Spryker/Zed/CmsBlockGu
    i/Communication/Form/Block/CmsBlockForm.php:59)
    

    The second parameter is a TransferObject.

    I have to create an issue ticket or do u think u can manage it internally self? In case it takes a lot of time to fix we can maybe create a patch on pyz level fix, but we are not sure of other similar case exists in spryker core.

    @tom.lehner FYI
    @UQ4B55JLV

  • Unknown
    edited November 2021

    @florian.scholz What do you think? Did we miss this somehow?

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,071 ⚖️ - Guardians (admin)

    @UL65CH0MC when you say “with php < 8.0 it works” you mean you use a container with another php-version and do composer-update again? What version of spryker/cms-block-gui are you currently using?

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    Version 2.7.2 (installed currently) is the last one and in composer has php >=7.3 -> it means fully compatible.

    The problem happend with docker php container and also on our staging system (without docker)

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    we tested to switch the php version to 7.4 and the creating of cms block is working as expected.. with php version 8.0.x we got a 500Error...

  • Are you able to make a PR against that repo with the code that would work in PHP8 too?
    Then we can fast track a review, QA and release on this for the next week already.

  • I cannot promise anything for this week, but with your help we can probably try our very best here to unblock this on project level asap.

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    I can try to make it today evening or tomorrow... ;)

  • U01T075RRHD
    U01T075RRHD Posts: 118 🧑🏻‍🚀 - Cadet

    Any news on that Cms-Block issue?

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    @U01T075RRHD a Project Level Fix is working as expected.. we switched yesterday to php8.0 in production and waiting that no negative feedback come..
    I will make a PR in these days.. If u want I can send u the file for pyz level.

  • U01T075RRHD
    U01T075RRHD Posts: 118 🧑🏻‍🚀 - Cadet

    Thanks for the quick response @UL65CH0MC. I already took the time to fashion a project level solution myself but I was hoping for a patch release from Spryker to address this issue. Since it's a pretty severe thing I'm a bit bummed that nothing has happened so far.

  • Thomas Lehner
    Thomas Lehner Support Engineer @ Spryker Posts: 289 🏛 - Council (mod)
    edited December 2021

    Hey! @UL65CH0MC just let me know when you got around to request the PR if you want to still do it. @U01T075RRHD I am not aware that this issue was reported to us before. Please understand that there is no way we can monitor the Slack community for bug reports currently. If you see an issue, please let us know via official channels and it can be properly evaluated and handled if you suspect it is a core bug

  • U01T075RRHD
    U01T075RRHD Posts: 118 🧑🏻‍🚀 - Cadet

    Please understand that it, in most cases, takes more time to report an issue than it takes to actually implement a project level workaround. Since someone from Spryker already responded in this conversation, I assumed you're fully aware of the issue.

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    @U01T075RRHD u are right.
    But @tom.lehner i will try to create a PR. in the last days was very busy (also family 🙂 )

  • Thomas Lehner
    Thomas Lehner Support Engineer @ Spryker Posts: 289 🏛 - Council (mod)

    I appreciate that and thank you guys for every issue that is reported regardless of that fact to make everyone else benefit. While i don't think there is any reason against mitigating something on project level to unblock you, i believe that issues should be reported so that you don't run the risk of making updates more complicated for you

  • Thomas Lehner
    Thomas Lehner Support Engineer @ Spryker Posts: 289 🏛 - Council (mod)

    Mark is not working with Spryker Support and while his expert knowledge is very much appreciated here he is usually not involved in the process of fixing bugs. But he has asked me to review your comment 🙂

  • U01T075RRHD
    U01T075RRHD Posts: 118 🧑🏻‍🚀 - Cadet

    Understandable ... and no hard feelings. Thanks for the clarification.

  • Thomas Lehner
    Thomas Lehner Support Engineer @ Spryker Posts: 289 🏛 - Council (mod)

    Absolutely. Thanks guys for raising this 🙂 and Gio, thanks again for being so proactive in making sure this is solved fast